Skip to content

Instantly share code, notes, and snippets.

@josefandersson
Created May 16, 2021 10:31
Show Gist options
  • Save josefandersson/58707f82fd287ed08c72e6712bd4fbfa to your computer and use it in GitHub Desktop.
Save josefandersson/58707f82fd287ed08c72e6712bd4fbfa to your computer and use it in GitHub Desktop.
Create a timelapse video file from many images using FFMPEG
# Create a timelapse video from many images
ffmpeg -r 60 -pattern_type glob -i "*.JPG" -s 1920x1440 -vcodec libx264 output.mp4
# -r <framerate> : output framerate
# -pattern_type glob : allow for * input
# -i <pattern> : input files pattern
# -s <size> : output size (4000x3000 -> 1920x1440 is suitable for GoPro output)
# -vcodec <codec> : output codec (see ffmpeg -codecs) (libx264 for standard mpeg-4 avc) (libx265 for hevc)
# May also be relevant to rotate the output:
# -vf "transpose=1" : rotate 90 degrees clockwise
# -vf "transpose=2" : rotate 90 degrees anti-clockwise
# -vf "transpose=2,transpose=2" : rotate 180 degrees
# Rotation can be done in metadata too (but since we are already encoding the video we might as well rotate it properly as seen above):
# -metadata:s:v rorate=<degrees> : rotate by degrees clockwise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment