The command

# Specifically, this converts a series of timelapse images made with a GoPro into a 1080p video of good quality


ffmpeg -r 3 -start_number 26565 -i G00%05d.JPG -vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" -r 29.97 -an -c:v libx264 -crf 21 -pix_fmt yuv420p -preset slow timelapse-video.mp4

When to use it

This is useful when you have a folder of numbered stills, such as a GoPro timelapse, and want a 1080p MP4 that fills the frame with no black bars. The header explains each flag. Skip it if the whole image must stay visible: the fill-and-crop step trims the edges of any image that isn't 16:9, keeping the centre.

Each image is shown at 3 per second and the output is written at 29.97 fps, so stills repeat rather than blend. Raise the input rate for a faster timelapse or lower it to linger. Other easy edits:

  • set the start number to your first file and the name pattern to match your camera's naming
  • change 1920:1080 in both places for another frame size
  • raise the CRF value for smaller files, or lower it for higher quality

If the output looks wrong, first check that the start number matches a real file. Then make sure there are no gaps in the numbering, since a missing number can end the sequence early. Also check that the digit count in the pattern matches your filenames. If the framing is off, your source isn't 16:9 and the crop removed more than you expected.