[FFmpeg-trac] #3327(avformat:new): libavformat fails to detect some mp3 files reliably

FFmpeg trac at avcodec.org
Mon Jan 27 11:06:27 CET 2014

#3327: libavformat fails to detect some mp3 files reliably
             Reporter:  gjdfgh      |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:  mp3         |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |

Comment (by gjdfgh):

 >Are you sure that if a format is currently only detected by extension

 I don't know it's what I would expect.

 avformat.h says: `#define AVPROBE_SCORE_EXTENSION  50 ///< score for file

 So yes, I would expect that if the extension matches, that value is
 returned. Maybe I'm wrong; it does look like the score is a little bit too
 high for that, as it's much higher than the "safe" score
 AVPROBE_SCORE_RETRY+1, which is 26.

 As for whether to return 25 or 26 on a "good guess", I think it would be
 good to return 26 is there are signs that this might be a good mp3 file,
 probing uses a good amount of data (e.g. 1 MB), and there are no other
 formats with better score.

 Anyway, currently mp3 probing is pretty bad. For example, libavformat
 recognizes a random ELF binary as mp3 with probe score 50 after only 64KB
 of data! And that while legitimate mp3s are not recognized reliably, even
 when passing the whole file to the probe function! Using the file
 extension instead of the sophisticated probing in mp3_read_probe would be
 more reliable.


 Didn't perform better on this sample, AFAIR.

Ticket URL: <https://trac.ffmpeg.org/ticket/3327#comment:5>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list