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.

andrew.46
  • 39,359
NPIC
  • 119
  • 1
  • 7

1 Answers1

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.

andrew.46
  • 39,359
NPIC
  • 119
  • 1
  • 7