[Ffmpeg-devel] Re: [RFC] Improvement for the odd timestamp generation when parser is in use.

Måns Rullgård mans
Mon Mar 19 20:08:43 CET 2007


elupus <elupus at ecce.se> writes:

> Michael Niedermayer <michaelni <at> gmx.at> writes:
>
>> 
>> Hi
>> 
>> > 
>> > The best way i can see to handle this is to make parser always
>> > output the timestamp of the packet the current frame started
>> > in. (currently it only does this if the demux packet that
>> > resulted in previous frame had a timestamp and it's the first
>> > time we use data from it ). This would result in multiple packets
>> > with the same timestamps, wich might not be the best, but it
>> > would atleast be consistant.
>> 
>> the parser behavior is based on exact handling of mpeg-ps/ts timestamps
>> what you suggest would break that to support invalid ac3 streams in avi
>> slightly better, sorry but this is not a good tradeoff, avi does not
>> allow to chop up frames arbitrarily ...
>
> I can accept that avi isn't supposed to do this, but isn't the whole
> point of parser to handle arbitrarily chopped packets? And in what
> way is only providing a timestamp for a frame if the packet that
> completed last frame had a timestamp a good idea? The point where
> the new frame starts in that packet doesn't need to be anywhere near
> the beginning of that packet, and thus the timestamp is probably
> very much off, or is that not an issue for mpeg-ps/ts?

In MPEG PS/TS a packet timestamp is defined to apply to the first
frame to start in the packet.  If a packet contains the start of more
than one frame, only the first of these can have a timestamp.  The
others will have to be extrapolated.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list