VLC/Python bindings?
Does anyone know how to implement the VLC Python bindings? I downloaded vlc.py and vlcwidget.py from the VLC wiki (http://wiki.videolan.org/Python_bindings) and tried to run vlcwidget. Other than having vlc installed, do I need to do anything else, or should I just be able to run 'python vlcwidget.py '? Because that is not working for me. I'm using Python2.5 and VLC 0.8.6e on Ubuntu 8.04.
The problem has to do with my libvlc shared library, I think. That library is used to create this instance:
dll=ctypes.CDLL('libvlc.so')
and then later, the error occurs here:
if hasattr(dll, 'libv开发者_如何学Pythonlc_media_player_new'): ...
dll apparently doesn't have a libvlc_media_player_new attribute and so fails to create other objects it needs. Specifically, the libvlc_media_player_new function isn't created.
$ git clone git://git.videolan.org/vlc.git && cd vlc $ git log -Slibvlc_media_player_new ... commit bf1292e44390c6469483cea3817d6c2a3dbd811c Author: Pierre d'Herbemont <pdherbemont@videolan.org> Date: Sun Mar 30 03:59:32 2008 +0200 libvlc: rename libvlc_media_descriptor to libvlc_media and libvlc_media_instance to libvlc_media_player.
There was no libvlc_media_player_new
prior to this commit, which went in some time between 0.8.4 and 0.9. (I'm not sure when; VLC's git repository seems to be missing tags in that range.)
The Python bindings use the newer API. You'll have to upgrade VLC to use them.
精彩评论