[FFmpeg-devel] Problem with av_find_stream_info and possible solution(s)

Luca Abeni lucabe72
Tue Jan 27 22:27:22 CET 2009

Hi Michael,

Michael Niedermayer wrote:
>> 1) modify libavformat/utils.c:tb_unreliable() to consider
>>     reliable the time base of codecs that will never set it
>>     to "reliable" values (such as rawvideo, mjpeg, h.263 - I
>>     think - and similar)
> we cant do that, this will break framerate detection for these codecs
> in some cases

I am obviously missing something here, sorry...
but isn't the timebase for h.263 always 30000/1001? And it is my 
impression that the timebase for raw video is set by the "read_header" 
method of the format, not in frame decoding. Am I wrong? I see the same 
for MJPEG...

>> 2) add a codec capability that says that the time base of
>>     this codec has to be considered reliable
> there is nothing codec specific.
> As you already noted yourself its a file vs. network issue
> I think the most obvious thing is the simple question if the user
> app wants the guessed frame rate or not.
> ffplay does not give a damn about it and ffmpeg in some cases
> should not need it either but for some cases like avi output
> it is essential to have some "reasonable minimal" timebase and not
> 1/90000
> Adding a flag to enable/disable it should be easy ...

Ok; I'll have a look at adding this flag.
Anyway, double thinking about it I suspect this flag depends on the 
input format... Is adding a flag in the input AVFormat reasonable?


More information about the ffmpeg-devel mailing list