From: James Courtier-D. <Ja...@su...> - 2002-04-08 15:33:34
|
Yoav Etsion wrote: >Hi, > >I am doing a research on the suitability of the Linux scheduler for >multimedia, and am using xine as a benchmark. For that reason I am hacking >the player to get accurate performance measurements. I am using the 0.5.1 >version, even though it's old (changing a version in the middle of the >research means a sh*tload of work re-running measurements). > >The one thing I don't understand is what are the vpts, and what is the >differnece between that and the regular pts. I read the hacker's guide, >but could find a good answer. > >Any answer explaining that, and the vpts calculation in vo_frame_draw >(video_out.c) vs. the pts calculation in video_out_loop (video_out.c >too) will be most welcome. > >Please cc me as I am not on the list. > >Thanks, > >Yoav Etsion > PTS values are values from the stream which give xine some idea as to when the frame or audio should be displayed to played. The PTS values alone would be fine, but for the fact that there might be discontinuities in the media stream. So for one frame the PTS value could be 10000, then the next frame should be 13600 (for PAL). But in a discontinuity, one frame might have PTS value of 10000, but then a discontinity occurs, and the next PTS value is 200000, we don't want to wait minutes between these two frames, we want them just to display one after the other, so the concept of Virtual PTS (VPTS) is used. The idea behind the VPTS is that it uses the PTS values in the stream a a guide, but at a discontinuity, it corrects for the wrong PTS value, and therefore delivers VPTS values of 10000, then 13600, which the video_out_loop can display correctly. Summary: - VPTS are PTS values with all the discontinuities removed. VPTS will always increase by the frame duration. The actual duration given might vary a bit, when the metronom is doing corrections for lost frames etc. As a comment regarding the Linux scheduler. It is faily bad for any realtime needs. and playing multimedia is a realtime need. It is vital that the multimedia flips the frame onto the screen at exactly the right time, or videos with a lot of "panning" in them, tend to jerk slightly. I very good example of very smooth video is a linux app call movietime. See http://xine.sf.net of http://dvd.sf.net for links to it. It requires the multimedia player to run as root, and is scheduled as linux Fifo, with the hardware RTC controlling the scheduling. It is very smooth. Only "root" user allows being scheduled at priority "fifo". Cheers James |