[mythtv-users] deinterlacing and non-smooth playback at 1080i

Mark Kendall mark.kendall at gmail.com
Tue May 22 09:40:53 UTC 2007


On 5/22/07, Seth Daniel <mythtv.org at sethdaniel.org> wrote:
> > With this in place I get perfectly smooth/synced playback at 1080i
> > most of the time - still trying to figure out if I can get 100%!
> >
> > I'll explain it in more detail when I've had some sleep.

OK - clear head now.

The problem with mythtv's playback is that is not consistent with the
timing of how it presents frames/fields to an interlaced display.

Assuming a 60Hz (ntsc) display, it will be expecting the start of a
new frame every other vertical sync, or more strictly, it expects
fields in the order:-

Sync#  Frame  Field
0         1          top
1         1          bottom
2         2          top
3         2          bottom

What we actually do in software is present a new frame (both fields)
at syncs 0, 2, 4 etc and the video card takes the the right field at
the right time and sends it to the display in an interlaced format.

If everything worked as it should, the display would then pick up this
field order and deinterlace it correctly.

The problem comes when there is a minor blip in playback, or playback
is just settling down after its been started or paused, and opengl
vsync has to 'resync'. Rather than waiting to start a new frame on an
even numbered sync (using the above timings) it gets the next
available one - which might be odd numbered.

Once this happens, the fields are now being presented to the display
out of order and deinterlacing fails badly.

I suspect some tvs' are smarter than others about detecting when the
fields are obviously out of sync and adjusting.

The patch just ensures that the opengl vsync method always starts a
new frame on an even sync count - seems to work pretty well about 70%
of the time. It needs more work though and may not work 100% of the
time i.e. if the display syncs to frames starting on an odd count.

> It didn't apply cleanly to HEAD svn.  So, I checked out mythtv-vid of
> mythtv, applied the patch, and built it.  After some problems with the DB
> schema I got it to run.  The sync problem still exists.  I tried with
> Bob and w/o any deinterlacing.  FWIW, with Bob I received:

I've just looked at your original frontend log again. Is your display
widescreen? Is the video stream being letterboxed at all? The log
suggests that your display is 4:3 and is letterboxing the 16:9
videostream to fit it onscreen. If this is what is happening, there
must be some vertical scaling. This may throw out the tv's
deinterlacer as it will not be getting the even/odd scan lines in the
format it is expecting. Try setting the aspect ratio to fill or 16:9
zoom - this should give you 1:1 vertical mapping without scaling.

Can you post a full log with deinterlacing off, aspect ration set to
Fill, opengl vsync on etc?

I'll post a revised patch against svn head later.

Regards

Mark


More information about the mythtv-users mailing list