2

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, 'libvlc_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.

5
  • Can you provide the error message that you're getting? Also, do you have libvlc-dev installed? Commented Feb 3, 2010 at 21:49
  • See edits above...also, I installed libvlc-dev and still have the same problem. Commented Feb 3, 2010 at 22:01
  • nm -D /usr/lib/libvlc.so | grep -w libvlc_media_player_new Does this find the symbol or not? Commented Feb 3, 2010 at 22:20
  • I've grep through the source of VLC 0.8.6e and that string is nowhere to be found. It is in source of vlc-1.0.5 though. Commented Feb 3, 2010 at 22:32
  • I upgraded to vlc version 0.9.9 and replaced libvlc.so with libvlc.so.2 in the code (which was where I found libvlc_media_descriptor after running the nm call given above), and it works! Thank you all! Commented Feb 4, 2010 at 15:38

1 Answer 1

2
$ git clone git://git.videolan.org/vlc.git && cd vlc
$ git log -Slibvlc_media_player_new
...
commit bf1292e44390c6469483cea3817d6c2a3dbd811c
Author: Pierre d'Herbemont <[email protected]>
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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.