[MPlayer-dev-eng] [PATCH] further dvr-ms playback improvements

Nico Sabbi nicola_sabbi at fastwebnet.it
Thu Sep 28 23:36:30 CEST 2006


John Donaghy wrote:

>
>>
>> in any case remember that the reordering of frames (in decoding order)
>> will always lead to slightly wrong average results (because bframes n
>> and n+1
>> with timestamps tn and tn+1 will have a timer < tn-1 corresponding to 
>> the
>> preceding [ip]-frame), so you should eventually update time only when
>> the timestamp of the current frame is > time (assuming that timestamps
>> in asf don't reset)
>
>
> I dont really understand this cause I still dont know much about
> video. Any chance you could you explain it more or send me a link to
> something that explains it?
>
> Thanks
>
> JOhn


easy: in mpeg2 (but more generally in almost all video formats)
video frames are divided in I, B and P types.
I frames are indipendent, while P depend on I and B depend on I and P.
In order to be decoded correctly I and P frames surrounding enclosed B 
frames
must be stored in decoding order, that is different from display order:

display: I1 B2 B3 P4 B5 B6 P7
decode: I1 P4 B2 B3 P7 B5 B6

where n (in this case 1..4) indicates the display order.
In your case you can consider n=pts (your variable time).
When you see  pts(n-1) > pts(n)  (e.g. 4 > 2) you have actually found a 
B frame,
so you have to increase the frame count but you have to wait until P7 to
calculate the average framerate on the interval I1 to P4



More information about the MPlayer-dev-eng mailing list