[fixed] Video and sound syncronisation (1 Viewer)

Smeulf

Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hi once again,

    @revision 3362 :

    I've notice the sond track of a video is not correctly synchronized with the video track : sound comes one maybe two hundred(s) milliseconds after the video.

    But maybe you already know that...

    Smeulf.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hello,

    I still have the problem and I still can't find from where it comes.

    Maybe I have something with the "Enhanced Video Rerendre" filter (graphs are the same). See this filter properties in joined pictures.

    Picture1 : From MP1 while reading a video

    Picture2 : From MP2 while reading the same video

    Picture3 : Video rerended with GraphEdt and the same filters than MP2 (or with a record of the graph from MP2...)


    The Average Framerate is always 0 with MP2... Is it the problem ?

    I have no problem to read all my videos in any software but MP2. I can't reproduce this issue on my laptop btw, a bit strange.

    Am I the only one having that problem ? Does anyone have any idea ?

    Cheers.
     

    Attachments

    • 1-MP1.jpg
      1-MP1.jpg
      52 KB
    • 2-MP2.jpg
      2-MP2.jpg
      48.7 KB
    • 3-Graphedt.jpg
      3-Graphedt.jpg
      48.9 KB

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    AW: Video and sound syncronisation

    interesting ....

    but the "Average Framerate" is not the reason. It's "0" in MP2 because of the feature limited custom EVRPresenter. The implementation of IQualProp is missing (returns only S_OK) :(

    in graphedit it works, because it uses the EVR without our custom presenter.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Video and sound syncronisation

    Well, it seems it's linked with the graphics drivers : when using a very old driver (2008) originaly designed for Vista 64, it works.

    The oldest WHQL drivers from NVidia website are dated from October 2009, and don't works. I can't determine the first unworking version of the driver to get the change log :(

    I'm still looknig for the reason of that bug, unfortunately without success for now. Ideas are welcome...

    Cheers.

    Smeulf.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Video and sound syncronisation

    Hi All,

    FYI, the problem is confirmed on Windows 7 32bits too, with a NVidia card, and FreakyJ could reproduce that on a machine (NVidia graphics card).

    I'm more and more convinced it comes from the custom presenter, but I can't prove it.

    Special :D to my friend "PRL" for spending two hours to install Windows 7 on a new hard drive and run the test (Yes, I admit, I delegated the job, but I didn't had the hardware :p)

    Cheers.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Once again, an answer to myself, but I won't let this thread in peace until I have found "why" I have a problem lol.

    A idea cames to me : should the frequency of the monitor can have an impact on it.

    The answer is ambiguous : it definitely has an impact on the flickering. By default, my monitor is at 60Hz. I increased it to 75Hz, started the client, and the flickering cames way more often than at 60Hz. About the sound, I would think there is a longer time between it and the video, but it's very hard to say as the flickering seems to compensate the problem sometime, like if it try to resynchronize the video.

    So could the EVR have a wrong value for the screen refresh rate ? Something like 50Hz ?

    Taken from the code, Helpers.cpp line 45/46 :

    Code:
    // TODO: Replace by CCD method to get refresh rate from driver
    MonitorRateHz = m_pD3DPresentEngine->RefreshRate();

    If someone could at least add a debug message into the log here for testing, could be nice.

    Cheers.

    [Edit]
    FYI : into MP1 custom presenter :

    Code:
    // get driver refresh rate
    void MPEVRCustomPresenter::GetRealRefreshRate()
    {
      // Win7
      if (m_bIsWin7 && m_pW7GetRefreshRate)
      {
        m_dD3DRefreshRate = m_pW7GetRefreshRate();
    
        if (m_dD3DRefreshRate == -1)
        {
          m_dD3DRefreshRate = (double)m_displayMode.RefreshRate;
        }
      }

    m_pW7GetRefreshRate() method comes from Win7RefreshRateHelper

    Seems there was in a time something done for Windows 7.
    [/Edit]
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    AW: Video and sound syncronisation

    I did a quick test and have put in a log line. The code part you mentioned was not executed.

    Then I checked the references to this method (GetMaxRate), it's only queried in "EVRCustomPresenter::GetFastestRate" which implements
    // IMFRateSupport Interface IMFRateSupport Interface (Windows)
    // Reports the range of playback rates that the presenter supports.

    This interface is nowhere referenced in code now (neither cpp nor c#).

    This means this is (most probably) not the cause for the frame flashes.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    AW: Video and sound syncronisation

    while looking in the EVR code, I thought about 2 things:

    1) MP2 evr does nearly nothing inside

    // Schedules a new sample for presentation.
    HRESULT Scheduler::confused:cheduleSample(IMFSample *pSample, BOOL bPresentNow)

    While MP1 does a LOT of calculations, corrections a.s.o. I think this could be the most important part to investigate.

    2) I found there exists a base class that could be used CBaseVideoRenderer Class (Windows) for our presenter. This way we already could use many of the built-in features, statistics... (see only IQualProp Interface IQualProp Interface (Windows)) should be already implemented (not in out code, in this base class)
     

    Users who are viewing this thread

    Top Bottom