[MPlayer-dev-eng] Proper PTS
Mike Melanson
melanson at pcisys.net
Sat Mar 16 16:49:42 CET 2002
Hi team,
Okay, so I'm trying to incorporate proper PTS support in my
demuxers, starting with the FILM demuxer. A film file has a base frequency
clock, such as 30Hz or 600Hz. Each video frame is stamped with a time
based on that clock, e.g.: 20, 40, 60, 80, all in the 600Hz case. Here's
what I'm doing:
1) set up the fps and frametime variables:
sh_video->fps = stream_read_dword(demuxer->stream);
sh_video->frametime = 1.0 / sh_video->fps;
2) when I load a video frame into a demuxer packet, each packet has a PTS
calculated by:
dp->pts = (film_chunk.syncinfo1 & 0x7FFFFFFF) / sh_video->fps;
3) when I print the dp->pts variable, I get sane values:
0.133333: 0.1 A-V: -0.077 ct: -0.000 4/ 4 0% 0% 0.0% 3 0 0%
0.166667: 0.1 A-V: -0.105 ct: -0.001 5/ 5 0% 0% 0.0% 4 0 0%
0.200000: 0.2 A-V: -0.136 ct: -0.001 6/ 6 0% 0% 0.0% 5 0 0%
0.233333: 0.2 A-V: -0.167 ct: -0.001 7/ 7 0% 0% 0.0% 6 0 0%
0.266667: 0.2 A-V: -0.197 ct: -0.001 8/ 8 0% 0% 0.0% 7 0 0%
0.300000: 0.3 A-V: -0.228 ct: -0.001 9/ 9 0% 0% 0.0% 8 0 0%
0.333333: 0.3 A-V: -0.259 ct: -0.002 10/ 10 0% 0% 0.0% 9 0 0%
and so on. And this is what MPlayer reports for time info:
[V] filefmt:14 fourcc:0x64697663 size:296x136 fps:600.00 ftime:=0.0017
So all the data looks right to me. However, MPlayer is still trying to
play the video at 600 fps. What am I missing here?
Thanks...
--
-Mike Melanson
More information about the MPlayer-dev-eng
mailing list