Skip to content

Instantly share code, notes, and snippets.

@huyby
Last active August 30, 2016 14:24
Show Gist options
  • Save huyby/7563406 to your computer and use it in GitHub Desktop.
Save huyby/7563406 to your computer and use it in GitHub Desktop.
Use ffmpeg/ffmpeg2theora to convert video to formats suitable for web usage, convertors like Miro Video Converter don't always have good results. Also check ffmpegx GUI.

webm examples (VP8/VP9)

https://trac.ffmpeg.org/wiki/Encode/VP8 https://sites.google.com/a/webmproject.org/wiki/ffmpeg http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide

ffmpeg -i "input.mov" -q:v libvpx -crf 10 -b:v 1M -q:a libvorbis output.webm

There's regularly updated spreadsheet available listing all ffmpeg arguments valid for VP8 (and maybe VP9) encoding: https://docs.google.com/spreadsheets/d/1SU6hqVQ7AvCl52q05h0JW1IPDRLXaqm-0zanlMG7GYg

ogv

https://trac.ffmpeg.org/wiki/TheoraVorbisEncodingGuide

ffmpeg -i "input.mov" -c:v libtheora -q:v 5 -b:v 1M -c:a libvorbis -ab 128k

Alternative:

ffmpeg2theora input.mov -V 1000 --soft-target --videoquality 8 --audioquality 6 output.ogv

mp4 (or use Handbrake)

https://trac.ffmpeg.org/wiki/Encode/H.264

ffmpeg -i "input.mov" -c:v libx264 -preset slow -profile:v high -crf 23 -b:v 1M -c:a libfaac -ab 128k  -pix_fmt yuv420p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment