Video Stalls for 15 seconds on play? (1 Viewer)

Bernard

Portal Pro
March 5, 2012
103
25
40
Centurion
Home Country
South Africa South Africa
When I press play on a episode, the screen is blank but you hear about 2 seconds of sound. Then it freez and you can do nothing for about 15 seconds. Then suddenly the video flash by and the sound plays from 15seconds later (so the video races to get in sync with sound).

I have wired network connection, did the same on wifi. I have disabled auto import and follw.it connection. also disabled the trakt plugin. MovingPictures works fine. What happen when a episode start that could cause this?
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    @Bernard, actually fixed that same problem for quite a few people, it always came back to a combination of MediaInfo and codecs, mainly the splitter part. LAV is default now for MediaPortal (and I use it myself), but its a codec+splitter solution that is not very concurrent friendly, nor does it play nice with others if a conflict occurs. So check your codec settings via LAV config, but also MediaPortal config and OS codec merits. If all fails the stand-alone MPC-HC codecs are a good solution, as they are concurrent optimized.

    As stated it is a combination issue, for example MediaPortal uses MediaInfo to read any file before playback to get resolution/framerate/etc info, this then in turns makes a non-concurrent optimized codec freak out because it is being used by both MediaInfo for info as well as MediaPortal for playback and causes the delay. Once it is down to a single process of MediaPortal playback then the system can catch up, causing the fast video playback to reach the actual point in time it would be at and all returns to normal.

    This can happen on a fast computer as well (usually ends up being caused by a mainboard with lousy DPC Latency), and is easy to reproduce/test-for via concurrent RDP.

    PS: I use LAV myself, so there is nothing wrong with it per se, but the codec configuration can get messed up sometimes. For example on a lot of LAV updates the video codec settings revert back to default of 'none', so I have to manually switch DXVA2 back on. Also I can never playback media on my HTPC via concurrent RDP when MediaPortal is playing, or it will skip and run out of sync constantly (this works fine with MPC-HC codecs+splitters).
     

    Bernard

    Portal Pro
    March 5, 2012
    103
    25
    40
    Centurion
    Home Country
    South Africa South Africa
    Haha, RoChess, you are a genius!

    I was going to cross-question your suggestion, but then thought maybe I should just try it. So I went and set all my codecs to "not LAV" (whatever was available) and it solved the problem.

    Now where I don't follow is why this problem does not show up on Moving Pictures as well? I mostly view AVI encoded movies and tv series, but also mp4, but they all struggled on TV-Series, but not on Moving Pictures. (Or I don't understand the root of your explanation here!)

    So what you're saying now, is that LAV will not work. Or am I missing a fix for making LAV work fine in your explanation as well? I have no need for LAV, I like to use it because of it being OpenSource and well though out (Same reason I use Xvid and not DivX for encoding). But I don't know a lot about video decoding, so I don't even see the difference between LAV and other codecs.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    MPC-HC is open source as well and as I stated more concurrent friendly.

    As for why it happens for MP-TVSeries and not MovPic is because there is a lot more going on in the background with MP-TVSeries, and all the added I/O impacts the concurrency factor that LAV codec is missing, which causes the stall/skips/etc.

    Turning of log files can sometimes be enough, or adjust priority on the playback thread. It can also be that the combination you have with other plugins is causing it, or the configuration of them (import scanning during fullscreen playback, etc).

    I've got an old BE-2400 dual-core AMD 2.3Ghz CPU with LAV 0.55.3 codec and can play a variety of SD, 720p and 1080p media without any issues (HD4350 videocard takes care of DXVA2 native acceleration configured inside LAV video codec settings). However when too many things are happening at once, then I do feel my system playing 'catchup' on occasion.
     

    Bernard

    Portal Pro
    March 5, 2012
    103
    25
    40
    Centurion
    Home Country
    South Africa South Africa
    Mmm... ok this did not work as I thought. The issue does not show itself all the time. (6 seconds of sound and black screen, and then 35 seconds of silence and black screen, then audio continues and video catch-up.)

    It only happen if I play an episode that I have not played before. But when I play an episode that I have played before even if it was weeks ago, it is playing fine. It does not matter if it is MKV or AVI.

    But only episodes I actually did play. So marking them as watched does not take away the problem.

    I have now lastly also disabled the Trakt plugin, and that seem to be working.. together with a different codec for AVI and MP4. I will see if I change my codecs back to LAV if the problem stays away or not. Will let you know here again..
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    MediaPortal launch:
    • MovPic scans all your import folders for missing MediaInfo, Artwork and other tasks (this can take several minutes on slow systems and/or large collections)
    • Other plugins do the same thing usually (MP-TVSeries, etc)
    MovPic import new movie in the background (can also happen during playback of another):
    • Movie details, artwork and MediaInfo is obtained

    MovPic starts playback:
    • MediaPortal is given playback control, and issues a MediaInfo scan to get info it uses for example to adjust framerate based on fps data

    That's a lot of concurrency stuff going on all at once, which depending on other conditions cause your behaviour. You should enable debug verbosity log mode and check for example if your library is missing a giant amount of covers. This causes MovPic to waste a lot of time each time MediaPortal launches and it is easy to be quick enough to launch a movie during this time, which would result in issues then if everything does not play nice at multi-thread concurrent level.

    I had a 45-90 second delay playing some AVI files once, which turned out to be a bug in MediaInfo that it was scanning the entire file and not just the header. Because the file was being streamed via WiFi.B it was quickly noticable as it took quite a bit of time for the entire file to be transferred before playback would start. Started ticket on SourceForge with MediaInfo developers, they provided FTP access, uploaded one of the files causing the problem and a few days later new MediaInfo released that fixed the problem.

    Looking at your log files can reveal a ton of information.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia
    I have now lastly also disabled the Trakt plugin, and that seem to be working.. together with a different codec for AVI and MP4. I will see if I change my codecs back to LAV if the problem stays away or not. Will let you know here again..
    If you do suspect Trakt being a culprit please post debug logs as I would be interested. A lot of work has gone into preventing anything like that so I would be very surprised if that was the case.

    My guess is that its Codec / MediaInfo related.
     

    Bernard

    Portal Pro
    March 5, 2012
    103
    25
    40
    Centurion
    Home Country
    South Africa South Africa
    @Itfearme: My last attempt did not work. In fact the delay got worse!

    I don't get any MPC-HC codecs even after installing MPC-HC, so I installed K-Lite Mega Codec Pack, this added a few options. But I don't see a difference with any of them.

    I'm going to post bug reports on this. Do I need to enable "verbose" logging only in MePo config, or do I have to enable this in MP-TV Series as well? (I did not find such a setting). Also if I use the option to run MePo with the debug shortcut (and then using the Debug GUI option window), it does state that it sets the logging level to "debug" mode, is this sufficient or must I use "verbose"? (Although I'm going to use "verbose" because I don't see useful info in logs anyways).

    Another thing to notice is that this problem does not show itself when I watch the same video using the "Video" (default) extention.

    I have switched off any "auto scan" options for Moving Pictures and TV-Series, but Moving Pictures seem to scan anyways. I am on a wired 100Mbps LAN.
     

    Bernard

    Portal Pro
    March 5, 2012
    103
    25
    40
    Centurion
    Home Country
    South Africa South Africa
    ..., but Moving Pictures seem to scan anyways.
    I just checked and noticed that MoPic does not have an option to switch off "auto scan" on startup. But I have unchecked the option to run the scan after a set interval.

    I also ensured that TV-Series is set to not do a "local/online" scan on startup. And also "Watch my Import folders..." is unchecked.

    I have attached the log files:
    • I played one video that was fine,
    • and then another that had the delay problem,
    so maybe you can compare their entries.
     

    Users who are viewing this thread

    Top Bottom