Converting mkv to mp4 vs ogv vs webm

soap23 picture soap23 · Jan 21, 2013 · Viewed 10.8k times · Source

I am trying to convert an mkv file to mp4, webm, and ogv using ffmpeg and I am getting really drastic performance results.

The mkv -> mp4 conversion took all of 2 seconds while the webm and ogv conversions took about 5-10minutes. Is there a faster way to convert to these formats?

Commands used:

mkv -> mp4

ffmpeg -i ironman2trailer.mkv -vcodec copy -acodec copy -absf aac_adtstoasc output.mp4

mkv -> webm

ffmpeg -i -f webm -vcodec libvpx -acodec libvorbis output.webm

Answer

Dmitry Shkuropatsky picture Dmitry Shkuropatsky · Jan 21, 2013

In the second command the most of the time was probably taken by video encoding.

More specifically, in addition to changing file container format (that is from mkv to webm), the second command changed codecs of video and audio streams. This includes decoding original streams and encoding them with new codecs.

Your first command just changed the file container format that is not a processor-intensive operation. The original audio and video streams encodings were kept intact that is specified by copy option for audio and video codecs.