[MPlayer-dev-eng] Re: [PATCH] dvr-ms fixes for pts, key frame detection and seeking

Uoti Urpala uoti.urpala at pp1.inet.fi
Fri Feb 16 20:11:04 CET 2007

On Fri, 2007-02-16 at 12:48 -0600, John Donaghy wrote:
> >
> > Yes sh_video->fps is set based on the distance between frames. However
> > that does not mean it works "on the bases you can't get fps from the
> > container" - if the container gives constant-distance timestamps that
> > will produce the same fps. The value of sh_video->fps doesn't matter all
> > that much anyway. Video timing is done based on the timestamps.
> You're right, I didn't explain it very well but my issue comes down to
> this...
> I can set a correct fps value at the start and then I could start producing
> pts values that were evenly spaced (0.033, 0.066 etc) until I read a real
> pts value form the container, which will typically be a much larger number.
> I cant then pass this on because the fps will get messed up and mplayer will
> start complaining. But if I dont use the pts values in the container for
> both audio and video then AV dosnt sync.

As I said sh_video->fps doesn't matter all that much, so "it getting
messed up" should not be a big problem. If there are real problems with
playback then it sounds like either the fps value you're using for
creating the pts or the pts value read later is wrong, so that
number_of_frames * fps_based_frame_distance doesn't match the new pts.
Or do you mean you're using the same fps value in you code and it
getting changed (at pts discontinuities?) by other code breaks your
code? If so then just keep an internal copy.

> I'm thinking that if
> video.cdoesn't adjust the fps when it gets the new much larger pts
> from the
> container then it might be possible to play the files.

No, again sh_video->fps isn't all that important and changing how it is
set is unlikely to have much effect.

> Most dvr-ms files have non-cronological pts values most of the time -
> correct-pts works to some extent with these but so far I havent been able to
> get seeking working at all with it. Also, the dvr-ms files that have

Exactly how does seeking "not work at all" with -correct-pts?

> intermittent i-frame pts values only wont play at all with correct-pts.

Probably because you're not setting any timestamps for those frames in
the demuxer. Currently the code doesn't try to guess missing timestamps
for video frames.

More information about the MPlayer-dev-eng mailing list