avconv mp4 to webm libvorbis buffer overflow

9.2k views Asked by At

Trying to convert a bunch of mp4 files into webm. So I run the following command. I tried a similar command with ffmpeg.

avconv -i input.mp4 -threads 8 -s 1280x720 -pre libvpx-720p -b 3900k -pass 2 -acodec libvorbis -b:a 128k -ac 2 -f webm -y output/webm

Results in:

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf52.32.0
  Duration: 00:01:02.90, start: 0.000000, bitrate: 1649 kb/s
    Stream #0.0(und): Video: mpeg4 (Simple Profile), yuv420p, 640x480 [PAR 4:3 DAR 16:9], 1492 kb/s, PAR 853:640 DAR 853:480, 23.94 fps, 30 tbr, 30 tbn, 30 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
    Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 152 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
[buffer @ 0x1232600] w:640 h:480 pixfmt:yuv420p
[scale @ 0x123c300] w:640 h:480 fmt:yuv420p -> w:1280 h:720 fmt:yuv420p flags:0x4
[libvpx @ 0x1256d60] v1.0.0
Output #0, webm, to 'output.webm':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf53.21.0
    Stream #0.0(und): Video: libvpx, yuv420p, 1280x720 [PAR 2559:2560 DAR 853:480], q=11-51, pass 2, 3900 kb/s, 1k tbn, 30 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
    Stream #0.1(und): Audio: libvorbis, 44100 Hz, stereo, s16, 152 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> libvpx)
  Stream #0:1 -> #0:1 (aac -> libvorbis)
Press ctrl-c to stop encoding
[libvorbis @ 0x1221240] libvorbis: buffer overflow.Audio encoding failed

Notice the nice error. buffer overflow in libvorbis.

Any assistance? An Alternative conversion command?

UPDATE

The first pass looks like this:

 avconv -i input.mp4 -threads 8 -s 1280x720 -pre libvpx-720p -b 3900k -pass 1 -an -f webm -y output.webm

Thanks!

2

There are 2 answers

0
Halsafar On BEST ANSWER

Turns out it was an issue with -pre vs -preset in avconv. This whole ffmpeg fork to avconv has broken the community for everyone except the developers. Now googling for useful information on either tool is useless.

For those who end up here on a similar issue this is how I converted my mp4 to webm.

avconv -i "$inputFile" -threads 8 -s 1280x720 -preset libvpx-720p -b 3900k -pass 1 -an -f webm -y "$outputFile"
avconv -i "$inputFile" -threads 8 -preset libvpx-720p -pass 2 -b 3900k -acodec libvorbis -ar 44100 -ac 2 -ab 128k -f webm -y "$outputFile"

This is for 720P mp4 to 720P WEBM. You can easily adjust to 1080P, the preset exists.

0
Freefri On

I do this to convert from my video camera to 720p webm in one pass:

avconv -i videoIn.MTS -c:v libvpx -b:v 6000k -qmin 10 -qmax 42 -maxrate 500k -bufsize 1500k -threads 8 -vf scale=-1:720 -c:a libvorbis -b:a 192k -f webm videoOut.webm