wxMediaCtrl load file glitching

I’m using the MediaCtrl class to load different video files to the same MediaCtrl instance. Basically it works fine but on every Load() call the first frame of the newly loaded file is shown in fullscreen for fractions of a second. This fullscreen view disappears again after really short time but it happens a lot.

Playing around with various settings of the MediaCtrl class didn’t help. Also, I can only use the MEDIABACKEND_GSTREAMER as I’m on Ubuntu (20.04).

Has anyone experienced and solved this issue?

THanks in advance!

Hi inspire,

I tested a simple app that uses the code from the MediaCtrl example in the wxPython demo. I am using wxPython 4.2.0 on Linux Mint 21 (which is based on Ubuntu 22.04).

I haven’t seen the fullscreen issue that you describe. Without seeing the code from a minimal working example that demonstrates the problem, it’s difficult to guess the cause.

The only problem that I’m having is that when I call the MediaCtrl’s Play() method after loading a file, there is a pause of about 5 seconds before it actually starts playing.

MediaCtrl.Load(path) returns True immediately, but actually continues loading in the background. Is your issue related to this? I’m not sure about MEDIABACKEND_GSTREAMER but you might be able to hook wx.media.EVT_MEDIA_LOADED before play.

I have not seen the OP’s problem either (on Windows 10 with MEDIABACKEND_WMP10).

My test app already binds EVT_MEDIA_LOADED to a handler that enables the Play button so I can’t start playing the video until that event occurs. If I wait about 20 seconds after the play button has been enabled before I press it, then it will play a few frames before freezing for about 5 seconds and then playing the rest of the video.

I did wonder if it was because I was testing it on and old PC in which I had to replace the graphics card with an older, lower spec card. However I just tested it on my new PC and it behaves the same the same, except the pause is a little shorter (3 -4 seconds). If I let the video run through to the end and restart it, the delay still happens.

I’ve probably seen something similar on Windows…maybe a few years ago…but it wasn’t reproducible and haven’t seen it recently and forgot. WxPython 4.0.7…?

I also noticed something similar to OP’s problem on Windows 10. Each time loaded, a flashback of the first frame appears in the MediaCtrl. But it is not fullscreen, so I don’t need to care about it.

Thanks for your feedback!!
the fact that you couldn’t reproduce it made me experiment. I could resolve it by building wxPython on my own. Somehow the version we used seems to have that issue. The EVT_MEDIA_LOADED topic however is something we didn’t take into account yet - thanks for the hint!