Sunday, April 10, 2016

Converts videos to WebM with aconv/ffmpeg

Using aconv:
http://daniemon.com/blog/how-to-convert-videos-to-webm-with-ffmpeg/

Using ffmpeg:
http://trac.ffmpeg.org/wiki/Encode/VP8

Example code:
ffmpeg -i $INPUT -c:v libvpx -crf 4 -b:v 10M -c:a libvorbis $OUTPUT
The above command converts the input file to webm with a variable bitrate in a constant quality mode, which ensures that every frame achieve a certain quality level. In this command, -b:v 10M sets the maximum allowed bitrate to 10 MBit/s and -crf 4 sets the constant quality to 4 (best quality).