Stutter after refresh rate change (3 Viewers)

Scythe42

Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    alot of : 31-10-2009 15:59:21.809 [fc0]Dropping frame, behind 4 ms, last sleep time 8 ms.
    The late frame dropping is causing the stutter. If the frames are late they need to be dropped or audio and video will go out of sync. So far so good. That's how it should be.

    BUT the question is why are the frames late. It looks like it's related to the TSReader exclusively.

    Can you reproduce the same with something else than TS files?

    All this seems to be related to an oddity I came across when dealing with interlaced material. On DVDs for example we have 25fps interlaced, so it should be 50Hz. 25Hz doesn't work and creates big stuttering even though there are only 25 progressive frames after deinterlacing. This puzzled me from the beginning as it should work in theory.

    The presenter get's the information that the file is progressive (because of deinterlacing happening) but the delta between each time stamps is still 20ms (50fps) instead of 40ms (25fps). This is like having 50 progressive frames which is obviously too fast for your machine over a network connection. Not a problem though as the presenter should only get 25 frames in the first place.

    From the EVR log I rarely see a sleeping time between the worker threads greater than 20ms. This indicated that frames having the 20ms timestamp delta as well - like on DVD whereas a new progressive frame should arrive every 40ms and not every 20ms.

    Because I stumbled across a similar problems with DVDs, I start working there. If I get them running at 25Hz without stuttering I have a solution. All in all it's probably related to the TSReader and was not identified earlier because frames where not properly dropped.

    I'll post and update when I find something. Additional logs from other setups are welcome...
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    I only seem to have stuttering issues when using live TV.. havent noticed anything on recordings yet.. Ill try this next time it happens..

    I just had a weird situation happening where I was watching some stuttering TV.
    I decided to try and hibernate the HTPC .. I then resumed it and TV was ok again.

    Weird ??
    logs attached. I resumed at time 19.37 approx,

    Also I tried to stop and restart live TV when the stutter occurs. This doesnt fix it.

    /gibman
     

    johan_80

    Portal Pro
    April 27, 2009
    65
    0
    I dont know if it's the same issue Im seeing.
    Im running win7 64 ult.
    ATI CCC 9.10 drivers on a HD4770 card-

    I experience a lot of judder on TV (pal 25 fps) 50hz.

    This occasionally happens when I:

    1) Watch some movie (23.976/24 fps) which changes RR to 24hz (TV supports it, using dc.exe)
    2) Stopping movie, and then starting TV (25 fps), which changes RR to 50hz.

    Now all TV channels stutter like mad.
    Playback of 24 fps material still looks nice.

    To rectify this I can:
    1) restart MP
    2) minimize MP then click on desktop or some other app, then maximize MP again.

    At first I thought it was the avivo deinterlacing settings resetting itself back to defaults.
    But it wasnt

    Might this is a problem since the recent fix for 24hz synch playback ?

    /gibman

    I've seen it since I started using MP in june. Wrote about it in several threads before I think.
    So this problem was here before the 24Hz sync fix.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    BUT the question is why are the frames late. It looks like it's related to the TSReader exclusively.

    Can you reproduce the same with something else than TS files?

    All this seems to be related to an oddity I came across when dealing with interlaced material. On DVDs for example we have 25fps interlaced, so it should be 50Hz. 25Hz doesn't work and creates big stuttering even though there are only 25 progressive frames after deinterlacing. This puzzled me from the beginning as it should work in theory.

    The presenter get's the information that the file is progressive (because of deinterlacing happening) but the delta between each time stamps is still 20ms (50fps) instead of 40ms (25fps). This is like having 50 progressive frames which is obviously too fast for your machine over a network connection. Not a problem though as the presenter should only get 25 frames in the first place.

    With PAL content the mixer should provide 50fps content (deinterlaced from 25 interlaced stream) when working with the DXVA (also some ffdshow deinterlace is capable restoring the original 50 fps).

    From the EVR log I rarely see a sleeping time between the worker threads greater than 20ms. This indicated that frames having the 20ms timestamp delta as well - like on DVD whereas a new progressive frame should arrive every 40ms and not every 20ms.

    Sounds like mixer is providing correct fps (20ms --> 50 fps). Sounds like TsReader would be providing the average time per frame incrorectly, so it could be the starting point when debugging those. It might be even logged in the TsReader.log (if I remember correctly).
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    It might be even logged in the TsReader.log (if I remember correctly).

    No, it wasnt'... so anyone who is able to reproduce the issue, please open GraphEdit and connect to the running MP / TsReader graph and check what AvgTimePerFrame contains in two cases

    1) when all is ok
    2) when the stuttering occurs
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    With PAL content the mixer should provide 50fps content (deinterlaced from 25 interlaced stream) when working with the DXVA (also some ffdshow deinterlace is capable restoring the original 50 fps).
    Probably I am misunderstanding something fundamental here but I still don't see how 25 interlaced frames can result in 50fps unless each half of the interlaced frames is displayed two times (e.g. field 1+2, 2+3, 3+4 instead of 1+2, 3+4, 5+6). Or the mixer sends the same frame two times, which also doesn't make any sense as the display time just needs to be doubled to achieve the same effect instead of scheduling the same frame twice.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    With PAL content the mixer should provide 50fps content (deinterlaced from 25 interlaced stream) when working with the DXVA (also some ffdshow deinterlace is capable restoring the original 50 fps).
    Probably I am misunderstanding something fundamental here but I still don't see how 25 interlaced frames can result in 50fps unless each half of the interlaced frames is displayed two times (e.g. field 1+2, 2+3, 3+4 instead of 1+2, 3+4, 5+6). Or the mixer sends the same frame two times, which also doesn't make any sense as the display time just needs to be doubled to achieve the same effect instead of scheduling the same frame twice.

    In PAL interlaced content the actual frame rate is 50 fps, and if you use BOB or WEAVE deinterlace methods you will end up in 25 fps second as there will be lot of data that is just discarded. If you are using vector adaptative etc. (mostly HW based) deinterlace methods the result will be 50 fps (where every frame is unique, no duplicate frames). This is because the single frame is actually containing only half of the vertical lines and after deintrlacing the half of the data is "generated" based on the analysis of few frames and their motion vectors.

    Interlace - Wikipedia, the free encyclopedia

    Probably I am misunderstanding something fundamental here but I still don't see how 25 interlaced frame

    I'm pretty sure that such case doesn't happen 25fps interlaced content. It should be always 50 fps interlaced content.
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Thanks for explaining. I wasn't aware of the more advanced deinterlacing that analyzes several frames. I basically only thought in inverse telecine terms as 100% of the material I use MP with was shot at film frame rates.

    Because the "minimize trick" seems to work for most people it's probably related that MP even though it's on top might not be in focus when switching to TV in some setups. Beside that I'm running out of ideas as I can't reproduce this behavior reliable at my end.

    Another idea would be that some oder codec is loaded (but not connected) in the DirectShow graph and interferes. And it stops interfering once MP is minimized/resized. So some screenshots of the Direct Show graphs would be appreciated when the problem occurs and once it's gone after the resizing trick.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Thanks for explaining. I wasn't aware of the more advanced deinterlacing that analyzes several frames. I basically only thought in inverse telecine terms as 100% of the material I use MP with was shot at film frame rates.

    Because the "minimize trick" seems to work for most people it's probably related that MP even though it's on top might not be in focus when switching to TV in some setups. Beside that I'm running out of ideas as I can't reproduce this behavior reliable at my end.

    I'm just wondering... could the stuttering appear in a case when HW accelerated deinterlace fails and causes 25 fps be sent from the mixer where as our renderer is expecting to receive frames on the 50 fps rate (when TsReader / source filter tells 20 ms frame intervals? Or does the evr log state that the frames would be received at the 50 fps rate in the error cases? Sorry, I still have to find time to figure out how teh current EVR code behaves :)

    Another idea would be that some oder codec is loaded (but not connected) in the DirectShow graph and interferes. And it stops interfering once MP is minimized/resized. So some screenshots of the Direct Show graphs would be appreciated when the problem occurs and once it's gone after the resizing trick.


    Plausible, but not very likely. It is pretty rare that unconnected codecs are affecting the playback.
     

    MPUserFromGER

    MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    I am seeing this issue as well.
    For me it occurs only during LiveTV and also sporadic.
    Mostly it occurs after a TV channel has been watched for some time.
    Stopping LiveTV is no solution but after standby, the issue is gone but comes back again after some watching.
    This issue is very annying because it causes audio dopouts.

    Please find attached my logs.
     

    Users who are viewing this thread

    Top Bottom