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 ?

----------
messages: 3657
priority: normal
status: new
substatus: new
title: libmp3lame: output buffer too small (many times repeated), truncated file
type: bug

______________________________________________________
FFmpeg issue tracker <[EMAIL PROTECTED]>
<https://roundup.mplayerhq.hu/roundup/ffmpeg/issue719>
______________________________________________________

Reply via email to