[Ffmpeg-devel] ffmpeg & lame low bitrate causes failed assertion

Måns Rullgård mans
Wed Feb 21 17:17:20 CET 2007


Asli Binal said:
> Hi folks,
> I've been trying to track this issue down for 2 weeks now (mailing
> lists/archives/google groups/etc), and I'm willing to take the risk of
> getting flamed in order to get some useful feedback.  The basic issue is
> that ffmpeg asserts out on a file that contains uncompressed 16-bit (big
> endian) PCM, 44.1KHz audio file *when* I set the audio bitrate flag to 32.
>
> ffmpeg -i input.wav -vn -ab 32 output.mp3
> ...after 2 minutes 32 seconds...
>   libavutil version: 49.3.0
>   libavcodec version: 51.34.0
>   libavformat version: 51.10.0
>   built on Feb 20 2007 15:28:37, gcc: 4.0.1 (Apple Computer, Inc. build
> 5367)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
> '/Users/Asli/Desktop/current-tests/input.wav':
>   Duration: 00:25:35.0, start: 0.000000, bitrate: 1411 kb/s
>   Stream #0.0(eng): Audio: pcm_s16be, 44100 Hz, stereo, 1411 kb/s
> File 'output.mp3' already exists. Overwrite ? [y/N] y
> Output #0, mp3, to 'output.mp3':
>   Stream #0.0: Audio: mp3, 44100 Hz, stereo, 32 kb/s
> Stream mapping:
>   Stream #0.0 -> #0.0
> Press [q] to stop encoding
> quantize.c:2050: failed assertion `cod_info->part2_3_length <= MAX_BITS'
> Abort trap
>
> The above *always* happens at duration 00:02:32 - so I can replicate the
> issue with the 3 minute version of the file.

The bug is clearly in Lame, since that's where the failing assert() is.
However, I'm somewhat surprised to see big endian there, as WAV PCM is
little endian.

> When I run ffmpeg with the default settings: " ffmpeg -i input.wav -vn
> output.mp3 " - runs fine, using the default audio settings and is able to
> create output.mp3
>
> Also, when I take the same input.wav file and pass it into lame to create an
> mp3 file, it runs succesfully.
>
> lame -b 32 --resample 44.1 input.wav output.mp3
>
> I am able to reproduce this issue with several files, and can supply the
> file - but I'm pretty sure any uncompressed pcm 44.1 file can cause the
> issue.

Please upload a file that triggers the problem.  Believe it or not, people
are using ffmpeg to convert wav to mp3 quite successfully.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list