[mythtv-users] 720p HD content from WPVI in Philly periodic a/v sync issues

Byron Poland wpoland at gmail.com
Fri Dec 11 21:51:39 UTC 2009

On Fri, Dec 11, 2009 at 4:44 PM, Taylor Ralph <tralph11 at yahoo.com> wrote:

> --- On Fri, 12/11/09, Andrew Gallatin <gallatin at cs.duke.edu> wrote:
> > > I checked out a fresh 22-fixes and applied the patch.
> > > Unfortunately, it actually seemed to make things
> > worse.
> > > I've attached -v playback from a problematic file.
> > > This is using an Ion 330 using VDPAU, displaying to
> > > a 1080p panel.
> > >
> >
> > I have a very high-level understanding of what's going on
> > here, so I
> > apologize if my assumptions are incorrect, but here is my
> > theory: The
> > broadcaster is using the mpeg2 video repeat flags to save
> > bandwidth.
> > So he's broadcasting, on average, about 54fps and marking
> > about 10% of
> > them repeatable, which brings the frame rate up to
> > 60fps.  But
> > mythtv's mpeg2 decoder is not counting these repeats, and
> > the a/v sync
> > code thinks the frame rate is all messed up.
> > From what I can tell,
> > your patch adds a delay based on the repeat flags.
> > Rather than adding delays, wouldn't it be simpler
> > to use the actual decoded
> > frame count (or rate, or whatever the code uses)?
> The total video frame count is irrelevant to syncing the audio with video.
> The av-sync code has to compare the current audio timecode with the current
> video timecode of the frame being displayed. It then needs to make
> adjustments as necessary. If they are close enough then the added video
> frame delay is simply one frame interval (1/fps). If they are far enough
> apart then other measures are taken depending on if the audio is ahead or
> behind the video. This involves reducing or adding delay or for extreme
> cases skipping (dropping) frames or extending the frame interval.
> The patch I provided simply adds video delay when a frame is to be
> repeated. It's odd that it made your video worse. Something else is then
> obviously wrong.
> > Also, is the video portion of MythTV honoring the repeat flag?
> That's what my patch was intended to do. The NVP player code controls the
> delays between displayed frames and my patch simply added additional delay
> when a video frame was flagged for repeating.
> > I'm using VDPAU?
> I use VDPAU also and it should not matter.
> >
> > Again, sorry if I'm being dumb, and thanks for the
> > interest!!
> >
> A couple of questions for you:
> 1. What vsync method are you using: BusyWait, OpenGL, DRM?
> 2. Are you by any chance using "video as timebase"?
> I look forward to your samples.
> --
> Taylor

Here's a ~2:15 second sample from WPVI.  the last minute or so has the most
visible issues on my end (both my frontends - one a mac-mini intel graphics,
the other a dual core athlon with a 6000 series nvidia, so neither uses

when there is dialog the problem is most visible, however I can see some
accelerated frames during some of the lip shots (when you can't see lips
moving, to really notice if things are out of sync).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20091211/ff4e6cb0/attachment.htm>

More information about the mythtv-users mailing list