[FFmpeg-devel] h264 ts without timing and analyze duration

Matthew Eaton ffm
Wed Dec 10 23:04:29 CET 2008


On Wed, Dec 10, 2008 at 4:03 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Dec 10, 2008 at 01:49:57PM -0500, Matthew Eaton wrote:
>> When processing an h264 (ts) stream without timing info (sps
>> timing_info_present_flag = 0), analyzeduration/max_analyze_duration is
>> not used in av_find_stream_info().
>
> There is no h264 in mpeg-ts/ps without some kind of timing, we do lack
> a parser extracting it, a fix for this is welcome

Are you referring to the TS PCR? Reading through the h264 spec, I
don't see any other references to timing other than in the VUI.

>
>>
>> As a result, the analyze loop aborts when MAX_READ_SIZE is reached.
>> This takes much longer than the maximum analyze duration (about 20
>> seconds on a 2 megabit stream).
>>
>> Attached is a patch that uses dts to estimate the elapsed duration
>> when the packet duration is unknown. It's less than optimal, but fps
>> has not been calculated/estimated at that point in the function.
>
> this could cause problems in respect to timestamp discontinuities,
> that is a discontinuity could cause an early exit of this loop

Yes, I can see that being a potential case.

Thanks,
Matt




More information about the ffmpeg-devel mailing list