Parker Glynn-Adey

Simple Stop Motion with ffmpeg

Posted in Computers, Uncategorized by pgadey on 2020/09/12

Andrew Lindesay has a nice script for simple script for using ffmpeg to do stop motion:


ffmpeg -framerate 10 \
-pattern_type glob -i '*.JPG' \
-vf scale=640:-1 -c:v libx264 -pix_fmt yuv420p \
out.mp4

This works great for compiling photos shot by a GoPro!
The shots are labelled chronologically by frame number:


G0107340.JPG
G0107341.JPG
G0107342.JPG
G0107343.JPG
G0107344.JPG
G0107345.JPG
G0107346.JPG
G0107347.JPG
G0107348.JPG
G0107349.JPG

So, the -pattern_type glob -i '*.JPG' argument picks them up in order.

The argument scale 640:-1 automatically resizes frames to 640xY and preserves the aspect ratio. This might not be what you want, but it makes for small videos.

Tagged with: , ,