[vlc] Re: Problem playing MPEG-PS files with mpeg4video

Nico Sabbi nsabbi at tiscali.it
Tue Jan 25 14:46:22 CET 2005


Gildas Bazin wrote:

>Ok, the main problem here is that we don't have access to the frame rate 
>information for this kind of streams so we can't really interpolate the 
>timestamps, thus we rely on each frame having at least a DTS.
>Do you know if there's a way to find out the frame rate info ?
>
>--
>Gildas
>
>  
>

this is what I implemented for mplayer:

take 3 video frames and store
- from the vol header the time_resolution
- from the vop headers the 3 time_increments

calculate the minimun difference between the 3 time_increments, say diff
fps = timeinc_resolution / diff

This method works also when there are b-frames because they have to be 
in the right order, e.g.

I1 P2 P3   diff = ti(P2) - ti(I1) or ti(P3) - ti(P2)
I1 P3 B2   diff  = ti(B2) - ti(I1)
I3 B1 B2  diff  = ti(I3) - ti(B2) or diff  = ti(B2) - ti(B1)

and so on.

Obviously it's necessary to determine when time_increments wrap around, so
diff(Fn+1, Fn) < 0 && diff(Fn, Fn+1) > diff((Fn+1)+timeinc_resolution, Fn).

If my reasoning is not flawed this method permits to determine the 
initial fps,
which can be repeated at every frame to determine if/when fps varies.


    Nico

-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/support/lists.html



More information about the vlc mailing list