Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting mkv to mp4 vs ogv vs webm

Tags:

ffmpeg

mp4

mkv

webm

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
like image 231
soap23 Avatar asked Oct 31 '25 17:10

soap23


1 Answers

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.

like image 145
Dmitry Shkuropatsky Avatar answered Nov 03 '25 16:11

Dmitry Shkuropatsky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!