Old Python bindings

From VideoLAN Wiki
Revision as of 18:58, 4 December 2005 by OlivierAubert (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Python binding documentation

For a while, there has been a basic python binding for libvlc, that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developped, based on the MediaControlAPI.

python binding (see [1] for a basic code sample)

Basics

The vlc python module provides 2 main classes : MediaControl and Object.

vlc.MediaControl is an

Tips and tricks

* Snapshot support : in order to get snapshot support, you have to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :
 mc=vlc.MediaControl([ "--vout-filter", "clone" ])
 o=VLC.Object(0)
 o.config_set("clone-vout-list", "default,snapshot")
 o.config_set("snapshot-width", 320)
 o.config_set("snapshot-height", 200)

Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.