First create an image sequence from a video with:
ffmpeg -i path/to/video.mp4 -r 30 path/to/output/folder/%06d.png
Where -r
specifies the frequency to save an image (in Hz
, i.e. 30
== 30fps
) and %06d.png
creates a zero-padded filename with 6 zeros.
Next images must be scaled and cropped. For my original case, I need to generate new images based on 512x512 input images, so I will crop a greedy (720x720
) square out of a 1280x720
video in the direct center and then scale to 512x512
. mogrify
, unlike convert
, edits images in place without creating copies :)