Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

Simple glob:

ffmpeg -r 24 -i '*.JPG' -s hd1080 -vcodec libx264 timelapse.mp4

Start from DSC_0079.JPG

ffmpeg -r 24 -f image2 -start_number 79 -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse2.mp4
  • -r 24 - output frame rate
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

Add the following after -vcodec libx264 to achieve better quality output

-crf 18 -preset slow

Bulk convert JPGs to 1920x1080, centered

convert input.jpg -resize '1920x1080^' -gravity center -crop '1920x1080+0+0' output.jpg

@tomav

This comment has been minimized.

Copy link

commented Jun 10, 2017

The last one is not bulk but unique image.

@abixalmon

This comment has been minimized.

Copy link

commented Aug 2, 2017

Pattern type 'glob' was selected but globbing is not supported by this libavformat build
*.JPG: Function not implemented

@Pierstoval

This comment has been minimized.

Copy link

commented Jul 14, 2018

Saved my life 👍

@billmei

This comment has been minimized.

Copy link

commented Jan 3, 2019

I made a fork of this using the crop option in ffmpeg so that you no longer need to run convert: https://gist.github.com/billmei/9b2ebeceb879c53de00e297f471b0719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.