VLC - Python binding

Just have a drink and chat
ericaro
New Cone
New Cone
Posts: 6
Joined: 23 Oct 2008 16:23

VLC - Python binding

Postby ericaro » 23 Oct 2008 16:50

Hi all,
don't know exactly where to post this.

I'm trying the pyhton bindings.

BTW, the wiki page is obsolete (links are broken)

but I finally get all (the binaries and the sources for v0.9.4).

But the tuto says to go to bindings/python, and there is no such a directory (and there is only one python file in the whole sources),
I can browse thoses sources in the trac website but can't download them.

any idea ?

a binary download of the pyd, for any plateform would be VERY VERY VERY great

tx

Eric

ericaro
New Cone
New Cone
Posts: 6
Joined: 23 Oct 2008 16:23

Re: VLC - Python binding

Postby ericaro » 23 Oct 2008 18:56

finally I managed it. (using GIT, and the last release)

now I've got it, it does NOT work :

Instanciating mediacontrol
[00000001] main libvlc debug: VLC media player - version 0.9.4 Grishenko - (c) 1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure '--host=i586-mingw32msvc' '--build=i386-linux' '--enable-mkv' '--enable-release' '--without-contrib' '--enable-nls' '--enable-shared-libvlc' '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-real' '--enable-realrtsp' '--enable-ffmpeg' '--with-ffmpeg-mp3lame' '--with-ffmpeg-faac' '--with-ffmpeg-config-path=/usr/win32/bin' '--with-ffmpeg-zlib' '--enable-live555' '--with-live555-tree=/usr/win32/live.com' '--ena
[00000001] main libvlc debug: translation test: code is "C"
[00000001] main libvlc error: no memcpy module matched "any"
[00000007] main access error: no access module matched "file"
[00000006] main input error: open of `file/xspf-open://C:\Documents and Settings\ericaro\Application Data\vlc\ml.xspf' failed: could not create access: no access module matched "file"
[00000010] main interface error: no interface module matched "hotkeys,none"
[00000010] main interface error: no suitable interface module
[00000001] main libvlc error: interface "hotkeys,none" initialization failed


any idea ?

ericaro
New Cone
New Cone
Posts: 6
Joined: 23 Oct 2008 16:23

Re: VLC - Python binding

Postby ericaro » 23 Oct 2008 21:06

I got the soluce :

in vlcwdiget, the player must be init with at least :

["--plugin-path=.\plugins"]

like that :

Code: Select all

class VideoPlayer: """Example video player. """ def __init__(self): self.vlc = DecoratedVLCWidget(["--plugin-path=.\plugins"])
and it works fine (at least, the pyd being in the VLC directory, I'm gonna try to move it to a cleaner place!

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: VLC - Python binding

Postby ivoire » 23 Oct 2008 21:47

If you wan to add some options/features to this binding don't hesitate to send use patches. They are more than welcome :wink:

ericaro
New Cone
New Cone
Posts: 6
Joined: 23 Oct 2008 16:23

Re: VLC - Python binding

Postby ericaro » 24 Oct 2008 11:40

I would be pleased, and a binary-python distribution would be nice, in the pypi directory. I can handle the win32 one, maybe the ubuntu one.

Are you ok with that ?

if yes I can start a pypi modules (called vlc?) and upload all the required packages. This way python user will only have to write :
easy_install vlc-win32-all

to get all the binaries ready to run

I'm considering : vlc-win32, vlc-win32-all (the same but with all the required dlls, so it works without vlc installation)
what about linux ?

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: VLC - Python binding

Postby ivoire » 24 Oct 2008 20:02

I would be pleased, and a binary-python distribution would be nice, in the pypi directory. I can handle the win32 one, maybe the ubuntu one.

Are you ok with that ?
You're free to do it, as long as you respect the GPL. Enjoy coding :)

I'm considering : vlc-win32, vlc-win32-all (the same but with all the required dlls, so it works without vlc installation)
what about linux ?
I don't know. That's best if you can do it because I don't know everybody who has time to do it.

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: VLC - Python binding

Postby ivoire » 24 Oct 2008 20:06

And for the source, you can send a patch of your binding so we can include the binding in the vlc source tree.
The java binding is included so your binding can be included (if it's working :))

ericaro
New Cone
New Cone
Posts: 6
Joined: 23 Oct 2008 16:23

Re: VLC - Python binding

Postby ericaro » 24 Oct 2008 23:57

done.

every thing is there : http://code.google.com/p/pyvlc/

downloads, code, binaries.

Don't know how to patch using GIt (i'm already on cvs, svn, mercurial bzr ...)
but there I have change only one file : vlcwidget.py into __init__ ( source's here) http://pyvlc.googlecode.com/svn/trunk/s ... _init__.py

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

Re: VLC - Python binding

Postby OlivierAubert » 07 Nov 2008 17:59

A Debian package for vlc 0.9.0 is available at http://liris.cnrs.fr/advene/download/linux/
The API did not change in the following versions, so it works with later 0.9.x versions of VLC, modulo the #2266 / #2257 issue.

draba
Blank Cone
Blank Cone
Posts: 12
Joined: 02 Oct 2008 13:37

Re: VLC - Python binding

Postby draba » 16 Apr 2009 19:05

Hi Ericaro!

can you (or anyone else) share how managed to compiled the python bindings?
I followed the tuto but got stucked with errors... apparently the --compiler=mingw32
is ignored (damn cross-compilation :x )...
the vlc.pyd under pyvlc.googlecode.com repo is good also for the newest vlc 0.9.9??

Thanks!

wlourf
Blank Cone
Blank Cone
Posts: 12
Joined: 01 Nov 2007 19:56

Re: VLC - Python binding

Postby wlourf » 18 Apr 2009 17:22

the vlc.pyd under pyvlc.googlecode.com repo is good also for the newest vlc 0.9.9??

Thanks!
the vlc.pyd works standalone (you don't need to install vlc) , see : http://codeslash.blogspot.com/2008/10/p ... r-vlc.html

skliarie
New Cone
New Cone
Posts: 8
Joined: 18 Nov 2008 18:11

Re: VLC - Python binding

Postby skliarie » 18 May 2009 17:26

A Debian package for vlc 0.9.0 is available at http://liris.cnrs.fr/advene/download/linux/
The API did not change in the following versions, so it works with later 0.9.x versions of VLC, modulo the #2266 / #2257 issue.
I tried the package, but it gave me the following error:
$ python2.5 vlcwidget.py mpeg1.mpg
...
[00000287] main access error: no access module matched "any"
[00000285] main input error: open of `mpeg1.mpg' failed: could not create access: no access module matched "any"
$

Whereas an standalone vlc played the file fine.

You can read my attempts to build the python bindings here:
https://bugs.launchpad.net/ubuntu/+sour ... bug/247905

ov1d1u
New Cone
New Cone
Posts: 8
Joined: 20 Apr 2010 22:38

Re: VLC - Python binding

Postby ov1d1u » 20 Apr 2010 22:46

Hi everybody,
I'm using VLC bindings for Python and I have a little question to you regarding the equalizer.

I found how to activate the equalizer and set values for each band at the initializaton of MediaControl class. But there's any way to set the equalizer's value on the fly? In my known way I have to restart the sound playing to update the equalizer, wich is kinda annoying for the end user, so I would like to can change these values whitout affect the playback.

Thank you very much

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

Re: VLC - Python binding

Postby OlivierAubert » 21 Apr 2010 15:57

Hello

The python bindings merely map the libvlc API, which does not provide any means to dynamically modify the equalizer parameters. A patch was proposed sometime ago (see the http://mailman.videolan.org/pipermail/v ... 62333.html thread) to provide a generic module config API, but it was sadly not considered as appropriate...

ov1d1u
New Cone
New Cone
Posts: 8
Joined: 20 Apr 2010 22:38

Re: VLC - Python binding

Postby ov1d1u » 04 Apr 2011 10:12

Hi, everybody

I'm starting to have a problem with VLC Python bindings. As soon as I import the gtk module for Python, I get this everytime I play a media file with vlc.play() function:
../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[0x92188a4] pulse audio output error: Xlib not initialized for threads
The problem is that VLC switches to ALSA when it get this error, and I have some problems when playing media with ALSA (if I pause the media and then I un-pause it, the sound is dissapearing). How can I solve this?

Thank you in advance,
Ovidiu Nitan

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

Re: VLC - Python binding

Postby OlivierAubert » 04 Apr 2011 21:29

I have just pushed a commit that should fix this. Just append the line

Code: Select all

gtk.gdk.threads_init()
after the

Code: Select all

import gtk
line.

ov1d1u
New Cone
New Cone
Posts: 8
Joined: 20 Apr 2010 22:38

Re: VLC - Python binding

Postby ov1d1u » 04 Apr 2011 21:56

I still get the error. It's enough to re-download vlc.py to get the fix? In GIT I see that only gtkvlc was updated, and I'm getting that error even with the latest version of it.

Sorry if my question sounds silly, but I'm a newbie in this...

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

Re: VLC - Python binding

Postby OlivierAubert » 07 Apr 2011 15:18

[Note: this should be moved into another thread, not hijacking a 2-year old thread relating to an obsolete version of the python bindings]
I cannot reproduce the error, you should provide more details (OS, VLC version, etc).

ov1d1u
New Cone
New Cone
Posts: 8
Joined: 20 Apr 2010 22:38

Re: VLC - Python binding

Postby ov1d1u » 07 Apr 2011 15:24

I'm using Ubuntu 10.10, VLC 1.1.8, PulseAudio 0.9.21-63-gd3efa-dirty (tried with 0.9.22, also) and the latest vlc.py (downloaded from GIT immediately after you posted your solution). I will try in a clean environment to see if the error still occurs. Until now the only workaround I found was to play a file before importing gtk in Python


Return to “Coffee Corner”

Who is online

Users browsing this forum: No registered users and 10 guests