Opened 11 years ago

Closed 10 years ago

#2931 closed defect (fixed)

mp3: wrong duration

Reported by: ami_stuff Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mp3 duration
Cc: underground78@gmail.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

the file have a huge id3 tag, so maybe it's not excluded from bitrate calculation?

http://www.datafilehost.com/d/adf21372

C:\>ffmpeg -i 1.mp3 -f null -
ffmpeg version N-55957-g21dc3a3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep  2 2013 02:43:35 with gcc 4.5.0 (GCC) 20100414 (Fedora MinGW 4.5.
0-1.fc14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-pthreads --enable-memalign-hack --enable-runtime-cpudetect --
enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -lw
inmm -lpthread' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snapsh
ots/build/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/sna
pshots/build/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3 --
enable-nonfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-li
bvorbis --enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-li
bopencore-amrwb --enable-libmp3lame --enable-libfreetype --enable-libvpx --disab
le-decoder=libvpx
  libavutil      52. 43.100 / 52. 43.100
  libavcodec     55. 30.100 / 55. 30.100
  libavformat    55. 15.100 / 55. 15.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.102 /  3. 82.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
[mp3 @ 0x204fa20] Format mp3 detected only with low score of 24, misdetection po
ssible!
[mp3 @ 0x204fa20] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '1.mp3':
  Metadata:
    album           : 3
    title           : 1
    artist          : 2
    disc            : w
    track           : ww
  Duration: 00:04:22.14, start: 0.000000, bitrate: 320 kb/s
    Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 320 kb/s
    Stream #0:1: Video: mjpeg, yuvj420p(pc), 3264x1840, 90k tbr, 90k tbn, 90k tb
c
    Metadata:
      title           :
      comment         : Cover (front)
[null @ 0x2128020] Frame rate very high for a muxer not efficiently supporting i
t.
Please consider specifying a lower framerate, a different muxer or -vsync 2
Output #0, null, to 'pipe:':
  Metadata:
    album           : 3
    title           : 1
    artist          : 2
    disc            : w
    track           : ww
    encoder         : Lavf55.15.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuvj420p, 3264x1840, q=2-3
1, 200 kb/s, 90k tbn, 90k tbc
    Metadata:
      title           :
      comment         : Cover (front)
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (mjpeg -> rawvideo)
  Stream #0:0 -> #0:1 (mp3 -> pcm_s16le)
Press [q] to stop, [?] for help
[null @ 0x2128020] Encoder did not produce proper pts, making some up.
frame=    1 fps=0.9 q=0.0 Lsize=N/A time=00:03:43.24 bitrate=N/A
video:0kB audio:41859kB subtitle:0 global headers:0kB muxing overhead -100.00005
1%

Change History (4)

comment:1 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavformat
Keywords: mp3 duration added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

comment:2 by Underground78, 10 years ago

Cc: underground78@gmail.com added

I think this sample exhibits the same issue.

The real duration is 1:20 but the embedded cover art seems to confuse avformat.

> ffmpeg.exe -i Purity.mp3
ffmpeg version N-63013-g4cdea92 Copyright (c) 2000-2014 the FFmpeg developers
  built on May  6 2014 22:02:02 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 81.100 / 52. 81.100
  libavcodec     55. 60.103 / 55. 60.103
  libavformat    55. 37.102 / 55. 37.102
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  5.100 /  4.  5.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[mp3 @ 028f9600] Format mp3 detected only with low score of 24, misdetection possible!
[mp3 @ 028f9600] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'Purity.mp3':
  Metadata:
    title           : Purity
    artist          : Halcyonic Falcon X
    genre           : Video Game
    encoded_by      : LAME in FL Studio 9
    TBPM            : 120
    album           : Epic Battle Fantasy 3: Adventure Story
    date            : 2011
  Duration: 00:01:55.52, start: 0.000000, bitrate: 319 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
    Stream #0:1: Video: mjpeg, yuvj444p(pc), 1800x1800, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      title           : 
      comment         : Other

Ref: MPC-HC Ticket #4322.

comment:3 by Underground78, 10 years ago

For the record, here is a patch that seems to improve the estimation.

comment:4 by Carl Eugen Hoyos, 10 years ago

Resolution: fixed
Status: openclosed

Fixed by Hendrik Leppkes in e9c08e32

Note: See TracTickets for help on using tickets.