Skip to content

Instantly share code, notes, and snippets.

@dannygarcia
Last active September 23, 2020 23:52
Show Gist options
  • Save dannygarcia/4d965c84e0278a5a65cc13b0b5d51f41 to your computer and use it in GitHub Desktop.
Save dannygarcia/4d965c84e0278a5a65cc13b0b5d51f41 to your computer and use it in GitHub Desktop.
Convert Image Sequence to Animations
# This is not intended to be run as an executable shell script file.
# These are just the commands I use directly in the terminal after `cd`-ing to the image sequence directory.
# Images are named in this format: ####.png
# Convert video to sequence (ffmpeg)
ffmpeg -i anim.mp4 -vf fps=60 %04d.png
# Convert sequence to animated GIF (imagemagick)
convert -delay 2.5 -loop 0 *.png anim.gif
# Convert sequence to video @ 24fps (ffmpeg)
# https://avpres.net/FFmpeg/sq_H264.html
ffmpeg -r 24 -f image2 -i %04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p anim.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment