I am actually roaming here from time to time. For this question, you have to instanciate the MediaDiscoverer through a vlc Instance, just like in the native libvlc API (which the python bindings merely wrap), something like: i = vlc.Instance() discoverer = i.media_discoverer_new("foo") lis...
Very good and precise explanation of the issues. It would be very nice if we could somehow integrate some of your code into the bindings themselves so that it is more intuitive to people. The plugin code is auto-generated from the bindings, but we can override some methods to add a more pythonic beh...
Hello Sampsa Your description of the problem is accurate. A simpler and more portable solution (than using swig) is to simply use ctypes to call the appropriate function. So something like x11 = ctypes.DLL("libX11.so") x11.XInitThreads() before initializing the display code should be enoug...
Please check again with the latest version of the vlc.py module, it fixes the --plugin-path warning.
Second, make sure that your python version is compiled for the same architecture as your VLC app. If they do not match, python is unable to access the libvlc API.
Hi - one instance for all streams: it depends on the settings you want to set. Looking at your code, it seems to me that sout must be set at the instance level. You should dig into the libvlc doc/code (not python-specific) to be sure. - AFAIK, there is no native way of synchronizing multiple players...
The libvlc is not reentrant, especially wrt callbacks (see https://forum.videolan.org/viewtopic.php?t=80305 for instance). You should make sure the libvlc functions are called from the same thread. This can be done through signals in gtk.
In fact (on windows and linux at least, macosx is different in this respect), if no video widget is specified, a new one will be created by libvlc. So the above code should work. Note that it could be shortened to import vlc p = vlc.MediaPlayer('c:\\VLCTest\Video-1028.avi') p.play() If you do not se...
Did you install VLC (the player) alongside the python module ? The module is just a wrapper around functions found in the libvlc library, so it depends on the presence of the libvlc.dll file.
The python SimpleHTTPServer is not up to the task of serving videos, it does not even support range requests. For this kind of task (video server launched from the command line for quick tests), I tend to use alternatives such as
It looks like you should use the imem input module. You can have a look at some threads from the forum, e.g. https://forum.videolan.org/viewtopic.php?f=32&t=93842#p311611 Getting it to work with the python bindings is an interesting challenge. When you manage to get something, please contribute ...
The macosx init code is currently very basic, see https://github.com/oaubert/python-vlc/blob/master/generated/vlc.py#L150-160 It looks for libvlc.dylib in /Applications/VLC.app/Contents/MacOS/lib. If it does not find it here, it tries a blind open of the lib, hoping that some path is correctly set u...
Regarding your question about getting the currently playing item, the libvlc API (from libvlc_media_list_player.h) does not provide such a function. Hence the python bindings cannot provide it either. If you need more control, you should manage the playlist by yourself (and this is not a limitation ...
There has been no answer on this forum, but I would guess that the doc change that was done few minutes after this post is related. For the (forum) record, the documentation for libvlc_audio_set_volume_callback states that "This only works in combination with libvlc_audio_set_callbacks().".
Look at the __main__ part of the vlc.py module, it is an example application. You can see that it updates a marquee with the current time. As specified in the comment : # Some marquee examples. Marquee requires '--sub-source marq' in the # Instance() call above. See <http://www.videolan.org/doc/play...
It works for me, on my x86_64 Debian. All hope is not lost for windows users then, but I do not have (and do not want) access to this kind of platform to make sure it works. Contributions are welcome.
To precise Rémi's answer, the libvlc API is not reentrant, and since the python bindings directly wrap this API, they are not reentrant either. See for instance viewtopic.php?f=32&t=82502&start=0 for a similar discussion.
Your end_reached method is in another class than the video player, but it is not what matters here. What matters is that no libvlc method is called from the thread of execution of the libvlc callback. In more practical terms, depending on your mainloop library, in your end_reached method you should ...
Nice that you found a solution, and posted it. Some comments about your code: - to avoid cluttering your code (and the whole interpreter) with global variables, consider defining your own class (StreamPlayer) and add the necessary variables as instance variables for this class, e.g. class StreamPlay...
If you need more control over the video ouput, you should embed it in a widget (that you can then control). You cannot change the behaviour of the standard video output.