Skip to content

Instantly share code, notes, and snippets.

@balzer82
Last active August 29, 2015 14:03
Show Gist options
  • Save balzer82/97b09c4ba66bf2d10c2d to your computer and use it in GitHub Desktop.
Save balzer82/97b09c4ba66bf2d10c2d to your computer and use it in GitHub Desktop.
ffmpeg Vimeo encoding options

Install ffmpeg on Mac:

sudo port install ffmpeg

Vimeo has a 500MB filesize limit in the basic account, so you might want to reduce the file size to the limit, if it is too large. Let's say you have a 20min video file, which is too large. Then you have to reduce the bitrate for encoding:

(500 MB * 8192) / (20min * 60) = ~3413 kilobits/s

Minus the bitrate for audio: 3413k - 128k (desired audio bitrate) = max 3285k Video Bitrate

The ffmpeg option for optimal Vimeo encoding and barely 500MB file size is:

ffmpeg -y -i input.mov -strict -2 -c:v libx264 -preset fast -crf 20 -maxrate 3285k -pix_fmt yuv420p -c:a aac -b:a 128k output.mp4

More...

@balzer82
Copy link
Author

To speed up a video by factor of 2:

ffmpeg -y -i input.mov -strict -2 -c:v libx264 -preset fast -crf 4 -maxrate 5000k -pix_fmt yuv420p -filter:v "setpts=0.5*PTS" -c:a aac -b:a 128k out.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment