[FFmpeg-devel] [PATCH] Fix timestamp calculation when demuxing MP3 frames in a .avi container.

Mike Scheutzow mjs973 at optonline.net
Fri Jul 13 14:49:24 CEST 2012

On 7/12/2012 10:33 PM, Michael Niedermayer wrote:
> On Thu, Jul 12, 2012 at 06:07:18PM -0400, Mike Scheutzow wrote:
>> On 7/11/2012 9:34 PM, Michael Niedermayer wrote:
>>>> +                        if (fps > 41) {
>>>> +                            // highest valid frame per sec is 48000/1152
>>>> +                            av_log(s, AV_LOG_WARNING, "st%d: MP3 frame rate is invalid (%d FPS)\n", st->id, fps);
>>>> +                        } else {
>>> did this if() make any difference in any of your tests ?
>>> iam asking because it looks kind of ugly not saying iam against it if
>>> it is needed
>> Results from web search indicate that some (broken) software tools
>> create avi files with the audio sample rate in stream's header
>> information, rather than the audio frame rate that we need. This is
>> a check for that problem. It will also help to notify the user why
>> the avi file is not playing back properly.
>> I did not bother to actually find such a sample file. The check
>> serves a worthwhile purpose.
> someone might have encoded 96khz in mp3 (claiming it to be 48khz)
> or someone wight wanted to speedup a files a little to 49khz, the check
> can cause problems for these cases.
> Its not a big thing as it breaks nothing that works currently but
> it doesnt feel right as it is somehow ...

If this hypothetical file ever shows up in a bug report, we can decide 
what to do with it.

As things are now, ffmpeg does not properly demux any 48 kHz mp3 in .avi 
and does not even print a warning.

I am spending no more time on this patch.

Mike Scheutzow

More information about the ffmpeg-devel mailing list