Difference between revisions of "Python bindings"

From VideoLAN Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
= Python bindings =
 
= Python bindings =
 +
The bindings feature:
  
The bindings feature :
+
* Complete coverage of the libvlc API, since it is automatically generated from the include files.
* a complete cover of the libvlc API, since it is automatically generated from the include files.
+
* No compilation hassles: the generated module is pure python.
* no compilation hassle: the generated module is pure python.
+
* No versioning hassles: the same module works with multiple VLC versions.
* no versioning hassle: the same module works with multiple VLC versions.
+
* [http://www.advene.org/download/python-ctypes/doc/ Complete documentation].
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].
 
  
 
== Download ==
 
== Download ==
 
 
You can download the [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=generated;b=HEAD vlc.py] module from the Git repository. It only depends on ctypes (standard module in python >= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).
 
You can download the [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=generated;b=HEAD vlc.py] module from the Git repository. It only depends on ctypes (standard module in python >= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).
  
Line 14: Line 13:
  
 
== Usage ==
 
== Usage ==
 
 
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line "if __name__ == '__main__').  
 
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line "if __name__ == '__main__').  
  
Line 21: Line 19:
 
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=README README]
 
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=README README]
  
NOTICE : you must install VLC before use it throw Python.
+
Note: you must install VLC before use it through Python.
  
 
== Projects using this binding ==
 
== Projects using this binding ==
 
 
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]
 
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]
  
 
== FAQ ==
 
== FAQ ==
 
 
===  Win32 initialization ===  
 
===  Win32 initialization ===  
 
+
When initializing vlc.Instance() with no parameter, it tries to guess the location of the modules. However, if you pass any argument to vlc.Instance(), you will need to supply the appropriate "--plugin-path=/path/to/the/modules" yourself.
When instanciating vlc.Instance() with no parameter, it tries to guess the location of the modules. However, if you pass any argument to vlc.Instance(), you will need to supply the appropriate "--plugin-path=/path/to/the/modules" yourself.
 
  
 
==See also==
 
==See also==

Revision as of 16:48, 14 June 2014

Python bindings

The bindings feature:

  • Complete coverage of the libvlc API, since it is automatically generated from the include files.
  • No compilation hassles: the generated module is pure python.
  • No versioning hassles: the same module works with multiple VLC versions.
  • Complete documentation.

Download

You can download the vlc.py module from the Git repository. It only depends on ctypes (standard module in python >= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).

Alternatively, you can generate it by yourself using the generate.py program and accompanying files in the vlc source tree (see [1]).

Usage

The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line "if __name__ == '__main__').

A set of helper examples examples provide a pyGtk, a pyQt and a pyWx player to ease integration.

There is also a README

Note: you must install VLC before use it through Python.

Projects using this binding

http://code.google.com/p/movie-content-editor/ See also LibVLC_Users

FAQ

Win32 initialization

When initializing vlc.Instance() with no parameter, it tries to guess the location of the modules. However, if you pass any argument to vlc.Instance(), you will need to supply the appropriate "--plugin-path=/path/to/the/modules" yourself.

See also

  • Old Python bindings - The old, obsolete python bindings that are no longer used and since then removed. Kept only for historical interest.