- Get video length (in seconds) using
ffprobe
- Calculate frame rate (
video_length / desired_image_width
) - Initialize
output_image
andtemporary_image
output_image
will be the final barcode imagetemporary_image
will be a 1x1 bitmap containing the average color of the current frame
- Extract frame from video using
ffmpeg
and save intemporary_image
- Draw line on
output_image
using color fromtemporary_image
- Repeat step 4 until we've reached the final frame
- Save
output_image
positional arguments:
file file to process
optional arguments:
-h, --help show this help message and exit
--output OUTPUT output file
--width WIDTH output image width (default=1280)
--height HEIGHT output image height (default=720)
--thickness THICKNESS frame thickness (default=10)
- small videos should finish within 1 minute (for default settings)
- large video files are slow (movies can take from 1-5 mintues depending on file size and total length)
- resolution is irrelevant (no need for 4K video files)
thickness
should be a multiple ofwidth
but is not enforcedoutput_image
will be automatically named based on input- if
--output
option is provided with trailing slash then the image will still be automatically named but place in to that directory
- if