Michael Niedermayer <[EMAIL PROTECTED]> added the comment: On Mon, Nov 17, 2008 at 03:34:52AM +0000, hjr wrote: > > New submission from hjr <[EMAIL PROTECTED]>: > > FFmpeg version SVN-r15841, Copyright (c) 2000-2008 Fabrice Bellard, et al. > configuration: --cc=cc --prefix=/usr/local --disable-debug > --enable-memalign-hack --enable-shared --enable-postproc > --extra-cflags=-I/usr/local/include/vorbis -I/usr/local/include > --extra-ldflags=-L/usr/local/lib --extra-libs=-pthread --enable-gpl > --enable-pthreads --enable-swscale --mandir=/usr/local/man --disable-libfaac > --enable-libfaad --enable-libfaadbin --enable-libamr-nb --enable-nonfree > --enable-libamr-wb --enable-nonfree --disable-mmx --enable-libgsm > --enable-libmp3lame --disable-ffplay --enable-libtheora --enable-libvorbis > --disable-libx264 --disable-libxvid --enable-libmp3lame --enable-encoder=mp3 > --disable-devices --disable-network --enable-encoder=libmp3lame > > FreeBSD 7.0-RC2 @ amd64 > > Note: Some of these configs are maybe non-sense, but that was just my best try > to get the latest svn version to compile on FreeBSD. Later versions in the > FreeBSD ports collection suffered from the same problem (SVN-r14424). > > I use ffmpeg solely for audio re-encoding. For some files, I get many lines of > "lame: output buffer too small" and the output file is truncated. This > happened > only with some files and then I found out that decreasing the target audio > quality would solve the problem. > > File: http://tmp.tomas-muller.net/32.mp3 (~6 MB). > > ffmpeg -i 32.mp3 -acodec libmp3lame -aq 2 -ar 44100 -ac 2 test-bad.mp3 > > exhibits the error, while > > ffmpeg -i 32.mp3 -acodec libmp3lame -aq 3 -ar 44100 -ac 2 test-bad.mp3 > > (decreased audio quality) does not. When I increased the buffer size at > libavcodec/libmp3lame.c (line 31: #define BUFFER_SIZE) and recompiled, problem > was solved. My guess is that increasing the BUFFER_SIZE to accommodate the > maximum mp3 bitrate (320kbps) would fix this. > > libavcodec/libmp3lame.c(31): #define BUFFER_SIZE (7200 + MPA_FRAME_SIZE + > MPA_FRAME_SIZE/4) >
> Shouldn't this be MPA_MAX_CODED_FRAME_SIZE ? no, lame.h clearly says: * The required mp3buf_size can be computed from num_samples, * samplerate and encoding rate, but here is a worst case estimate: * * mp3buf_size in bytes = 1.25*num_samples + 7200 [...] ______________________________________________________ FFmpeg issue tracker <[EMAIL PROTECTED]> <https://roundup.mplayerhq.hu/roundup/ffmpeg/issue719> ______________________________________________________
