Long delay before video is showing (1 Viewer)

lcg

Portal Member
April 19, 2006
5
0
Home Country
Germany Germany
Hi,

when I start a movie from Moving Pictures 1.3.1, the audio starts playing almost immediately but the screen keeps showing the movie list. After a rather long time (20+ seconds), the Moving Pictures GUI disappears and video playback starts; the video position matches the audio from that point on.
If I start the same video from MediaPortal's own video plugin, both video and audio start simultaneously (or at least with unnoticeable delay).
I have captured and looked at debug logs of MediaPortal and Moving Pictures from the following steps (I have shortened them to the relevant sections and attached them, but I have the complete logs available if necessary):
  • Start movie from Moving Pictures => video not showing for 20+ seconds, audio plays fine
  • Start the same file from My Videos => video and audio start immediately
  • Start again from Moving Pictures => same delay as in step 1

Looking at the output, I see a long pause in the MediaPortal log before "g_Player: ShowFullScreenWindow":
Code:
2012-01-21 12:08:55.813330 [Info.][MPMain(1)]: g_Player.OnStarted() R:\Filme HD\American Beauty\American Beauty (1999).mkv media:Video
2012-01-21 12:08:55.882334 [Debug][(22)]: PlaneScene: PresentImage() dispose surfaces
2012-01-21 12:09:18.898650 [Debug][MPMain(1)]: g_Player: ShowFullScreenWindow
2012-01-21 12:09:18.902650 [Info.][MPMain(1)]: g_Player: ShowFullScreenWindow switching to fullscreen video

If I check the same point when starting from My Videos, this shows up:
Code:
2012-01-21 12:09:43.213041 [Info.][MPMain(1)]: g_Player.OnStarted() R:\Filme HD\American Beauty\American Beauty (1999).mkv media:Video
2012-01-21 12:09:43.220041 [Debug][MPMain(1)]: g_Player: ShowFullScreenWindow
2012-01-21 12:09:43.220041 [Info.][MPMain(1)]: g_Player: ShowFullScreenWindow switching to fullscreen video
2012-01-21 12:09:43.230042 [Debug][MPMain(1)]: Window: MediaPortal.GUI.Video.GUIVideoFiles deinit
2012-01-21 12:09:43.240042 [Debug][MPMain(1)]: TextureManager: CleanupThumbs()
2012-01-21 12:09:43.265044 [Debug][(33)]: PlaneScene: PresentImage() dispose surfaces

Does anybody have an idea what might be causing the 23s pause before "g_Player: ShowFullScreenWindow" in the first log file snippet?

Regards,
lcg

P.S.: Codec-wise, I keep my system pretty clean. I have only installed Haali Splitter for Matroska containers and ffdshow-tryouts for pretty much everything I ever want to put into such a container.
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    For me the Haali splitter is well known for that delay, especially in combination with ffdshow codec. I was forced to use the Haali splitter myself in combination with ffdshow-tryouts for audio because of a dual-track TV show and it caused a short delay with the same symptoms as you mention. It only happens the very first time though where it was noticable. If I allowed the file to catch up, then stop it, then restart and not resume, it would work proper (or at least delay wasn't noticable).

    My guess is that ffdshow codec by default does some sort of analyzing of the file before playback, but that the time to analyze conflicts with the playback. Perhaps this is caused by the MediaInfo scan that MediaPortal performs right before playback as well. It can also be that updating the MediaInfo DLL library will fix your issues, please read: https://forum.team-mediaportal.com/836165-post4.html for more info on how to do that.

    You could also try uninstalling Haali and registering the "MatroskaSplitter.ax" splitter that the MPC-HC standalone pack provides. On a clean system, removed from any other codec-pack or splitter, you could also use the following:


    All the splitters that most people might need (you could register the "AviSplitter.ax", but Windows OS splitter works very well), this covers MKV for Matroska videos, FLV for OnlineVideos plugin and MP4 also for OnlineVideos plugin and all the Apple formats such as m4v, etc.

    regsvr32 "C:\Program Files (x86)\MPC-HC Standalone Filters\MatroskaSplitter.ax"
    regsvr32 "C:\Program Files (x86)\MPC-HC Standalone Filters\FLVSplitter.ax"
    regsvr32 "C:\Program Files (x86)\MPC-HC Standalone Filters\MP4Splitter.ax"


    All the codecs that most users require, the Video one covers DivX/XviD, H.264, etc and the Audio one covers MP3, DTS, AC3, etc.

    regsvr32 "C:\Program Files (x86)\MPC-HC Standalone Filters\MPCVideoDec.ax"
    regsvr32 "C:\Program Files (x86)\MPC-HC Standalone Filters\MpaDecFilter.ax"

    PS: Adjust the folder location to what you end up using of course and be sure to use an elevated command prompt to run the commands from (Start -> All Programs -> Accessories -> Command Prompt -> right click and select "Run as Adminstrator"), otherwise the codec/splitters are not registered correct for the OS to use.

    Verify inside MediaPortal config -> codecs that "MPC ....." is selected, and you are good to go.
     

    lcg

    Portal Member
    April 19, 2006
    5
    0
    Home Country
    Germany Germany
    Thanks for your help.

    For me the Haali splitter is well known for that delay, especially in combination with ffdshow codec. I was forced to use the Haali splitter myself in combination with ffdshow-tryouts for audio because of a dual-track TV show and it caused a short delay with the same symptoms as you mention. It only happens the very first time though where it was noticable. If I allowed the file to catch up, then stop it, then restart and not resume, it would work proper (or at least delay wasn't noticable).
    These are exactly my symptoms. If I stop playback and start it again immediately, the video starts right up, with no noticeable delay; if I play a different file and then start the first one again, it seems the cached information (whatever it is) is forgotten and video is delayed once again.
    I did, however, continue testing yesterday after I wrote this post. I uninstalled Haali and ffdshow and replaced them with LAVfilters (which didn't work too well as I could no longer switch audio tracks in WMP; but it was worth a try). The symptoms were exactly the same, so Haali and ffdshow aren't solely responsible. Also, the delay goes away if I use the Microsoft h.264 decoder, so ffdshow is at least part of the problem; but I really like ffdshow's postprocessing and upscaling, so I'd rather solve the problem and keep ffdshow.

    My guess is that ffdshow codec by default does some sort of analyzing of the file before playback, but that the time to analyze conflicts with the playback. Perhaps this is caused by the MediaInfo scan that MediaPortal performs right before playback as well. It can also be that updating the MediaInfo DLL library will fix your issues, please read: https://forum.team-mediaportal.com/836165-post4.html for more info on how to do that.
    That actually pointed me in a good direction. There definitely seems to be a connection: I renamed MePo's MediaInfo.dll so MePo wouldn't find it anymore => no delay. I don't know what functionality I lose when taking the file away from MePo, so probably not a good solution. Replacing it with the latest version I have installed with MediaInfo GUI causes the same delays again. :( An older version (0.7.27 vs. 0.7.35 in MePo's default install) did not help, either.

    But the strange thing is that the delay only occurs in Moving Pictures and in the TV Series plugin, not in My Videos (which I don't really want to use). So these two must do something different than My Videos. Maybe I can find the time to install Visual Studio on my home computer and have a look at the sources.

    You could also try uninstalling Haali and registering the "MatroskaSplitter.ax" splitter that the MPC-HC standalone pack provides. On a clean system, removed from any other codec-pack or splitter, you could also use the following:
    (steps to register MPC-HC standalone codecs)
    This might solve my problems in MePo, however I would lose the functionality I use from ffdshow (upscaling and postprocessing) as well as the ability to switch audio streams in WMP. It seems I am caught between a rock and a hard place.

    What I find curious, though, is that there aren't many reports of this problem. I would have thought that ffdshow is a common codec, since it provides so many things in an integrated package without the need for some codec packs, which break your system in horrible and unknown ways. And I also would have expected both Moving Pictures and TVseries to be popular plugins in MePo installations.

    Regards,
    lcg
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    I think what you are left with then is keep adjusting ffdshow settings so that the impact is as small as possible.

    More then likely this is happening to you due to networked media, which takes extra time to be read and indexed by MediaInfo and ffdshow itself so that they can do their thing.

    As far as disabling MediaInfo for MediaPortal, it is indeed an all or nothing scenario then, MePo uses it more then likely to get the frame-per-second info, so that it can be used for that option that allows MePo to switch your TV/etc to 24Hz when it detects 24fps media. This is why MePo uses MediaInfo each time directly before playback starts.

    So disabling it for that is not the end of the world if you do not use that system. However you would then also disable it for MovPic, and that one uses it to display all the interesting stuff about the media you imported. Of course you could toggle it each time.

    That way right before you import a movie you enable MediaInfo and disable it afterwards so that playback has no problem.
     

    lcg

    Portal Member
    April 19, 2006
    5
    0
    Home Country
    Germany Germany
    I think what you are left with then is keep adjusting ffdshow settings so that the impact is as small as possible.
    Well, I am currently down to less than 10s. Still not perfect, but considering that my receiver loses the audio connection for DTS every time I pause and I have to skip back 15s anyway, what's skipping back an additional 15s at the beginning of a movie. ;)

    More then likely this is happening to you due to networked media, which takes extra time to be read and indexed by MediaInfo and ffdshow itself so that they can do their thing.
    Actually, all my files are on local disks, because my HTPC uses a wireless connection and -- after I got rid of my file server -- I did not want to have some network storage running all the time, consuming energy when nobody's home.

    As far as disabling MediaInfo for MediaPortal, it is indeed an all or nothing scenario then, MePo uses it more then likely to get the frame-per-second info, so that it can be used for that option that allows MePo to switch your TV/etc to 24Hz when it detects 24fps media. This is why MePo uses MediaInfo each time directly before playback starts.

    So disabling it for that is not the end of the world if you do not use that system. However you would then also disable it for MovPic, and that one uses it to display all the interesting stuff about the media you imported. Of course you could toggle it each time.

    That way right before you import a movie you enable MediaInfo and disable it afterwards so that playback has no problem.
    I was actually thinking about something like that, too. Both Moving Pictures and TV Series scan metadata on import and store it in their own databases, they don't really need it for playback. My TV is an older model, so 60Hz is all it can take, therefore no refresh rate switching for me either.
    I think I am going to test renaming MediaInfo.dll and see if any functionality in MePo breaks. And when I import new movies, which happens maybe once every two weeks (probably even less often), I can close MePo, rename the .dll back, and start the import. Not a big deal for me.

    Thanks for your help in figuring this out,
    lcg

    P.S.: I just found this in the MediaPortal 1.2 changelog:
    "[Workaround] #2926 - MediaPortal can now work without MediaInfo.dll
    · This workaround will help users to play files which cause a freeze of MediaPortal on playback start due to a bug in MediaInfo"
    So it seems this is indeed a known problem and that 1.2 actually works without MediaInfo. Good thing I didn't try to fix this sooner. :)
     

    Knives03

    Portal Pro
    March 6, 2009
    103
    2
    I just wanted to pop into this topic because I am experiencing a similar delay all of a sudden. I am having about the same length of a delay out of the blue while trying to watch TV shows. Everything was working fine, and then suddenly I started to have these long delays where the video is not appearing until about 25 seconds after selecting the file, meanwhile the audio starts instantly.

    I have not yet had a chance to replace the MediaInfo.dll file as suggested, so I will be doing that as soon as I can. Also, I will post my log files when I have a chance if it would be helpful in any way. I'm really unsure of why this started to happen today, but I saw this topic the other day and it sounded similar to what I am now experiencing.

    Will report back soon!

    BTW I am using SAF6 with FFDShow decoder for video. I am going to check that thread as well to see if anyone else is experiencing this issue.
     

    Knives03

    Portal Pro
    March 6, 2009
    103
    2
    It looks like replacing the MediaInfo.dll file as RoChess had suggested has fixed my problem for now, but I will be sure to post back if I come across the issue again!
     

    Patski

    New Member
    April 13, 2012
    2
    0
    Home Country
    Australia Australia
    Hello,
    I'm new so I'm not sure this is the right place to post this video sync problem.

    So near but so still so far away. I need help please!
    I have gone as far as I can by going through FAQ and forms.

    The story so far (after 2 months).

    TV Server and MediaPortal (version1.2.2.0) is installed on the Medion System.
    MediaPortal installed on 2 wireless notebooks.

    Everything is working including the remote controller (Medion 20030310) except for the one thing that I want to use, the @$%^* AV input or the s-video input from tuner/ graphics card! Well, that is… it works, but the video is delayed by about a massive 10 seconds from the sound and is unwatchable. This is in when viewed in MediaPortal – TV Server Configuration Preview (and on the notebooks MediaPortal). Viewing directly from the Tuner is in sync on both apps. This does not happen when I use CyberLink PowerCinema. When using CyberLink PowerCinema the front inputs are fine and in sync. The same applies to the video / audio from my mobile so it’s not the cable box. Also the sound and video are in sync when the analog or digital tuner is selected in MediaPortal. I am using the 713xBDA Analog tuner and 713xBDA DVBT tuner in TV server.

    On the PC the Audio is controlled by the AUX Volume and the sound comes through the minute XP starts with no Apps open, but is in sync with the input. Checking the mute on AUX Volume box stops the sound.

    Drivers
    TV Card – Philips SAA7134, Hybrid Capture device. Philips Semiconductors
    12/08/2009 Version 1.4.0.3

    NVIDIA GeForce 6700XL 6/11/2007 version 6.14.11.6906

    I have not been able to get the SCART , AV, composite or s-video OUT on the back of this machine to work so I am using the PC VGA and sound out to the TV. All the inputs are on the front.
    Play back of movies, selection of digital channels and analog channels from the TV tuner card ARE in sync, even the time shift BUT not the AV or s-video inputs.

    Any ideas please?
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Hi & welcome,

    1st: I think your TV Card – Philips SAA7134, Hybrid Capture device is a SW Encoding device (for analog sources)? If so support will be mediocre at best. We might not be able to get it running well.

    2nd: Please check the wiki page http://wiki.team-mediaportal.com/1_...rs/7_Scan_Analog/Software_Encoding_Card_Setup to setup the SW encoding part (if I am right in the first guess).

    3rd: If it does not work, please post a new thread with debug logs (see my footer on how to)
     

    Patski

    New Member
    April 13, 2012
    2
    0
    Home Country
    Australia Australia
    Thank you for your quick reply.
    I checked as above and ended up installing MP Server V. 1.2.30.
    and it is still the same.
    In MP Server...
    Under General / Software Encoders
    Video Encoders
    Installed Yes

    CyberLink MPEG Video Encoder
    MainConcept MPEG Video Encoder
    Unlead MPEG Encoder

    Audio Encoders
    CyberLink MPEG Audio Encoder
    MainConcept MPEG Audio Encoder

    Checking the boxes to reuse (or change the order) of the installed ones does not make any difference to the video lag.
    Also I found the specs on the chip set (attached) and I'm not sure but it does look as though it's HW encoded ?

    I know that this tv card is old now but not many TV Cards have an Analog or S- Video input so that I can connect the cable TV to record and timeshift. (I got fed up replacing the caps in the M******** HD Recorder every few months) and want to use this system as a replacement.

    Again, the AV and S-video work fine in CyberLink PowerCinema.

    Cheers
     

    Attachments

    • datasheet.pdf
      107.5 KB

    Users who are viewing this thread

    Top Bottom