[fixed] Video and sound syncronisation (1 Viewer)

Smeulf

Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    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
    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

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,487
    7,018
    Germany Germany
    Country flag
    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
    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
    France France

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    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
    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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,487
    7,018
    Germany Germany
    Country flag
    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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,487
    7,018
    Germany Germany
    Country flag
    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 (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    M No sound on videos General 8
    N [Rejected] Include BBC Sounds (radio catch up) in the Online Videos plugin Feature Requests 4
    J amazon plays sound but no video OnlineVideos for MediaPortal 2 0
    N [not reproducible] Online videos not working at all Submit: Bug Reports 1
    R Bug: Video Folders disappear General Support 11
    Stephen O'Kane [SOLVED] TV Stream stuttering - both Video and Audio Watch / Listen Media 14
    B some music videos stutter Watch / Listen Media 0
    I 1.25.0 Videos in HEVC UHD 2160p don't play good watch/edit Videos 8
    CanadianEh MP TV server rebuild with Colossus 2 - Kodi clients receive PMT error when playing videos recoreded by Colossus 2 TV-Server 1
    Rob Hexenmeister Skinning Online Videos question OnlineVideos 2
    A [solved] How to Play All Videos in a List watch/edit Videos 3
    O 1.25.0 Codecs and Video Format for PlayStation 2 Codecs, External Players 0
    g0rsq Info box randomly popping up when watching TV or other video MediaPortal 2 Newcomers Forum 1
    I Video Playback Stuttering General Support 45
    B some videos jerky Television (MyTV frontend and TV-Server) 0
    B MP 2.2.3 Error playing videos from NAS Submit: Bug Reports 2
    T Kurze Tonaussetzter bei Videos und TV Allgemeines Supportforum 1
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    ajs [Proposal] Video embedded cover MediaPortal 1 1
    G [solved] Black Screen on all videos after upgrading to either 1.23 or 1.24 from 1.22 General Support 4
    H random black screen live tv and videos (amended) General Support 0
    404 [solved] Live TV...video and audio freeze General Support 20
    R kein Ton bei TV, Video, Aufnahme, Musik Allgemeines Support- und Diskussionsforum 0
    U [solved] Dynamic Refresh Rate for 23fps video Watch / Listen Media 1
    J Debug OnlineVideos, How To? OnlineVideos 1
    Similar threads

























    Top Bottom