[Ffmpeg-devel] ffmpeg & lame low bitrate causes failed assertion
Benoit Fouet
benoit.fouet
Thu Feb 22 09:16:51 CET 2007
Hi,
Asli Binal wrote:
> 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.
>
i have a slightly different functionning here... the input file is
invalid (see the "[pcm_s16be @ 0x843cca0]invalid PCM packetbits/s"
trace), so, whatever the output bitrate, it stops after 58 seconds.
$ffmpeg -i abinal-pcm.wav -ab 32 -vn output.ffmpeg.mp3
FFmpeg version SVN-r8066, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-libmp3lame --enable-xvid
--enable-libogg --enable-libvorbis --enable-x264 --enable-libfaad
--enable-libfaac --enable-amr_nb --enable-amr_wb --enable-pp
--disable-strip --prefix=/usr --mandir=/usr/share/man --arch=amd64
--enable-x11grab
libavutil version: 49.3.0
libavcodec version: 51.34.0
libavformat version: 51.10.0
built on Feb 22 2007 08:26:48, gcc: 3.4.6 (Gentoo 3.4.6-r1,
ssp-3.4.5-1.0, pie-8.7.9)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'abinal-pcm.wav':
Duration: 00:02:47.7, start: 0.000000, bitrate: 488 kb/s
Stream #0.0(eng): Audio: pcm_s16be, 44100 Hz, stereo, 1411 kb/s
Output #0, mp3, to 'output.ffmpeg.mp3':
Stream #0.0: Audio: mp3, 44100 Hz, stereo, 32 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[pcm_s16be @ 0x843cca0]invalid PCM packetbits/s
Error while decoding stream #0.0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x837cd00]stream 0, offset 0x9d802b: partial file
size= 227kB time=58.0 bitrate= 32.0kbits/s
video:0kB audio:227kB global headers:0kB muxing overhead 0.000000%
for your information, it's not a "raw" wav file but one encapsulated in
a mov one.
also, just do some maths ;)
you know the size of your file, you also know the frequency, the phony,
the number of bits per sample.
you can then know the bitrate.
your file is 9.8MB large, so this gives you the audio duration
approximately...
which is aroud 58 seconds.
to me, your file, as i mentionned before, is corrupted...
> 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.
>
> 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
>
have you tried to hear what you produced with lame ?
i did, and found out it's everything but correct :)
(i only have lame LAME 32bits version 3.97 though)
> 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.
>
i don't have any problems using "real" wav files
> Using lame : LAME 32bits version 3.98
> ffmpeg version:
> FFmpeg version SVN-r8045, Copyright (c) 2000-2007 Fabrice Bellard, et al.
> configuration: --prefix=/Users/Asli/CODE/ffmpeg/installed
> --enable-libmp3lame --enable-gpl --extra-cflags=-I
> /Users/Asli/CODE/lame/installed/include
> --extra-ldflags=-L/Users/Asli/CODE/lame/installed/lib
> 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)
> ffmpeg SVN-r8045
> libavutil 3212032
> libavcodec 3351040
> libavformat 3344896
>
> Running on Macbook Pro (Intel core duo), os 10.4.8
> gcc version: gcc version 4.0.1 (Apple Computer, Inc. build 5367)
>
> Any advice will be greatly appreciated, Thanks
> AB
i would advice you to produce your wav files by other means...
Ben
More information about the ffmpeg-devel
mailing list