Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

timestretch: predictive frame skipping (was Re: DVD playback issues, patch)

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


jppoet at gmail

Nov 24, 2009, 10:29 PM

Post #1 of 4 (922 views)
Permalink
timestretch: predictive frame skipping (was Re: DVD playback issues, patch)

On Tue, Nov 24, 2009 at 9:35 PM, John P Poet <jppoet [at] gmail> wrote:
> On Tue, Nov 24, 2009 at 7:57 PM, David Engel <david [at] istwok> wrote:
>> On Tue, Nov 24, 2009 at 06:36:21PM -0700, John P Poet wrote:
>>> ...and that happens even when doing this with "simple" 720p mpeg2.  My
>>> system should be able to decode 100 frames per second pretty easily.
>>>
>>> So, the video being +3 frames behind the audio does not make sense.
>>> There is no excuse for my system no being able to "keep up", unless it
>>> is not being allowed to.  I assume the problem is that there can only
>>> be one-frame-per-refresh, and the refresh is 60Hz.  I don't know what
>>> the solution is, but I would love it if Davin or Mark could come up
>>> with it ;-)
>>
>> I haven't followed any of this thread until this message.  Please
>> pardon the interruption if I'm way off base.
>>
>> John, I believe you've touched on the reason I have my HD-PVR attached
>> STBs set to 1080i instead of 720p -- interlaced content stretches much
>> more smoothly than progressive.  With the fallback deinerlacing
>> options limited to 1x, you never have more deinterlaced frames than
>> refresh intervals (60, in my case) so you never have to drop any
>> frames.  With progressive content, you always have more frames than
>> refresh intervals so you always have to drop frames and the result is
>> jerky.
>>
>> I have an idea that might remedy this.  We detect when we have more
>> video frames than refresh intervals similarly to how we detect when to
>> use the fallback deinterlacers.  When we detect this condition, what
>> if we discard every other video frame?  In a sense, we fallback to a
>> "0.5x deinterlacer."  Since we discard frames at a regular rate
>> instead of somewhat randomly as currently done, the result might be as
>> smooth current the stretching of interlaced content.
>
> This is getting off topic for the original purpose of this thread, but...
>
> That seems reasonable to me.  Although, you would only want to discard
> every other frame if playback is at 2.0x.  For 1.5x, it would be every
> 3rd frame, for 1.25x it would be every 5th frame, and for 1.3x it
> would be every 4.333333 frames, right?  Those fractions would still
> cause issues, but would make the avsync easier.
>
> frame index to discard = (refresh / ((speed * refresh) - refresh)) + 1

The obvious solution to the fractions such as 4.33333 for 1.3x, is to
skip every 4th frame *and again* every 12th frame.

I may have to tinker with this on Thursday....

John
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


david at istwok

Nov 25, 2009, 7:48 AM

Post #2 of 4 (871 views)
Permalink
Re: timestretch: predictive frame skipping (was Re: DVD playback issues, patch) [In reply to]

Since you opened up a new thread, I'll respond here.

> On Tue, Nov 24, 2009 at 9:35 PM, John P Poet <jppoet [at] gmail> wrote:
> > On Tue, Nov 24, 2009 at 7:57 PM, David Engel <david [at] istwok> wrote:
> >> I have an idea that might remedy this. ?We detect when we have more
> >> video frames than refresh intervals similarly to how we detect when to
> >> use the fallback deinterlacers. ?When we detect this condition, what
> >> if we discard every other video frame? ?In a sense, we fallback to a
> >> "0.5x deinterlacer." ?Since we discard frames at a regular rate
> >> instead of somewhat randomly as currently done, the result might be as
> >> smooth current the stretching of interlaced content.
> >
> > This is getting off topic for the original purpose of this thread, but...
> >
> > That seems reasonable to me. ?Although, you would only want to discard
> > every other frame if playback is at 2.0x. ?For 1.5x, it would be every
> > 3rd frame, for 1.25x it would be every 5th frame, and for 1.3x it
> > would be every 4.333333 frames, right? ?Those fractions would still
> > cause issues, but would make the avsync easier.

Actually, I was suggesting to always drop every other frame. The
result should be similar to what happens when the fallback 1x
deinterlacer kicks in on interlaced content. That is you wind up with
30 evenly spaced frames and the A/V sync code extends some frames by
an extra refresh interval as needed. No, it's not absolutely silky
smooth, nor determinsitic, but is more than acceptable to me. If you
start dropping every nth frame, where n > 2, then you've got to deal
with unevenly spaced frames. I suspect the A/V sync code would then
have to get much more complicated to handle that or the results would
be noticably jerkier.

David
--
David Engel
david [at] istwok
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


jppoet at gmail

Nov 25, 2009, 9:00 AM

Post #3 of 4 (862 views)
Permalink
Re: timestretch: predictive frame skipping (was Re: DVD playback issues, patch) [In reply to]

On Wed, Nov 25, 2009 at 8:48 AM, David Engel <david [at] istwok> wrote:
> Since you opened up a new thread, I'll respond here.
>
>> On Tue, Nov 24, 2009 at 9:35 PM, John P Poet <jppoet [at] gmail> wrote:
>> > On Tue, Nov 24, 2009 at 7:57 PM, David Engel <david [at] istwok> wrote:
>> >> I have an idea that might remedy this. ?We detect when we have more
>> >> video frames than refresh intervals similarly to how we detect when to
>> >> use the fallback deinterlacers. ?When we detect this condition, what
>> >> if we discard every other video frame? ?In a sense, we fallback to a
>> >> "0.5x deinterlacer." ?Since we discard frames at a regular rate
>> >> instead of somewhat randomly as currently done, the result might be as
>> >> smooth current the stretching of interlaced content.
>> >
>> > This is getting off topic for the original purpose of this thread, but...
>> >
>> > That seems reasonable to me. ?Although, you would only want to discard
>> > every other frame if playback is at 2.0x. ?For 1.5x, it would be every
>> > 3rd frame, for 1.25x it would be every 5th frame, and for 1.3x it
>> > would be every 4.333333 frames, right? ?Those fractions would still
>> > cause issues, but would make the avsync easier.
>
> Actually, I was suggesting to always drop every other frame.  The
> result should be similar to what happens when the fallback 1x
> deinterlacer kicks in on interlaced content.  That is you wind up with
> 30 evenly spaced frames and the A/V sync code extends some frames by
> an extra refresh interval as needed.  No, it's not absolutely silky
> smooth, nor determinsitic, but is more than acceptable to me.  If you
> start dropping every nth frame, where n > 2, then you've got to deal
> with unevenly spaced frames.  I suspect the A/V sync code would then
> have to get much more complicated to handle that or the results would
> be noticably jerkier.

The (1x) deinterlacers don't drop half the fields, do they? Obviously
the "One field" deinterlacer does, but not the rest, right? I thought
the yadif 2x actually worked at a double frame rate, and yadif 1x
worked at a "normal" frame rate.

With a playback of 1.2x. Myth would end up "extending" a lot of frames.

I don't know what the best solution is. I will probably tinker with
this tomorrow and see.

John
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


david at istwok

Nov 25, 2009, 1:37 PM

Post #4 of 4 (868 views)
Permalink
Re: timestretch: predictive frame skipping (was Re: DVD playback issues, patch) [In reply to]

On Wed, Nov 25, 2009 at 10:00:42AM -0700, John P Poet wrote:
> The (1x) deinterlacers don't drop half the fields, do they? Obviously
> the "One field" deinterlacer does, but not the rest, right? I thought
> the yadif 2x actually worked at a double frame rate, and yadif 1x
> worked at a "normal" frame rate.

My understanding of the regular 1x deinterlacers is that you get one
progressive frame out for every two interlaced fields you put in.
It's called 1x because the frame rate stays the same -- the frames
just get converted from interlaced to progressive.

With the 2x deinterlacers, you get 1 progressive frame out for every
interlaced field you put it. It's called 2x because it effectively
doubles the frame rate -- 30 interlaced frames become 60 progressive
frames.

I could be wrong, but I thought it was because of the rate doubling
deinterlacers and timestretching that Daniel(?) added the fallback
deinterlacer support. I believe the intent was to make sure the
effective frame rate was always less than the display's refresh rate.

> With a playback of 1.2x. Myth would end up "extending" a lot of frames.

Yes. So? It seems to work acceptably well IME with interlaced
content. I'd just like to see it work as well with progressive
content.

> I don't know what the best solution is. I will probably tinker with
> this tomorrow and see.

I don't know the best solution either. I'm just throwing out an idea
in case someone is more know knowledgeable and motivated enough to try
it.

David
--
David Engel
david [at] istwok
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.