Basic python / VLC vlc.py set up

This forum is about all development around libVLC.
rodd
New Cone
New Cone
Posts: 3
Joined: 09 Mar 2015 23:19

Basic python / VLC vlc.py set up

Postby rodd » 09 Mar 2015 23:50

Dear VLC'ers

I am attempting to control VLC from python (fullscreen playback) using the python bindings vlc.py.

I am unsure where to install the vlc.py module and hoping someone can help. I'm on MacOs, VLC 2.0.9, Python 2.7.3.
The documentation for vlc.py is generally very good but the installation instructions less so.

I'm aware that the Lua code modules live inside VLC.app/Contents/MacOs/share/lua and wonder if the vlc.py module should be placed somewhere similar?

At the moment I am running the vlc.py module in the same directory as my test script - and outside of the VLC.app directories and although the python is executing without errors it isn't playing the video or returning any parameters about the specified mp4 file.

so the following test script

Code: Select all

import vlc def setup_player(filename): vlc_instance = vlc.Instance('--no-audio', '--fullscreen') player = vlc_instance.media_player_new() media = vlc_instance.media_new(filename) player.set_media(media) print media.get_mrl() # File location to get title print player.get_length() #Time duration of file -1 means there is no media print player.get_state() #Player's state player.play() setup_player('foo.mp4')
outputs:

Code: Select all

file:///Users/admin/Sites/pythontest/foo.mp4 -1 State.NothingSpecial
-1 means there is no media

Apologies for a banal question! Any help very gratefully received.

OlivierAubert
Developer
Developer
Posts: 92
Joined: 08 Mar 2007 15:43

Re: Basic python / VLC vlc.py set up

Postby OlivierAubert » 12 May 2015 00:03

The macosx init code is currently very basic, see https://github.com/oaubert/python-vlc/b ... y#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 up.
Since from you example you can initialize and call the API, it correctly finds the libvlc.dylib but I would guess it does not find the correct location for the plugins (plugin_path variable). Is you VLC in a standard location ?

rodd
New Cone
New Cone
Posts: 3
Joined: 09 Mar 2015 23:19

Re: Basic python / VLC vlc.py set up

Postby rodd » 12 May 2015 11:26

Thanks for your reply Oliver. My VlC install is in the normal place. I made some progress but then got a corrupt libraries error. More detail here
http://stackoverflow.com/questions/2897 ... -of-vlc-py


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests