[Libav-user] How to perform drift compensation in MPEG-2 recorder

Mike Versteeg mike at mikeversteeg.com
Wed Dec 19 16:46:15 CET 2012

>> I can't as this would introduce double/missing frames, which is
>> unacceptable for my app.
> Why? The nominal frame rate of a video stream is only a guideline; the
> actual PTS can handle reasonable jitter.

My initial thought was just that: adjust the PTS to effectively
slightly change the frame rate in the file, matching my video clock to
the audio clock. But I have since learned (offline) that this is not
possible as indeed the video PTS, at least for MPEG-2, increments as
integer (0, 1, 2, ...). There's no fiddling with it.  So short of
doubling/dropping the occasional video frame, I can't see any other
way to "sync" my video to audio.


More information about the Libav-user mailing list