5

What are the best settings when converting, say, a .mp4 video to WebM?

I have done some searching on here but nothing specific to what I need really.

What I've been using:

avconv -i input.mp4 \
       -c:v libvpx -qmin 10 -qmax 42 -maxrate 500k -bufsize 1000k -threads 2 \
       -c:a libvorbis output.webm

However this seems to have issues. I can not upload/embed it on sites that support WebM and if I get it to it sometimes will not have any video, just audio. I have also tried without the qmin, qmax, maxrate and bufsize options or a combination of them. I have also tried using AviDemux with the same issue. Says I can't upload it on certain sites or ones I can it will have playback issues.

I'm not great with video codecs and converting so sorry if I'm just missing something really obvious. Any advice would help. Thanks in advance.

  • The '-an' option will also drop the audio for uploading your WebM video to boards like 4chan, 7chan, etc. – NPIC Jan 16 '15 at 21:51
  • Could you please convert your comment to an answer so that another user can use this as well in the future? ;-) – Fabby Jan 17 '15 at 18:10
  • 1
    @Fabby Added as an answer. Hope this helps. – NPIC Jan 18 '15 at 6:53
  • It helped you! Your reputation went up! ;-) – Fabby Jan 18 '15 at 11:12
  • 1
    @Fabby Oh I see, you meant for other new users like myself. Didn't realize you were a more experienced user. Thank you, by the way. :P – NPIC Jan 19 '15 at 5:49
5

Actually, I think I can answer my own question after spending some time reading around and messing with the avconv command myself. I found that these settings seem to work perfect for what I need:

avconv -i input.mp4 \
       -c:v libvpx -qmin 20 -qmax 30 -ss 00:00:30 -t 00:01:00 -threads 2 \
       -c:a libvorbis \
       output.webm 

I realized that it was easier to just split the video using the command line also. The -ss hh:mm:ss splits the video starting at that point and -t indicates the time it records after.

The -an option will also drop the audio for uploading your WebM video to boards like 8chan, 7chan, 4chan, etc.

The -s option will "downsample" and use a new resolution for the video size. Such as -s 640x480, for example.

So in conclusion, if you were trying to convert part of a video (using all of the mentioned options) 1 minute in, for 30 seconds after that point, while scaling the resolution down and dropping audio, it would look like this:

avconv -i MyFavoriteMovie.mp4 \
       -c:v libvpx -qmin 20 -qmax 30 -ss 00:01:00 -t 00:00:30 -s 640x480 -an -threads 2 \
       -c:a libvorbis \
       output.webm

Just to give an example. This would create a 30 second clip with the given resolution.

Hope this helps other avconv beginners as well.

  • If you're happy wth your results, you should accept your answer. – Wren Feb 14 '16 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.