Skip to content

Instantly share code, notes, and snippets.

@dansloane
Last active June 13, 2016 14:50
Show Gist options
  • Save dansloane/21017ea4fd6df4b37eb3b0cde1b23aa4 to your computer and use it in GitHub Desktop.
Save dansloane/21017ea4fd6df4b37eb3b0cde1b23aa4 to your computer and use it in GitHub Desktop.
Convert non-even sized PNG sequence to H264 using ffmpeg
# Sources
# http://hamelot.io/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video/
# http://stackoverflow.com/a/20848224
# Tested on OS X with ffmpeg 3.0.2 via Brew
# PNG image sequence was 875x875
ffmpeg -r 25 -f image2 -s 874x874 -i paddedtofive_%05d.png
-vcodec libx264 -crf 25
-pix_fmt yuv420p
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" test.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment