Skip to content

Instantly share code, notes, and snippets.

@davidjb
Last active August 11, 2023 21:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidjb/41297c9d35b90868e193fd4307e51835 to your computer and use it in GitHub Desktop.
Save davidjb/41297c9d35b90868e193fd4307e51835 to your computer and use it in GitHub Desktop.
Create a timelapsed video from a collection of video files in one hit
# Create `list.txt` via https://trac.ffmpeg.org/wiki/Concatenate; aka a file with lines like:
# file 'foobar.mp4'
# file 'foobaz.mp4'
# Swap the codec as per https://www.rickmakes.com/ffmpeg-timelapse-from-video-speed-up-vs-every-n-th-frame/ if you want hardware encoding or use a different platform
# 0.002 = 500x
ffmpeg -f concat -i list.txt -an -vf "setpts=0.002*PTS" -vcodec h264_videotoolbox -b:v 10000k -r 30 -pix_fmt yuv420p out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment