2

Years ago when the VP8 codec came out, I used a program on Ubuntu to convert all of my files to WebM and it would cut the filesize in half. 22-minute episodes going from 300MB to under 150MB.

I think it may have been Miro Video Converter, but they only offer the source tarball now and the instructions don't say how to compile it. I'd kill to have a working .deb of it.

Now I try to do it with WinFF, QWinFF, Videomass, FFmpeg, and nothing achieves this effect... Not only does the conversion of a single file strangely take literally multiple hours, but the resulting file is even larger than the original mp4s... They're only 640x480 too. The bitrate is like 1500.

What am I doing wrong? I cannot, for the life of me, seem to find any video converter on Linux that will reduce the file size of my oversized uncompressed MP4s and AVIs. Is it just the parameters? Is there something in it that I'm doing wrong? Are there any video converters that will do it better?

I'd be willing to do it command line if I have to but I understand that several of the ones I mentioned are just front ends for FFmpeg.

Edit: Example - input video with codecs mpeg4 aac, 2k bitrate, 127k audio at 44k sample rate, 24 FPS. Converted with ffmpeg to VPx vorbis, same audio, 1.5k bitrate, same framerate, same dimensions. And the resulting file was larger?

0

1 Answer 1

7

A standard FFmpeg conversion to webm should look something like the following 2 pass example. I have set it out so it is a single code block that can be copied and pasted as is:

ffmpeg -i input.file \
        -c:v libvpx-vp9 -b:v 0 -crf 30 -pass 1 -an \
        -deadline best -row-mt 1 \
        -f null /dev/null && \
ffmpeg -i input.file \
        -c:v libvpx-vp9 -b:v 0 -crf 30 -pass 2 \
        -deadline best -row-mt 1 \
        -c:a libopus -b:a 96k -ac 2 \
        output.webm

A few explanatory notes for some of these options, with emphasis on the quality / file size issues:

  • -crf 30: Settings are from 0 - 63 with lower values having better quality (and bigger file size). Experiment with this but 30 is generally a decent spot.
  • -deadline best: Choice is realtime | good | best with 'best' being the slowest (good quality), 'best' the default and 'realtime' the fastest and lowest quality.
  • -row-mt 1: This will turn on row based multithreading and should allow for a faster encode with a suitable multi-threaded CPU.
  • -c:a libopus: A better choice than Vorbis, which I see you have mentioned, and has better playback at a lower bitrate (and smaller file size).

Manipulation of these options should hopefully give you the smaller output file you are after, while still retaining reasonable quality.

Bear in mind that encoding with VP9 is always painfully slow...

References:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .