Skip to content

Instantly share code, notes, and snippets.

@hmparanjape
Created July 9, 2015 20:08
Show Gist options
  • Save hmparanjape/e681036e3e72f3a575c0 to your computer and use it in GitHub Desktop.
Save hmparanjape/e681036e3e72f3a575c0 to your computer and use it in GitHub Desktop.
Make MP4 movie from a PNG image sequence
#!/bin/bash
# Create an MP4 movie from the image sequence.
# Specify
# -framerate N = frames/sec
# -i FILENAMES = image file path and names. %04d says that the numbering for images is fixed width (width = 4) and zeros are used for padding
ffmpeg -framerate 11 -i image_directory/image_stem_%04d.png -c:v libx264 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" movie_name.mp4
# Ideally this should play well on OS X, Windows and Linux. Uploads to Youtube.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment