Skip to content

Instantly share code, notes, and snippets.

@aferriss
Last active March 7, 2016 23:38
Show Gist options
  • Save aferriss/864f26239507b63a2f22 to your computer and use it in GitHub Desktop.
Save aferriss/864f26239507b63a2f22 to your computer and use it in GitHub Desktop.
ffmpeg compress video to MP4
ffmpeg -i input.mov -c:v libx264 -maxrate 20000k -bufsize 3000k -pix_fmt yuv420p -crf 24 out.mp4
# see here https://trac.ffmpeg.org/wiki/Encode/H.264
# -pix_fmt may not be necessary but I use it sometimes for backwards compatibility.
# -bufsize tells ffmpeg how often to check that bitrate is at the requested rate
# -crf is not necessary but can get videos really small if set >30 (at the expense of quality)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment