[FFmpeg-trac] #289(undetermined:open): Regression: mp3 duration estimated from bitrate wrong (bitrate guess wrong)

FFmpeg trac at avcodec.org
Tue Jun 21 02:15:31 CEST 2011


#289: Regression: mp3 duration estimated from bitrate wrong (bitrate guess wrong)
-------------------------------------------------+-------------------------
Reporter:  hjr                                   |       Owner:
    Type:  defect                                |      Status:  open
Priority:  normal                                |   Component:
 Version:  git-master                            |  undetermined
Keywords:  regression mp3 duration bitrate       |  Resolution:
  estimate                                       |  Blocked By:
Blocking:                                        |  Reproduced:  1
Analyzed:  0                                     |
-------------------------------------------------+-------------------------

Comment (by hjr):

 With the recent build, on files remuxed by ffmpeg the duration is probed
 right, files remuxed by libav (uploaded ones) the duration is probed wrong
 - just to clear any confusion here.

 Versions between r19300 and recent fail on original file:

 {{{
 hujer at sid ~/> ffmpeg -analyzeduration 1000000000 -i duration-problem.mp3
 FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
   built on Apr  8 2011 11:07:57 with gcc 4.2.1 20070719  [FreeBSD]
   configuration: --prefix=/usr/local --mandir=/usr/local/man --enable-
 shared --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-
 lavf --enable-pthreads --enable-x11grab --enable-memalign-hack --cc=cc
 --extra-cflags=-msse -I/usr/local/include/vorbis -I/usr/local/include
 --extra-ldflags=-L/usr/local/lib --extra-libs=-pthread --disable-debug
 --enable-runtime-cpudetect --disable-indev=alsa --disable-outdev=alsa
 --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb
 --disable-libdirac --disable-libfaac --enable-libfaad --enable-libfaadbin
 --disable-ffserver --enable-libgsm --enable-libmp3lame --disable-
 libopenjpeg --enable-libschroedinger --disable-ffplay --enable-libspeex
 --disable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis
 --disable-libvpx --disable-libx264 --disable-libxvid
   libavutil     50.15. 1 / 50.15. 1
   libavcodec    52.72. 2 / 52.72. 2
   libavformat   52.64. 2 / 52.64. 2
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.19. 0 /  1.19. 0
   libswscale     0.11. 0 /  0.11. 0
   libpostproc   51. 2. 0 / 51. 2. 0
 [mp3 @ 0x80311c010]Estimating duration from bitrate, this may be
 inaccurate
 Input #0, mp3, from 'duration-problem.mp3':
   Metadata:
     TSSE            : Lavf52.39.2
   Duration: 00:14:44.44, start: 0.000000, bitrate: 32 kb/s
     Stream #0.0: Audio: mp3, 44100 Hz, 2 channels, s16, 32 kb/s
 At least one output file must be specified
 }}}

 as well as on remuxed files:

 {{{
 $ ffmpeg -v 9 -loglevel 99 -i duration-problem.mp3 -acodec copy -t 5
 ffmpeg-0.6.1-copy.mp3
 FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
   built on Apr  8 2011 11:07:57 with gcc 4.2.1 20070719  [FreeBSD]
   configuration: --prefix=/usr/local --mandir=/usr/local/man --enable-
 shared --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-
 lavf --enable-pthreads --enable-x11grab --enable-memalign-hack --cc=cc
 --extra-cflags=-msse -I/usr/local/include/vorbis -I/usr/local/include
 --extra-ldflags=-L/usr/local/lib --extra-libs=-pthread --disable-debug
 --enable-runtime-cpudetect --disable-indev=alsa --disable-outdev=alsa
 --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb
 --disable-libdirac --disable-libfaac --enable-libfaad --enable-libfaadbin
 --disable-ffserver --enable-libgsm --enable-libmp3lame --disable-
 libopenjpeg --enable-libschroedinger --disable-ffplay --enable-libspeex
 --disable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis
 --disable-libvpx --disable-libx264 --disable-libxvid
   libavutil     50.15. 1 / 50.15. 1
   libavcodec    52.72. 2 / 52.72. 2
   libavformat   52.64. 2 / 52.64. 2
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.19. 0 /  1.19. 0
   libswscale     0.11. 0 /  0.11. 0
   libpostproc   51. 2. 0 / 51. 2. 0
 [NULL @ 0x80311b010]Probed with size=2048 and score=51
 [mp3 @ 0x80311b010]max_analyze_duration reached
 [mp3 @ 0x80311b010]Estimating duration from bitrate, this may be
 inaccurate
 Input #0, mp3, from 'duration-problem.mp3':
   Metadata:
     TSSE            : Lavf52.39.2
   Duration: 00:14:44.44, start: 0.000000, bitrate: 32 kb/s
     Stream #0.0, 194, 1/14112000: Audio: mp3, 44100 Hz, 2 channels, s16,
 32 kb/s
 Output #0, mp3, to 'ffmpeg-0.6.1-copy.mp3':
   Metadata:
     TSSE            : Lavf52.64.2
     Stream #0.0, 0, 1/90000: Audio: libmp3lame, 44100 Hz, 2 channels, 32
 kb/s
 Stream mapping:
   Stream #0.0 -> #0.0
 Press [q] to stop encoding
 size=     103kB time=5.02 bitrate= 167.7kbits/s
 video:0kB audio:103kB global headers:0kB muxing overhead 0.031396%
 }}}

 {{{
 $ ffmpeg -v 9 -loglevel 99 -i ffmpeg-0.6.1-copy.mp3
 FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
   built on Apr  8 2011 11:07:57 with gcc 4.2.1 20070719  [FreeBSD]
   configuration: --prefix=/usr/local --mandir=/usr/local/man --enable-
 shared --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-
 lavf --enable-pthreads --enable-x11grab --enable-memalign-hack --cc=cc
 --extra-cflags=-msse -I/usr/local/include/vorbis -I/usr/local/include
 --extra-ldflags=-L/usr/local/lib --extra-libs=-pthread --disable-debug
 --enable-runtime-cpudetect --disable-indev=alsa --disable-outdev=alsa
 --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb
 --disable-libdirac --disable-libfaac --enable-libfaad --enable-libfaadbin
 --disable-ffserver --enable-libgsm --enable-libmp3lame --disable-
 libopenjpeg --enable-libschroedinger --disable-ffplay --enable-libspeex
 --disable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis
 --disable-libvpx --disable-libx264 --disable-libxvid
   libavutil     50.15. 1 / 50.15. 1
   libavcodec    52.72. 2 / 52.72. 2
   libavformat   52.64. 2 / 52.64. 2
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.19. 0 /  1.19. 0
   libswscale     0.11. 0 /  0.11. 0
   libpostproc   51. 2. 0 / 51. 2. 0
 [NULL @ 0x80311b010]Probed with size=2048 and score=51
 [mp3 @ 0x80311b010]Estimating duration from bitrate, this may be
 inaccurate
 Input #0, mp3, from 'ffmpeg-0.6.1-copy.mp3':
   Metadata:
     TSSE            : Lavf52.64.2
   Duration: 00:00:26.28, start: 0.000000, bitrate: 32 kb/s
     Stream #0.0, 192, 1/14112000: Audio: mp3, 44100 Hz, 2 channels, s16,
 32 kb/s
 At least one output file must be specified
 }}}

 Maybe there are two separate issues? Because half of the problem seems to
 be fixed in git-master.

 Before r19300, probing is fine, remuxing and probing is fine.
 After r19300, probing is wrong, remuxing and probing is wrong.
 After r_half_fix (git-master), probing is wrong, remuxing and probing is
 fine.

 where r_half_fix > the_fork, otherwise the libav would behave as ffmpeg
 git-master, which it does not.

-- 
Ticket URL: <https://avcodec.org/trac/ffmpeg/ticket/289#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list