wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.34k stars 517 forks source link

adding a wx.media.MediaCtrl causes "Got an invalid playbin (error 2: No such file or directory)" to be displayed in a dialog #382

Open krichter722 opened 7 years ago

krichter722 commented 7 years ago

In the simplest case like

#!/usr/bin/python
# -*- coding: utf-8 -*-

import wx
import wx.media
import plac

class NoValidAudiosink(wx.Frame):

    def __init__(self, parent, id, title, input_file):
        wx.Frame.__init__(self, parent, id, title, size=(600, 500))
        self.videoPanel = wx.Panel(self)
        self.mplayerCtrl = wx.media.MediaCtrl(self.videoPanel, -1)
        self.Show(True)
        # the dialog is displayed already without the video being requested to be played
        self.mplayerCtrl.Load(input_file)
        self.mplayerCtrl.Play()

@plac.annotations(input_file=("the file to try to play", "positional"),
)
def __main_delegate__(input_file):
    """necessary function to make `plac.call` possible in `main`"""
    app = wx.App(False)
    frame = NoValidAudiosink(None, wx.ID_ANY, title="Title", input_file=input_file)
    frame.Show(True)
    app.MainLoop()

def main():
    """`entry_point` for `setuptools`"""
    plac.call(__main_delegate__)

if "__main__" == __name__:
    main()

a dialog with the message Got an invalid playbin (error 2: No such file or directory) is displayed right after start. I use the Store Wars VLC demo file sw_h264.asf from http://altair.videolan.org/~dionoea/vlc-plugin-demo/, i.e. invoke python invalid_playbin.py /tmp/sw_h264.asf. The user has no idea what the message could mean and how to proceed. I assume it's the reason that the MediaCtrl doesn't play. The message also occurs if the MediaCtrl is only displayed.

experienced with wxPython-4.0.0a2-65-g85f11ff1 on Ubuntu 17.04

muman613 commented 6 years ago

I don't know if this issue has been resolved but I encounter the same thing, when running the wxdemo application, and try the MediaCtrl demo. I am running Ubuntu 16.04 and just installed wxPython along with the dependencies. It is not critical for my application as I am currently using wxPython for a non-media application but I have used wxWidgets in C++ for media apps and wonder why this is not working. I just installed the latest gstreamer packages.

krichter722 commented 6 years ago

@muman613 It seems to work on 18.04. Can you confirm that? Maybe in a VirtualBox VM?

muman613 commented 6 years ago

I don't have an 18.04 Ubuntu VM at my disposal at the moment. It is odd my company is tethering us to Ubuntu 14.04. But my home system is a Windows host running an Ubuntu 16.04 VM... I suppose I should install 18.04 some time soon, and I used to keep many VM's at my last job. I could not believe that I had to install GTK3 and gstreamer in order to be able to build the wxWidgets for wxPython. Anyway, I know that I see the error about playbin when I try to run the Media demo with my current system.

Suppose I will get back when I have a 18.04 VM running...

Thank you, Michael Uman

PS: I just ran the demo again and am getting a different failure this time.

gabycperezdias commented 6 years ago

Any updates on thiṣ? For me, I tried the demo for MediaCtrl shown in this repository and I had the same error.... Ubuntu 16.04

lmoralesroldan commented 3 years ago

You must compile wxpython width the corrects libraries https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html

I had got the same problem, and i hadn installed de GStreamer so the wxpythond didn't compile the MediaCtrl

Good luck

infinity77 commented 2 months ago

@swt2c : I only have Windows, but from the comments above related to GStreamer I have the feeling that this is just an issue with missing/wrong libraries, so not really a wxPython bug - unless of course wxPython does not ask for the correct libraries.