Difference between revisions of "Python bindings"

From VideoLAN Wiki
Jump to navigation Jump to search
(moved Python bindings to Old Python bindings: There are new python bindings (ctypes-based). Preserve this information for the moment, as the old bindings are still used.)
 
Line 1: Line 1:
#REDIRECT [[Old Python bindings]]
+
= Python bindings =
 +
 
 +
You can find two versions of python bindings: an old one (see [[Old Python bindings]]), hand-written C-module, and a new ones, which is ctypes-based and automatically generated.
 +
The old version of the bindings is still maintained for the moment, but the idea is to progressively migrate to the new version.
 +
 
 +
== Features ==
 +
 
 +
The new module features :
 +
* a complete cover of the libvlc/MediaControl API, since they are automatically generated from the include files.
 +
* no compilation hassle: the generated module is pure python.
 +
* no versioning hassle: the same module works with multiple VLC versions.
 +
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].
 +
 
 +
== Download ==
 +
 
 +
You can download the [http://www.advene.org/download/python-ctypes/ vlc.py] module from the [http://www.advene.org/ Advene] website. 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 [http://git.videolan.org/?p=vlc.git;a=tree;f=bindings/python-ctypes]).
 +
 
 +
== Usage ==
 +
 
 +
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line "if __name__ == '__main__').

Revision as of 14:08, 4 September 2009

Python bindings

You can find two versions of python bindings: an old one (see Old Python bindings), hand-written C-module, and a new ones, which is ctypes-based and automatically generated. The old version of the bindings is still maintained for the moment, but the idea is to progressively migrate to the new version.

Features

The new module features :

  • a complete cover of the libvlc/MediaControl API, since they are automatically generated from the include files.
  • no compilation hassle: the generated module is pure python.
  • no versioning hassle: the same module works with multiple VLC versions.
  • a complete documentation.

Download

You can download the vlc.py module from the Advene website. 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 module is also a runnable example player application (see code at the end of the module, starting from the line "if __name__ == '__main__').