<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OlivierAubert</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OlivierAubert"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/OlivierAubert/"/>
	<updated>2026-11-05T01:09:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=61750</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=61750"/>
		<updated>2019-06-28T06:41:30Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python bindings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Python bindings ==&lt;br /&gt;
The bindings feature:&lt;br /&gt;
&lt;br /&gt;
* Complete coverage of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* No compilation hassles: the generated module is pure python.&lt;br /&gt;
* [https://www.olivieraubert.net/vlc/python-ctypes/doc/ API documentation].&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
The preferred install method is through PyPI:&lt;br /&gt;
&lt;br /&gt;
 pip install python-vlc&lt;br /&gt;
&lt;br /&gt;
or (if you are using python3):&lt;br /&gt;
&lt;br /&gt;
 pip3 install python-vlc&lt;br /&gt;
&lt;br /&gt;
You can also download the [https://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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can generate it by yourself using the generate.py program and accompanying files in the vlc source tree (see [https://git.videolan.org/?p=vlc/bindings/python.git;a=tree]).&lt;br /&gt;
&lt;br /&gt;
Note that this only installs the python module itself, which depends on the availability of the libvlc libraries. You must also install VLC itself to get these libraries.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line &amp;lt;code&amp;gt;if __name__ == &#039;__main__&#039;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
A set of helper examples [https://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD examples] provide a pyGtk, a pyQt and a pyWx player to ease integration.&lt;br /&gt;
&lt;br /&gt;
There is also a [https://git.videolan.org/?p=vlc/bindings/python.git;a=blob_plain;f=README.rst README]&lt;br /&gt;
&lt;br /&gt;
Note: you must install VLC before using it through Python.&lt;br /&gt;
&lt;br /&gt;
=== Projects using this binding ===&lt;br /&gt;
https://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]&lt;br /&gt;
&lt;br /&gt;
=== FAQ ===&lt;br /&gt;
====  Win32 initialization ====&lt;br /&gt;
When initializing &amp;lt;code&amp;gt;vlc.Instance()&amp;lt;/code&amp;gt; with no parameter, it tries to guess the location of the modules. However, if you pass any argument to &amp;lt;code&amp;gt;vlc.Instance()&amp;lt;/code&amp;gt;, you will need to supply the appropriate &amp;lt;kbd&amp;gt;--plugin-path=/path/to/the/modules&amp;lt;/kbd&amp;gt; yourself.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Old Python bindings]] - The old, obsolete python bindings that are no longer used and since then removed. Kept only for historical interest.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=56948</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=56948"/>
		<updated>2019-01-24T18:56:44Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
The bindings feature:&lt;br /&gt;
&lt;br /&gt;
* Complete coverage of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* No compilation hassles: the generated module is pure python.&lt;br /&gt;
* No versioning hassles: the same module works with multiple VLC versions.&lt;br /&gt;
* [https://www.olivieraubert.net/vlc/python-ctypes/doc/ API documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
The preferred install method is through PyPI:&lt;br /&gt;
&lt;br /&gt;
 pip install python-vlc&lt;br /&gt;
&lt;br /&gt;
or (if you are using python3):&lt;br /&gt;
&lt;br /&gt;
 pip3 install python-vlc&lt;br /&gt;
&lt;br /&gt;
You can also 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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=tree]).&lt;br /&gt;
&lt;br /&gt;
Note that this only installs the python module itself, which depends on the availability of the libvlc libraries. You must also install VLC itself to get these libraries.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). &lt;br /&gt;
&lt;br /&gt;
A set of helper examples [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD examples] provide a pyGtk, a pyQt and a pyWx player to ease integration.&lt;br /&gt;
&lt;br /&gt;
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob_plain;f=README.rst README]&lt;br /&gt;
&lt;br /&gt;
Note: you must install VLC before using it through Python.&lt;br /&gt;
&lt;br /&gt;
== Projects using this binding ==&lt;br /&gt;
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
===  Win32 initialization === &lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Old Python bindings]] - The old, obsolete python bindings that are no longer used and since then removed. Kept only for historical interest.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=56947</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=56947"/>
		<updated>2019-01-24T18:56:11Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
The bindings feature:&lt;br /&gt;
&lt;br /&gt;
* Complete coverage of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* No compilation hassles: the generated module is pure python.&lt;br /&gt;
* No versioning hassles: the same module works with multiple VLC versions.&lt;br /&gt;
* [https://www.olivieraubert.net/vlc/python-ctypes/doc/ API documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
The preferred install method is through PyPI:&lt;br /&gt;
&lt;br /&gt;
 pip install python-vlc&lt;br /&gt;
&lt;br /&gt;
or (if you are using python3):&lt;br /&gt;
&lt;br /&gt;
 pip3 install python-vlc&lt;br /&gt;
&lt;br /&gt;
You can also 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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=tree]).&lt;br /&gt;
&lt;br /&gt;
Note that this only installs the python module itself, which depends on the availability of the libvlc libraries. You must also install VLC itself to get these libraries.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). &lt;br /&gt;
&lt;br /&gt;
A set of helper examples [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD examples] provide a pyGtk, a pyQt and a pyWx player to ease integration.&lt;br /&gt;
&lt;br /&gt;
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob_raw;f=README.rst README]&lt;br /&gt;
&lt;br /&gt;
Note: you must install VLC before using it through Python.&lt;br /&gt;
&lt;br /&gt;
== Projects using this binding ==&lt;br /&gt;
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
===  Win32 initialization === &lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Old Python bindings]] - The old, obsolete python bindings that are no longer used and since then removed. Kept only for historical interest.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=56480</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=56480"/>
		<updated>2018-10-24T08:30:52Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Download */ Add PyPI ref&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
The bindings feature:&lt;br /&gt;
&lt;br /&gt;
* Complete coverage of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* No compilation hassles: the generated module is pure python.&lt;br /&gt;
* No versioning hassles: the same module works with multiple VLC versions.&lt;br /&gt;
* [https://www.olivieraubert.net/vlc/python-ctypes/doc/ API documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
The preferred install method is through PyPI:&lt;br /&gt;
&lt;br /&gt;
 pip install python-vlc&lt;br /&gt;
&lt;br /&gt;
or (if you are using python3):&lt;br /&gt;
&lt;br /&gt;
 pip3 install python-vlc&lt;br /&gt;
&lt;br /&gt;
You can also 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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=tree]).&lt;br /&gt;
&lt;br /&gt;
Note that this only installs the python module itself, which depends on the availability of the libvlc libraries. You must also install VLC itself to get these libraries.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). &lt;br /&gt;
&lt;br /&gt;
A set of helper examples [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD examples] provide a pyGtk, a pyQt and a pyWx player to ease integration.&lt;br /&gt;
&lt;br /&gt;
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=README README]&lt;br /&gt;
&lt;br /&gt;
Note: you must install VLC before using it through Python.&lt;br /&gt;
&lt;br /&gt;
== Projects using this binding ==&lt;br /&gt;
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
===  Win32 initialization === &lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Old Python bindings]] - The old, obsolete python bindings that are no longer used and since then removed. Kept only for historical interest.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Video_Output&amp;diff=31102</id>
		<title>Video Output</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Video_Output&amp;diff=31102"/>
		<updated>2016-04-19T16:24:32Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* snapshot */ Remove obsolete info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VideoLAN comes with a selection of Video Output modules. These can display output on almost any computer.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want any video, you can use the &#039;&#039;&#039;--no-video&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Output Modules ==&lt;br /&gt;
&lt;br /&gt;
To select one of these modules, use the &#039;&#039;&#039;-V&#039;&#039;&#039; (&#039;&#039;&#039;--vout&#039;&#039;&#039;) command line option, eg:&lt;br /&gt;
 vlc my.avi -V caca&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== image ===&lt;br /&gt;
Save all the frames of a video as a sequence of images. You can select the output format using &#039;&#039;&#039;--image-out-format&#039;&#039;&#039; (currently you can only choose png), and the start of the file name with &#039;&#039;&#039;--image-out-prefix&#039;&#039;&#039;. Finally, to create an image once out of a number of frames, give that number to &#039;&#039;&#039;--image-out-ratio&#039;&#039;&#039;. For example,&lt;br /&gt;
 vlc [[v4l]]:// --image-out-prefix=webcam --image-out-ratio=20&lt;br /&gt;
will create a series of images named&lt;br /&gt;
 webcam000001.png&lt;br /&gt;
 webcam000002.png&lt;br /&gt;
 webcam000003.png&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== aa, caca ===&lt;br /&gt;
ASCII Art modules. &#039;&#039;&#039;aa&#039;&#039;&#039; displays output in black and white, &#039;&#039;&#039;caca&#039;&#039;&#039; in colour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== x11 ===&lt;br /&gt;
Use Linux&#039;s X11 video output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== xvideo ===&lt;br /&gt;
XVideo extension video output, a more advanced form of X11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== glx, opengl ===&lt;br /&gt;
Use OpenGL video output&lt;br /&gt;
&lt;br /&gt;
=== dummy ===&lt;br /&gt;
Don&#039;t show output&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
== Cloning ==&lt;br /&gt;
&lt;br /&gt;
To display output in more than one window, video cloning can be used. To use this, specify&lt;br /&gt;
 --vout-filter=clone&lt;br /&gt;
on the [[command prompt|command line]]: this tells vlc to use cloning. You also need to tell vlc what output modules you want with, for example,&lt;br /&gt;
 --clone-vout-filter=&#039;&#039;caca,glx&#039;&#039;&lt;br /&gt;
 --clone-count=&#039;&#039;2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Changing video output ==&lt;br /&gt;
If you wish to change your video output module without using the command line, here&#039;s how to proceed:&lt;br /&gt;
=== Qt Interface ===&lt;br /&gt;
* Go to tools -&amp;gt; preferences (or press Ctrl+P)&lt;br /&gt;
* Select the Video tab&lt;br /&gt;
* Select another video output module by changing the &amp;quot;Output&amp;quot; combo-box&lt;br /&gt;
* Stop any playback&lt;br /&gt;
* Launch the playback again&lt;br /&gt;
=== Macosx Interface ===&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=27751</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=27751"/>
		<updated>2015-01-20T14:10:09Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python bindings */ Update API doc URL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
The bindings feature:&lt;br /&gt;
&lt;br /&gt;
* Complete coverage of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* No compilation hassles: the generated module is pure python.&lt;br /&gt;
* No versioning hassles: the same module works with multiple VLC versions.&lt;br /&gt;
* [https://www.olivieraubert.net/vlc/python-ctypes/doc/ API documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=tree]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). &lt;br /&gt;
&lt;br /&gt;
A set of helper examples [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD examples] provide a pyGtk, a pyQt and a pyWx player to ease integration.&lt;br /&gt;
&lt;br /&gt;
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=README README]&lt;br /&gt;
&lt;br /&gt;
Note: you must install VLC before using it through Python.&lt;br /&gt;
&lt;br /&gt;
== Projects using this binding ==&lt;br /&gt;
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
===  Win32 initialization === &lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Old Python bindings]] - The old, obsolete python bindings that are no longer used and since then removed. Kept only for historical interest.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=27214</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=27214"/>
		<updated>2014-09-22T11:29:40Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
The bindings feature:&lt;br /&gt;
&lt;br /&gt;
* Complete coverage of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* No compilation hassles: the generated module is pure python.&lt;br /&gt;
* No versioning hassles: the same module works with multiple VLC versions.&lt;br /&gt;
* [http://www.advene.org/download/python-ctypes/doc/ Complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=tree]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). &lt;br /&gt;
&lt;br /&gt;
A set of helper examples [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD examples] provide a pyGtk, a pyQt and a pyWx player to ease integration.&lt;br /&gt;
&lt;br /&gt;
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=README README]&lt;br /&gt;
&lt;br /&gt;
Note: you must install VLC before using it through Python.&lt;br /&gt;
&lt;br /&gt;
== Projects using this binding ==&lt;br /&gt;
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
===  Win32 initialization === &lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Old Python bindings]] - The old, obsolete python bindings that are no longer used and since then removed. Kept only for historical interest.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=22680</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=22680"/>
		<updated>2012-06-04T09:05:15Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python bindings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
The bindings feature :&lt;br /&gt;
* a complete cover of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=tree]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py file also contains a runnable example player application (see code at the end of the file, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). &lt;br /&gt;
&lt;br /&gt;
A set of helper examples [http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD examples] provide a pyGtk, a pyQt and a pyWx player to ease integration.&lt;br /&gt;
&lt;br /&gt;
There is also a [http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=README README]&lt;br /&gt;
&lt;br /&gt;
== Projects using this binding ==&lt;br /&gt;
&lt;br /&gt;
http://code.google.com/p/movie-content-editor/ See also [[LibVLC_Users]]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
===  Win32 initialization === &lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=22679</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=22679"/>
		<updated>2012-06-04T09:02:48Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OUTDATED INFORMATION ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl  API has been removed from VLC since 2010.&lt;br /&gt;
&lt;br /&gt;
== Description  ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It is implemented in VLC by using the new [[LibVLC]] API, and both APIs can cooperate (i.e. you can instanciate a MediaControl object from an existing libvlc instance, and vice-versa). &lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work. &lt;br /&gt;
&lt;br /&gt;
FIXME&amp;amp;nbsp;: The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in [http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;]. &lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://www.videolan.org/developers/vlc/doc/doxygen/html/mediacontrol_8h.html]. &lt;br /&gt;
&lt;br /&gt;
== Current status  ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things: &lt;br /&gt;
&lt;br /&gt;
*Playback &lt;br /&gt;
**Basic features (play/pause/stop) &lt;br /&gt;
**Seeking &lt;br /&gt;
**Setting/getting the played media &lt;br /&gt;
**Getting stream information&lt;br /&gt;
*Audio/Video &lt;br /&gt;
**Snapshot control (on the fly only) &lt;br /&gt;
**OSD display (of text and SVG graphics through the svg rendering module) &lt;br /&gt;
**Volume setting &lt;br /&gt;
**Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses  ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules&amp;amp;nbsp;: &lt;br /&gt;
&lt;br /&gt;
*the [[PythonBinding]] &lt;br /&gt;
*the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions  ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs&amp;amp;nbsp;: &lt;br /&gt;
&lt;br /&gt;
*sound_[sg]et_volume: normalize volume in [0..100] &lt;br /&gt;
*implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc) &lt;br /&gt;
*Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately). &lt;br /&gt;
*Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Current API  ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the current version of MediaControlAPI (from git rev. 445d63e0e38053, on 20080423). In case of doubt, refer to the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file]. &lt;br /&gt;
&amp;lt;pre&amp;gt;/*&lt;br /&gt;
  Module inspired by the MediaControl IDL&lt;br /&gt;
 */&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 0.2;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, RelativePosition, ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    ByteCount, SampleCount, MediaTime&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  exception PositionKeyNotSupported { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition         { string message; };&lt;br /&gt;
  exception InternalException       { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;amp;lt;octet&amp;amp;gt; ByteSeq;&lt;br /&gt;
  &lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  typedef sequence&amp;amp;lt;RGBPicture&amp;amp;gt; RGBPictureSeq;&lt;br /&gt;
  &lt;br /&gt;
  /* Cf stream_control.h */&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
  &lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;        /* The URL of the current media stream */&lt;br /&gt;
    long mux_rate;     /* the rate we read the stream in bytes/s */    &lt;br /&gt;
    long long position;     /* actual location in the area (in arbitrary units) */&lt;br /&gt;
    long long size;         /* total size of the area (in arbitrary units) */&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
   // MediaControl interface is similar to&lt;br /&gt;
   // ControlledStream interface in MSS.&lt;br /&gt;
   // It can be inherited by flow endpoints or&lt;br /&gt;
   // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
    &lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
     &lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    oneway void exit (); // Exits the player (not in the original spec)&lt;br /&gt;
&lt;br /&gt;
    // Set/get the current media file/URL&lt;br /&gt;
    void set_mrl (in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    string get_mrl ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Returns a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Displays the message string, between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void display_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
    &lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlIDL&amp;diff=22678</id>
		<title>MediaControlIDL</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlIDL&amp;diff=22678"/>
		<updated>2012-06-04T09:01:18Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: Replaced content with &amp;quot;The MediaControl IDL API has been removed since 2010. Use the Libvlc API instead.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The MediaControl IDL API has been removed since 2010. Use the [[Libvlc]] API instead.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16023</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16023"/>
		<updated>2010-05-07T14:07:58Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Win32 initalization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
You can find two versions of python bindings: an old one (see [[Old Python bindings]]), hand-written C-module, and a new one, which is ctypes-based and automatically generated.&lt;br /&gt;
The old version of the bindings is now deprecated and will be removed in some future version.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new module features :&lt;br /&gt;
* a complete cover of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=summary]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). A helper module [http://git.videolan.org/?p=vlc.git;a=blob;f=bindings/python-ctypes/vlcwidget.py;hb=HEAD vlcwidget.py] provides a pygtk VLCWidget() to ease integration.&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
===  Win32 initialization === &lt;br /&gt;
&lt;br /&gt;
If the vlc modules are not installed in their standard location (e.g. c:\\Program Files\\Videolan on Windows, or /usr/lib/vlc on linux), the VLC module cannot find them.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16022</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16022"/>
		<updated>2010-05-07T14:07:47Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
You can find two versions of python bindings: an old one (see [[Old Python bindings]]), hand-written C-module, and a new one, which is ctypes-based and automatically generated.&lt;br /&gt;
The old version of the bindings is now deprecated and will be removed in some future version.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new module features :&lt;br /&gt;
* a complete cover of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=summary]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). A helper module [http://git.videolan.org/?p=vlc.git;a=blob;f=bindings/python-ctypes/vlcwidget.py;hb=HEAD vlcwidget.py] provides a pygtk VLCWidget() to ease integration.&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
===  Win32 initalization === &lt;br /&gt;
&lt;br /&gt;
If the vlc modules are not installed in their standard location (e.g. c:\\Program Files\\Videolan on Windows, or /usr/lib/vlc on linux), the VLC module cannot find them.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;--plugin-path=/path/to/the/modules&amp;quot; yourself.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16021</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16021"/>
		<updated>2010-05-07T13:51:39Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
You can find two versions of python bindings: an old one (see [[Old Python bindings]]), hand-written C-module, and a new one, which is ctypes-based and automatically generated.&lt;br /&gt;
The old version of the bindings is now deprecated and will be removed in some future version.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new module features :&lt;br /&gt;
* a complete cover of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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/bindings/python.git;a=summary]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). A helper module [http://git.videolan.org/?p=vlc.git;a=blob;f=bindings/python-ctypes/vlcwidget.py;hb=HEAD vlcwidget.py] provides a pygtk VLCWidget() to ease integration.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16020</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=16020"/>
		<updated>2010-05-07T13:46:49Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
You can find two versions of python bindings: an old one (see [[Old Python bindings]]), hand-written C-module, and a new one, which is ctypes-based and automatically generated.&lt;br /&gt;
The old version of the bindings is now deprecated and will be removed in some future version.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new module features :&lt;br /&gt;
* a complete cover of the libvlc API, since it is automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). A helper module [http://git.videolan.org/?p=vlc.git;a=blob;f=bindings/python-ctypes/vlcwidget.py;hb=HEAD vlcwidget.py] provides a pygtk VLCWidget() to ease integration.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=15048</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=15048"/>
		<updated>2009-12-08T14:51:40Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python bindings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
You can find two versions of python bindings: an old one (see [[Old Python bindings]]), hand-written C-module, and a new one, which is ctypes-based and automatically generated.&lt;br /&gt;
The old version of the bindings is now deprecated and will be removed in some future version.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new module features :&lt;br /&gt;
* a complete cover of the libvlc/MediaControl API, since it is automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). A helper module [http://git.videolan.org/?p=vlc.git;a=tree;f=bindings/python-ctypes/vlcwidget.py] provides a pygtk VLCWidget() to ease integration.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=14697</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=14697"/>
		<updated>2009-09-04T14:39:00Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python bindings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
You can find two versions of python bindings: an old one (see [[Old Python bindings]]), hand-written C-module, and a new one, which is ctypes-based and automatically generated.&lt;br /&gt;
The old version of the bindings is still maintained for the moment, but the idea is to progressively migrate to the new version.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new module features :&lt;br /&gt;
* a complete cover of the libvlc/MediaControl API, since it is automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;). A helper module [http://git.videolan.org/?p=vlc.git;a=tree;f=bindings/python-ctypes/vlcwidget.py] provides a pygtk VLCWidget() to ease integration.&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14696</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14696"/>
		<updated>2009-09-04T14:35:39Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python binding documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: this version of python bindings (compiled C-module) is deprecated in favor of the new [[PythonBinding]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The old version of python bindings, which can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;, is a python C-based module. Sources are browsable from [http://trac.videolan.org/vlc/browser/bindings/python python binding] and a code sample can be found in the sources (file [http://trac.videolan.org/vlc/browser/bindings/python/vlcwidget.py vlcwidget.py]).&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Compile HOWTO =&lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
== Linux/Debian ==&lt;br /&gt;
&lt;br /&gt;
On Debian:&lt;br /&gt;
* install the libvlc2-dev package&lt;br /&gt;
* Get the python bindings sources from the Git repository : &lt;br /&gt;
* in the python directory, launch&lt;br /&gt;
  python setup.py build&lt;br /&gt;
The module will be built in &lt;br /&gt;
build/lib.linux-i686-2.5&lt;br /&gt;
* install the module through (as root)&lt;br /&gt;
  python setup.py install&lt;br /&gt;
or simply copy the vlc.so file to some appropriate directory.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
* Get and install a nighty-built package from http://nightlies.videolan.org/build/windows/&lt;br /&gt;
* Get and extract the corresponding sources from http://nightlies.videolan.org/build/source/&lt;br /&gt;
* Create a .libs subdirectory in vlc/src&lt;br /&gt;
* Copy the libvlc.dll file from c:\Program Files\VideoLAN\VLC into src/.libs&lt;br /&gt;
* Go into the vlc/bindings/python directory and run&lt;br /&gt;
  python setup.py build --compiler=mingw32&lt;br /&gt;
You should get a vlc.pyd (or vlc.dll) file in the build/ subdirectory.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl(&amp;quot;--vout-filter clone --clone-vout-list default,snapshot --snapshot-width 320 --snapshot-height 200&amp;quot;.split())&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14695</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14695"/>
		<updated>2009-09-04T14:34:47Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python binding documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: this version of python bindings (compiled C-module) is deprecated in favor of the new [[Python Binding]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The old version of python bindings, which can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;, is a python C-based module. Sources are browsable from [http://trac.videolan.org/vlc/browser/bindings/python python binding] and a code sample can be found in the sources (file [http://trac.videolan.org/vlc/browser/bindings/python/vlcwidget.py vlcwidget.py]).&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Compile HOWTO =&lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
== Linux/Debian ==&lt;br /&gt;
&lt;br /&gt;
On Debian:&lt;br /&gt;
* install the libvlc2-dev package&lt;br /&gt;
* Get the python bindings sources from the Git repository : &lt;br /&gt;
* in the python directory, launch&lt;br /&gt;
  python setup.py build&lt;br /&gt;
The module will be built in &lt;br /&gt;
build/lib.linux-i686-2.5&lt;br /&gt;
* install the module through (as root)&lt;br /&gt;
  python setup.py install&lt;br /&gt;
or simply copy the vlc.so file to some appropriate directory.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
* Get and install a nighty-built package from http://nightlies.videolan.org/build/windows/&lt;br /&gt;
* Get and extract the corresponding sources from http://nightlies.videolan.org/build/source/&lt;br /&gt;
* Create a .libs subdirectory in vlc/src&lt;br /&gt;
* Copy the libvlc.dll file from c:\Program Files\VideoLAN\VLC into src/.libs&lt;br /&gt;
* Go into the vlc/bindings/python directory and run&lt;br /&gt;
  python setup.py build --compiler=mingw32&lt;br /&gt;
You should get a vlc.pyd (or vlc.dll) file in the build/ subdirectory.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl(&amp;quot;--vout-filter clone --clone-vout-list default,snapshot --snapshot-width 320 --snapshot-height 200&amp;quot;.split())&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=14694</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=14694"/>
		<updated>2009-09-04T14:08:33Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python bindings =&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
The old version of the bindings is still maintained for the moment, but the idea is to progressively migrate to the new version.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new module features :&lt;br /&gt;
* a complete cover of the libvlc/MediaControl API, since they are automatically generated from the include files.&lt;br /&gt;
* no compilation hassle: the generated module is pure python.&lt;br /&gt;
* no versioning hassle: the same module works with multiple VLC versions.&lt;br /&gt;
* a [http://www.advene.org/download/python-ctypes/doc/ complete documentation].&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;gt;= 2.5). Put the module in some place accessible by python (either next to your application, or in a directory from sys.path).&lt;br /&gt;
&lt;br /&gt;
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]).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
The vlc.py module is also a runnable example player application (see code at the end of the module, starting from the line &amp;quot;if __name__ == &#039;__main__&#039;).&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=14693</id>
		<title>Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Python_bindings&amp;diff=14693"/>
		<updated>2009-09-04T13:57:25Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: moved Python bindings to Old Python bindings:&amp;amp;#32;There are new python bindings (ctypes-based). Preserve this information for the moment, as the old bindings are still used.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Old Python bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14692</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14692"/>
		<updated>2009-09-04T13:57:25Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: moved Python bindings to Old Python bindings:&amp;amp;#32;There are new python bindings (ctypes-based). Preserve this information for the moment, as the old bindings are still used.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/bindings/python python binding] and a code sample can be found in the sources (file [http://trac.videolan.org/vlc/browser/bindings/python/vlcwidget.py vlcwidget.py]).&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Compile HOWTO =&lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
== Linux/Debian ==&lt;br /&gt;
&lt;br /&gt;
On Debian:&lt;br /&gt;
* install the libvlc2-dev package&lt;br /&gt;
* Get the python bindings sources from the Git repository : &lt;br /&gt;
* in the python directory, launch&lt;br /&gt;
  python setup.py build&lt;br /&gt;
The module will be built in &lt;br /&gt;
build/lib.linux-i686-2.5&lt;br /&gt;
* install the module through (as root)&lt;br /&gt;
  python setup.py install&lt;br /&gt;
or simply copy the vlc.so file to some appropriate directory.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
* Get and install a nighty-built package from http://nightlies.videolan.org/build/windows/&lt;br /&gt;
* Get and extract the corresponding sources from http://nightlies.videolan.org/build/source/&lt;br /&gt;
* Create a .libs subdirectory in vlc/src&lt;br /&gt;
* Copy the libvlc.dll file from c:\Program Files\VideoLAN\VLC into src/.libs&lt;br /&gt;
* Go into the vlc/bindings/python directory and run&lt;br /&gt;
  python setup.py build --compiler=mingw32&lt;br /&gt;
You should get a vlc.pyd (or vlc.dll) file in the build/ subdirectory.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl(&amp;quot;--vout-filter clone --clone-vout-list default,snapshot --snapshot-width 320 --snapshot-height 200&amp;quot;.split())&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14521</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=14521"/>
		<updated>2009-07-20T09:42:30Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Snapshot support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/bindings/python python binding] and a code sample can be found in the sources (file [http://trac.videolan.org/vlc/browser/bindings/python/vlcwidget.py vlcwidget.py]).&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Compile HOWTO =&lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
== Linux/Debian ==&lt;br /&gt;
&lt;br /&gt;
On Debian:&lt;br /&gt;
* install the libvlc2-dev package&lt;br /&gt;
* Get the python bindings sources from the Git repository : &lt;br /&gt;
* in the python directory, launch&lt;br /&gt;
  python setup.py build&lt;br /&gt;
The module will be built in &lt;br /&gt;
build/lib.linux-i686-2.5&lt;br /&gt;
* install the module through (as root)&lt;br /&gt;
  python setup.py install&lt;br /&gt;
or simply copy the vlc.so file to some appropriate directory.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
* Get and install a nighty-built package from http://nightlies.videolan.org/build/windows/&lt;br /&gt;
* Get and extract the corresponding sources from http://nightlies.videolan.org/build/source/&lt;br /&gt;
* Create a .libs subdirectory in vlc/src&lt;br /&gt;
* Copy the libvlc.dll file from c:\Program Files\VideoLAN\VLC into src/.libs&lt;br /&gt;
* Go into the vlc/bindings/python directory and run&lt;br /&gt;
  python setup.py build --compiler=mingw32&lt;br /&gt;
You should get a vlc.pyd (or vlc.dll) file in the build/ subdirectory.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl(&amp;quot;--vout-filter clone --clone-vout-list default,snapshot --snapshot-width 320 --snapshot-height 200&amp;quot;.split())&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12071</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12071"/>
		<updated>2008-07-07T12:42:53Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Linux/Debian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/bindings/python python binding] and a code sample can be found in the sources (file [http://trac.videolan.org/vlc/browser/bindings/python/vlcwidget.py vlcwidget.py]).&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Compile HOWTO =&lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
== Linux/Debian ==&lt;br /&gt;
&lt;br /&gt;
On Debian:&lt;br /&gt;
* install the libvlc2-dev package&lt;br /&gt;
* Get the python bindings sources from the Git repository : &lt;br /&gt;
* in the python directory, launch&lt;br /&gt;
  python setup.py build&lt;br /&gt;
The module will be built in &lt;br /&gt;
build/lib.linux-i686-2.5&lt;br /&gt;
* install the module through (as root)&lt;br /&gt;
  python setup.py install&lt;br /&gt;
or simply copy the vlc.so file to some appropriate directory.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
* Get and install a nighty-built package from http://nightlies.videolan.org/build/windows/&lt;br /&gt;
* Get and extract the corresponding sources from http://nightlies.videolan.org/build/source/&lt;br /&gt;
* Create a .libs subdirectory in vlc/src&lt;br /&gt;
* Copy the libvlc.dll file from c:\Program Files\VideoLAN\VLC into src/.libs&lt;br /&gt;
* Go into the vlc/bindings/python directory and run&lt;br /&gt;
  python setup.py build --compiler=mingw32&lt;br /&gt;
You should get a vlc.pyd (or vlc.dll) file in the build/ subdirectory.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12069</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12069"/>
		<updated>2008-07-07T12:19:37Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python binding documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/bindings/python python binding] and a code sample can be found in the sources (file [http://trac.videolan.org/vlc/browser/bindings/python/vlcwidget.py vlcwidget.py]).&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Compile HOWTO =&lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
== Linux/Debian ==&lt;br /&gt;
&lt;br /&gt;
On Debian:&lt;br /&gt;
* install the libvlc2-dev package&lt;br /&gt;
* Get the python bindings sources from the Git repository : &lt;br /&gt;
* in the python directory, launch&lt;br /&gt;
  python setup.py build&lt;br /&gt;
The module will be built in &lt;br /&gt;
build/lib.linux-i686-2.5&lt;br /&gt;
* install the module through (as root)&lt;br /&gt;
  python setup.py install&lt;br /&gt;
or simply copy the vlc.so file to some appropriate directory.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12068</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12068"/>
		<updated>2008-07-07T12:04:23Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python binding documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  &lt;br /&gt;
&lt;br /&gt;
= Compile HOWTO =&lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
== Linux/Debian ==&lt;br /&gt;
&lt;br /&gt;
On Debian:&lt;br /&gt;
* install the libvlc2-dev package&lt;br /&gt;
* Get the python bindings sources from the Git repository : &lt;br /&gt;
* in the python directory, launch&lt;br /&gt;
  python setup.py build&lt;br /&gt;
The module will be built in &lt;br /&gt;
build/lib.linux-i686-2.5&lt;br /&gt;
* install the module through (as root)&lt;br /&gt;
  python setup.py install&lt;br /&gt;
or simply copy the vlc.so file to some appropriate directory.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12013</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12013"/>
		<updated>2008-06-30T19:17:56Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  &lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Instance&#039;&#039;&#039;, &#039;&#039;&#039;vlc.MediaPlayer&#039;&#039;&#039; and &#039;&#039;&#039;vlc.Media&#039;&#039;&#039; match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12012</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12012"/>
		<updated>2008-06-30T19:17:11Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  &lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
vlc.Instance, vlc.MediaPlayer and vlc.Media match the new [[ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12011</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12011"/>
		<updated>2008-06-30T19:16:51Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  &lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 4 main classes : MediaControl, Instance, MediaPlayer and Media.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]]. Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
vlc.Instance, vlc.MediaPlayer and vlc.Media match the new [[http://wiki.videolan.org/ExternalAPI|LibVLC API]]. Refer (for now) to the docstrings provided by the python objects to get their usage.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12010</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=12010"/>
		<updated>2008-06-30T19:12:50Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python binding documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  &lt;br /&gt;
&lt;br /&gt;
Only for &amp;lt; 0.9.0 versions: If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 0.9.0 versions, python bindings cannot be compiled at the same time as the main VLC tree. They can (and event must) be compiled from a compiled VLC, provided that appropriate headers and libraries (libvlc.so/.dll) are available.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
Note: as of 0.9.0pre (still in svn), the vlc.Object binding has been moved to its own module called vlcinternal, and it &#039;&#039;&#039;must&#039;&#039;&#039; be built from a vlc tree, since it provides access to internal features of vlc. The vlc module holds the vlc.MediaControl object as well as bindings to the new libvlc API (vlc.Instance, vlc.Input), and can be built outside of the vlc tree, provided that the appropriate headers and libraries are present.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11492</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11492"/>
		<updated>2008-05-06T11:32:49Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* API evolution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It is implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]], and both APIs can cooperate (i.e. you can instanciate a MediaControl object from an existing libvlc instance, and vice-versa).&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://www.videolan.org/developers/vlc/doc/doxygen/html/mediacontrol_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Setting/getting the played media&lt;br /&gt;
** Getting stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (on the fly only)&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Current API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the current version of MediaControlAPI (from git rev. 445d63e0e38053, on 20080423). In case of doubt, refer to the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  Module inspired by the MediaControl IDL&lt;br /&gt;
 */&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 0.2;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, RelativePosition, ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    ByteCount, SampleCount, MediaTime&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  exception PositionKeyNotSupported { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition         { string message; };&lt;br /&gt;
  exception InternalException       { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
  &lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
  &lt;br /&gt;
  /* Cf stream_control.h */&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
  &lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;        /* The URL of the current media stream */&lt;br /&gt;
    long mux_rate;     /* the rate we read the stream in bytes/s */    &lt;br /&gt;
    long long position;     /* actual location in the area (in arbitrary units) */&lt;br /&gt;
    long long size;         /* total size of the area (in arbitrary units) */&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
   // MediaControl interface is similar to&lt;br /&gt;
   // ControlledStream interface in MSS.&lt;br /&gt;
   // It can be inherited by flow endpoints or&lt;br /&gt;
   // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
    &lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
     &lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    oneway void exit (); // Exits the player (not in the original spec)&lt;br /&gt;
&lt;br /&gt;
    // Set/get the current media file/URL&lt;br /&gt;
    void set_mrl (in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    string get_mrl ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Returns a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Displays the message string, between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void display_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
    &lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11491</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11491"/>
		<updated>2008-05-06T11:32:24Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Current API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It is implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]], and both APIs can cooperate (i.e. you can instanciate a MediaControl object from an existing libvlc instance, and vice-versa).&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://www.videolan.org/developers/vlc/doc/doxygen/html/mediacontrol_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Setting/getting the played media&lt;br /&gt;
** Getting stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (on the fly only)&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Current API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the current version of MediaControlAPI (from git rev. 445d63e0e38053, on 20080423). In case of doubt, refer to the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  Module inspired by the MediaControl IDL&lt;br /&gt;
 */&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 0.2;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, RelativePosition, ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    ByteCount, SampleCount, MediaTime&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  exception PositionKeyNotSupported { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition         { string message; };&lt;br /&gt;
  exception InternalException       { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
  &lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
  &lt;br /&gt;
  /* Cf stream_control.h */&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
  &lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;        /* The URL of the current media stream */&lt;br /&gt;
    long mux_rate;     /* the rate we read the stream in bytes/s */    &lt;br /&gt;
    long long position;     /* actual location in the area (in arbitrary units) */&lt;br /&gt;
    long long size;         /* total size of the area (in arbitrary units) */&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
   // MediaControl interface is similar to&lt;br /&gt;
   // ControlledStream interface in MSS.&lt;br /&gt;
   // It can be inherited by flow endpoints or&lt;br /&gt;
   // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
    &lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
     &lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    oneway void exit (); // Exits the player (not in the original spec)&lt;br /&gt;
&lt;br /&gt;
    // Set/get the current media file/URL&lt;br /&gt;
    void set_mrl (in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    string get_mrl ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Returns a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Displays the message string, between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void display_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
    &lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== API evolution ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Libraries]] [[Category:VideoLAN projects]] [[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11490</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11490"/>
		<updated>2008-05-06T11:29:42Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Current status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It is implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]], and both APIs can cooperate (i.e. you can instanciate a MediaControl object from an existing libvlc instance, and vice-versa).&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://www.videolan.org/developers/vlc/doc/doxygen/html/mediacontrol_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Setting/getting the played media&lt;br /&gt;
** Getting stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (on the fly only)&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Current API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the current version of MediaControlAPI. In case of doubt, refer to the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  Module inspired by the MediaControl IDL&lt;br /&gt;
 */&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 0.1;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, RelativePosition, ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    ByteCount, SampleCount, MediaTime&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  exception PositionKeyNotSupported { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition         { string message; };&lt;br /&gt;
  exception PlaylistException       { string message; };&lt;br /&gt;
  exception InternalException       { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq; &lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
  &lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
  &lt;br /&gt;
  /* Cf stream_control.h */&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
  &lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;        /* The URL of the current media stream */&lt;br /&gt;
    long mux_rate;     /* the rate we read the stream in bytes/s */    &lt;br /&gt;
    long long position;     /* actual location in the area (in arbitrary units) */&lt;br /&gt;
    long long size;         /* total size of the area (in arbitrary units) */&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
   // MediaControl interface is similar to&lt;br /&gt;
   // ControlledStream interface in MSS.&lt;br /&gt;
   // It can be inherited by flow endpoints or&lt;br /&gt;
   // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
    &lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
     &lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    oneway void exit (); // Exits the player (not in the original spec)&lt;br /&gt;
&lt;br /&gt;
    void playlist_add_item (in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    void playlist_clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    // Returns the list of files in playlist&lt;br /&gt;
    PlaylistSeq playlist_get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Returns a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Displays the message string, between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void display_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
    &lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== API evolution ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Libraries]] [[Category:VideoLAN projects]] [[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11489</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=11489"/>
		<updated>2008-05-06T11:28:52Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It is implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]], and both APIs can cooperate (i.e. you can instanciate a MediaControl object from an existing libvlc instance, and vice-versa).&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://www.videolan.org/developers/vlc/doc/doxygen/html/mediacontrol_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Basic playlist interaction&lt;br /&gt;
** Stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (on the fly only)&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Current API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the current version of MediaControlAPI. In case of doubt, refer to the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  Module inspired by the MediaControl IDL&lt;br /&gt;
 */&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 0.1;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, RelativePosition, ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    ByteCount, SampleCount, MediaTime&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  exception PositionKeyNotSupported { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition         { string message; };&lt;br /&gt;
  exception PlaylistException       { string message; };&lt;br /&gt;
  exception InternalException       { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq; &lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
  &lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
  &lt;br /&gt;
  /* Cf stream_control.h */&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
  &lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;        /* The URL of the current media stream */&lt;br /&gt;
    long mux_rate;     /* the rate we read the stream in bytes/s */    &lt;br /&gt;
    long long position;     /* actual location in the area (in arbitrary units) */&lt;br /&gt;
    long long size;         /* total size of the area (in arbitrary units) */&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
   // MediaControl interface is similar to&lt;br /&gt;
   // ControlledStream interface in MSS.&lt;br /&gt;
   // It can be inherited by flow endpoints or&lt;br /&gt;
   // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
    &lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
     &lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    oneway void exit (); // Exits the player (not in the original spec)&lt;br /&gt;
&lt;br /&gt;
    void playlist_add_item (in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    void playlist_clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    // Returns the list of files in playlist&lt;br /&gt;
    PlaylistSeq playlist_get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Returns a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Displays the message string, between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void display_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
    &lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== API evolution ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Libraries]] [[Category:VideoLAN projects]] [[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=10925</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=10925"/>
		<updated>2008-03-12T10:10:15Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Full API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It will be implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]].&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://www.videolan.org/developers/vlc/doc/doxygen/html/mediacontrol_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Basic playlist interaction&lt;br /&gt;
** Stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (on the fly only)&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Current API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the current version of MediaControlAPI. In case of doubt, refer to the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  Module inspired by the MediaControl IDL&lt;br /&gt;
 */&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 0.1;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, RelativePosition, ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    ByteCount, SampleCount, MediaTime&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  exception PositionKeyNotSupported { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition         { string message; };&lt;br /&gt;
  exception PlaylistException       { string message; };&lt;br /&gt;
  exception InternalException       { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq; &lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
  &lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
  &lt;br /&gt;
  /* Cf stream_control.h */&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
  &lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;        /* The URL of the current media stream */&lt;br /&gt;
    long mux_rate;     /* the rate we read the stream in bytes/s */    &lt;br /&gt;
    long long position;     /* actual location in the area (in arbitrary units) */&lt;br /&gt;
    long long size;         /* total size of the area (in arbitrary units) */&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
   // MediaControl interface is similar to&lt;br /&gt;
   // ControlledStream interface in MSS.&lt;br /&gt;
   // It can be inherited by flow endpoints or&lt;br /&gt;
   // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
    &lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
     &lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    oneway void exit (); // Exits the player (not in the original spec)&lt;br /&gt;
&lt;br /&gt;
    void playlist_add_item (in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    void playlist_clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
    // Returns the list of files in playlist&lt;br /&gt;
    PlaylistSeq playlist_get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Returns a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Displays the message string, between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void display_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
    &lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== API evolution ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Libraries]] [[Category:VideoLAN projects]] [[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8526</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8526"/>
		<updated>2007-04-27T13:56:03Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Win32 initialization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), that was used for streaming. A more complete (with a hopefully generic API that can be reused by other players) has been developed, based on the [[MediaControlAPI]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
Note: as of 0.9.0pre (still in svn), the vlc.Object binding has been moved to its own module called vlcinternal, and it &#039;&#039;&#039;must&#039;&#039;&#039; be built from a vlc tree, since it provides access to internal features of vlc. The vlc module holds the vlc.MediaControl object as well as bindings to the new libvlc API (vlc.Instance, vlc.Input), and can be built outside of the vlc tree, provided that the appropriate headers and libraries are present.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object, since VLC will look for its plugins in the current directory.  Another way is to pass the correct --plugin-path option.&lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8073</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8073"/>
		<updated>2007-03-23T11:16:35Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python specificities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
Note: as of 0.9.0pre (still in svn), the vlc.Object binding has been moved to its own module called vlcinternal, and it &#039;&#039;&#039;must&#039;&#039;&#039; be built from a vlc tree, since it provides access to internal features of vlc. The vlc module holds the vlc.MediaControl object as well as bindings to the new libvlc API (vlc.Instance, vlc.Input), and can be built outside of the vlc tree, provided that the appropriate headers and libraries are present.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Building notes ==&lt;br /&gt;
&lt;br /&gt;
* on 0.8.6(a), the --enable-mediacontrol-python-bindings option is not compatible with --enable-libtool. If you need libtool support, please use the svn version.&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8072</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8072"/>
		<updated>2007-03-23T11:15:31Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
Note: as of 0.9.0pre (still in svn), the vlc.Object binding has been moved to its own module called vlcinternal, and it &#039;&#039;&#039;must&#039;&#039;&#039; be built from a vlc tree, since it provides access to internal features of vlc. The vlc module holds the vlc.MediaControl object as well as bindings to the new libvlc API (vlc.Instance, vlc.Input), and can be built outside of the vlc tree, provided that the appropriate headers and libraries are present.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8071</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8071"/>
		<updated>2007-03-23T11:11:34Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python specificities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [[MediaControlAPI]], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8070</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=8070"/>
		<updated>2007-03-23T11:10:52Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python binding documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.  If you want to include the python bindings in your build, you must pass --enable-python-bindings (svn version) or --enable-mediacontrol-python-bindings (0.8.6* versions) to ./configure as it is disabled by default.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [MediaControlAPI], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
{{file|bindings/python|bindings}}&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=8069</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=8069"/>
		<updated>2007-03-23T11:09:38Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Current status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It will be implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]].&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://developers.videolan.org/vlc/vlc/doc/doxygen/html/control_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Basic playlist interaction&lt;br /&gt;
** Stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (on the fly only)&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Full API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). The current API is better described by the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Libraries]] [[Category:VideoLAN projects]] [[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=8068</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=8068"/>
		<updated>2007-03-23T11:09:03Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Current uses */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It will be implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]].&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://developers.videolan.org/vlc/vlc/doc/doxygen/html/control_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Basic playlist interaction&lt;br /&gt;
** Stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (requires the use of the snapshot vout module via the clone video filter; invoke with: vlc --video-filter clone --clone-vout-list default,snapshot )&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Full API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). The current API is better described by the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Libraries]] [[Category:VideoLAN projects]] [[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=5688</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=5688"/>
		<updated>2006-10-17T14:04:03Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Snapshot support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;vlc/bindings/mediacontrol-python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/mediacontrol-python/ python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [MediaControlAPI], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
Advantages of the old (filter-based) approach:&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=5602</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=5602"/>
		<updated>2006-09-26T15:20:46Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It will be implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]].&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/control.h &amp;quot;include/vlc/mediacontrol.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://developers.videolan.org/vlc/vlc/doc/doxygen/html/control_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Basic playlist interaction&lt;br /&gt;
** Stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (requires the use of the snapshot vout module via the clone video filter; invoke with: vlc --video-filter clone --clone-vout-list default,snapshot )&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [http://trac.videolan.org/vlc/browser/trunk/bindings/modules/control/corba CORBA interface module]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Full API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). The current API is better described by the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=4701</id>
		<title>MediaControlAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=MediaControlAPI&amp;diff=4701"/>
		<updated>2006-06-07T12:51:08Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Full API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is a generic Media player API. The idea is to define a generic video-player API, that could be reused with other players. It will be implemented in VLC by using the [[ExternalAPI#VLC_Control|New libvlc API]].&lt;br /&gt;
&lt;br /&gt;
Its core part (playback control) has been taken from the [http://www.omg.org/docs/formal/00-01-03.pdf OMG Audio/Video Stream specification], and extended with additional functionalities. An [http://liris.cnrs.fr/advene/download/MediaControl.idl IDL specification MediaControl.idl] has been the base of this work.&lt;br /&gt;
&lt;br /&gt;
FIXME : The API is defined in [http://trac.videolan.org/vlc/browser/trunk/include/vlc/control.h &amp;quot;include/vlc/control.h&amp;quot;] and implemented in &lt;br /&gt;
[http://trac.videolan.org/vlc/browser/trunk/src/control &amp;quot;src/control&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
The Doxygen documentation can be found at [http://developers.videolan.org/vlc/vlc/doc/doxygen/html/control_8h.html].&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
&lt;br /&gt;
The API currently includes functions for the following things:&lt;br /&gt;
* Playback&lt;br /&gt;
** Basic features (play/pause/stop)&lt;br /&gt;
** Seeking&lt;br /&gt;
** Basic playlist interaction&lt;br /&gt;
** Stream information&lt;br /&gt;
* Audio/Video&lt;br /&gt;
** Snapshot control (requires the use of the snapshot vout module via the clone video filter; invoke with: vlc --video-filter clone --clone-vout-list default,snapshot )&lt;br /&gt;
** OSD display (of text and SVG graphics through the svg rendering module)&lt;br /&gt;
** Volume setting&lt;br /&gt;
** Setting the visual ID of an embedding window&lt;br /&gt;
&lt;br /&gt;
== Current uses ==&lt;br /&gt;
&lt;br /&gt;
The MediaControl API is used by the following modules :&lt;br /&gt;
* the [[PythonBinding]]&lt;br /&gt;
* the [http://trac.videolan.org/vlc/browser/trunk/bindings/modules/control/corba CORBA interface module]&lt;br /&gt;
* the [[JavaBinding]]&lt;br /&gt;
&lt;br /&gt;
== Foreseen evolutions ==&lt;br /&gt;
&lt;br /&gt;
The following evolutions should be integrated in the API, but discussion is necessary to ensure that they are sufficiently flexible to match various needs :&lt;br /&gt;
* sound_[sg]et_volume: normalize volume in [0..100]&lt;br /&gt;
* implement get_api_version() or get_capabilities() (which would return the list of capabilities supported by the player: (&amp;quot;core&amp;quot;, &amp;quot;svg&amp;quot;, &amp;quot;snapshot&amp;quot;, etc)&lt;br /&gt;
* Complete the implementation. For instance, the frame-by-frame unit (mediacontrol_SampleCount) is not implemented, and the stop/pause do not take the Position parameter into account (they are applied immediately).&lt;br /&gt;
* Fix VLC initialization on Win32 so that it uses the registry key to find the default plugins directory by default. Currently, it uses the vlc.exe path, which it cannot find when using VLC embedded. A workaround is to chdir to the vlc.exe directory before instanciating the MediaControl() object.&lt;br /&gt;
&lt;br /&gt;
== Full API ==&lt;br /&gt;
&lt;br /&gt;
Here is an IDL description of the intended next version of MediaControlAPI. It is not fully implemented yet (esp. the playlist handling). The current API is better described by the [http://trac.videolan.org/vlc/browser/trunk/include/vlc/mediacontrol.h mediacontrol.h file]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module VLC {&lt;br /&gt;
&lt;br /&gt;
  const float VERSION = 1.0;&lt;br /&gt;
&lt;br /&gt;
  enum PositionOrigin {&lt;br /&gt;
    AbsolutePosition, &lt;br /&gt;
    RelativePosition, &lt;br /&gt;
    // Like relative, but wraps at the end of a file for instance:&lt;br /&gt;
    ModuloPosition&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  enum PositionKey {&lt;br /&gt;
    // For raw access&lt;br /&gt;
    ByteCount, &lt;br /&gt;
    // Frame number&lt;br /&gt;
    SampleCount,&lt;br /&gt;
    // In milliseconds&lt;br /&gt;
    MediaTime&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct Position {&lt;br /&gt;
    PositionOrigin origin;&lt;br /&gt;
    PositionKey key;&lt;br /&gt;
    long long value;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  exception PositionKeyNotSupported    { string message; };&lt;br /&gt;
  exception PositionOriginNotSupported { string message; };&lt;br /&gt;
  exception InvalidPosition            { string message; };&lt;br /&gt;
  exception PlaylistException          { string message; };&lt;br /&gt;
  exception InternalException          { string message; };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;string&amp;gt; PlaylistSeq;&lt;br /&gt;
  typedef sequence&amp;lt;octet&amp;gt; ByteSeq;&lt;br /&gt;
&lt;br /&gt;
  struct RGBPicture {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    long type;&lt;br /&gt;
    ByteSeq data;&lt;br /&gt;
    // Timestamp (absolute position in the movie) in ms&lt;br /&gt;
    long long date;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  struct StreamInformation {&lt;br /&gt;
    short width;&lt;br /&gt;
    short height;&lt;br /&gt;
    float aspect_ratio;&lt;br /&gt;
    long bitrate;&lt;br /&gt;
    string codec;&lt;br /&gt;
    string author;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  typedef sequence&amp;lt;RGBPicture&amp;gt; RGBPictureSeq;&lt;br /&gt;
&lt;br /&gt;
  enum PlayerStatus { PlayingStatus, PauseStatus, ForwardStatus, BackwardStatus, InitStatus, EndStatus, UndefinedStatus };&lt;br /&gt;
&lt;br /&gt;
  struct StatusInformation {&lt;br /&gt;
    PlayerStatus streamstatus;&lt;br /&gt;
    string url;             /* The URL of the current media stream   */&lt;br /&gt;
    long long position;     /* actual location in the stream (in ms) */&lt;br /&gt;
    long long length;       /* total length of the stream (in ms)    */&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  interface Playlist &lt;br /&gt;
  {&lt;br /&gt;
    // Return a playlist item id&lt;br /&gt;
    int add(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void next(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void prev(in string a_file)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Set the new current item&lt;br /&gt;
    void set(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void remove(int item_id)&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Clear the whole playlist&lt;br /&gt;
    void clear ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    // Return the list of files in playlist&lt;br /&gt;
    PlaylistSeq get_list ()&lt;br /&gt;
      raises (PlaylistException);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // MediaControl interface is similar to&lt;br /&gt;
  // ControlledStream interface in MSS.&lt;br /&gt;
  // It can be inherited by flow endpoints or&lt;br /&gt;
  // FlowConnection interfaces.&lt;br /&gt;
  interface MediaControl&lt;br /&gt;
  {&lt;br /&gt;
    // *** Initialization&lt;br /&gt;
    // Exit the player&lt;br /&gt;
    oneway void exit ();&lt;br /&gt;
&lt;br /&gt;
    // Return the IDL API version&lt;br /&gt;
    string get_api_version();&lt;br /&gt;
&lt;br /&gt;
    // Return the player version (player name + version)&lt;br /&gt;
    string get_player_version();&lt;br /&gt;
&lt;br /&gt;
    // *** Playback control&lt;br /&gt;
    // The a_position parameters are facultative.&lt;br /&gt;
    void start(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition, PlaylistException);&lt;br /&gt;
&lt;br /&gt;
    void pause(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void resume(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    void stop(in Position a_position)&lt;br /&gt;
      raises (InternalException, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    Position get_media_position(in PositionOrigin an_origin,&lt;br /&gt;
				in PositionKey a_key)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported);&lt;br /&gt;
&lt;br /&gt;
    void set_media_position(in Position a_position)&lt;br /&gt;
      raises (InternalException, PositionKeyNotSupported, InvalidPosition);&lt;br /&gt;
&lt;br /&gt;
    // Rate control. The rate is a signed value, corresponding to&lt;br /&gt;
    // the percentage of the speed (+100 = normal, -100 = reverse...)&lt;br /&gt;
&lt;br /&gt;
    int get_rate()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_rate(int rate)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Media information&lt;br /&gt;
&lt;br /&gt;
    StatusInformation get_status_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return information about the current stream&lt;br /&gt;
    StreamInformation get_stream_information ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Playlist handling&lt;br /&gt;
    Playlist playlist()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Video&lt;br /&gt;
&lt;br /&gt;
    // Return a snapshot of the currently displayed picture&lt;br /&gt;
    RGBPicture snapshot (in Position a_position)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Return the whole snapshot cache contents&lt;br /&gt;
    RGBPictureSeq all_snapshots ()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Display the message string as caption, &lt;br /&gt;
    // between &amp;quot;begin&amp;quot; and &amp;quot;end&amp;quot; positions&lt;br /&gt;
    void render_text (in string message, in Position begin, in Position end)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // Set the visual ID (XID in X-Window, HWIN on Win32, ??? on MacOS&lt;br /&gt;
    // X) for the player window&lt;br /&gt;
    void set_visual(long xid)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    boolean get_fullscreen()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void set_fullscreen(boolean full)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    // *** Audio&lt;br /&gt;
&lt;br /&gt;
    // Volume is normalized in [0..100]&lt;br /&gt;
    unsigned short sound_get_volume()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_set_volume(in unsigned short volume)&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
&lt;br /&gt;
    void sound_mute()&lt;br /&gt;
      raises (InternalException);&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=3931</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=3931"/>
		<updated>2006-04-06T07:02:22Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for [[Wikipedia:libvlc|libvlc]] (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;vlc/bindings/mediacontrol-python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/mediacontrol-python/ python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download.html].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux, Windows and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : Object and MediaControl.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierarchy. The vlcwrapper.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]), and combined with a interactive python environment such as [http://ipython.scipy.org/ IPython] offers an interaction framework with VLC (with object navigation, completion...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [MediaControlAPI], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
There is a snapshot functionality built in the vlc core, associated to a hotkey. The MediaControlAPI could (should ?) use it, but&lt;br /&gt;
&lt;br /&gt;
* it did not exist at the time the extension was developped&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=3726</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=3726"/>
		<updated>2006-03-16T10:09:46Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Snapshot support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for libvlc (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;vlc/bindings/mediacontrol-python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/mediacontrol-python/ python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download/].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux and Windows. It compiles and run on Mac OS X, but embedded vout support is under development in VLC.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : MediaControl and Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierrarchy. The vlcdebug.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [MediaControlAPI], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
In the current svn revision, we use the core snapshot functionality of vlc, which is simpler to setup (no additional module, see below) and directly returns PNG, but less precise.&lt;br /&gt;
&lt;br /&gt;
Prior to revision 13881, in order to get snapshot support, you had to activate the snapshot vout module through a clone video filter.  The following code gives a way to achieve this :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
There is a snapshot functionality built in the vlc core, associated to a hotkey. The MediaControlAPI could (should ?) use it, but&lt;br /&gt;
&lt;br /&gt;
* it did not exist at the time the extension was developped&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to precisely select the more appropriate snapshot from the cache.&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use [Note: this is now implemented, cf src/video_output/vout_intf.c, and look for &amp;quot;object-id&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Video_Output&amp;diff=3280</id>
		<title>Video Output</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Video_Output&amp;diff=3280"/>
		<updated>2006-01-18T10:19:06Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* snapshot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VideoLAN comes with a selection of Video Output modules. These can display output on almost any computer.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want any video, you can use the &#039;&#039;&#039;--no-video&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Output Modules ==&lt;br /&gt;
&lt;br /&gt;
To select one of these modules, use the &#039;&#039;&#039;-V&#039;&#039;&#039; (&#039;&#039;&#039;--vout&#039;&#039;&#039;) command line option, eg:&lt;br /&gt;
 vlc my.avi -V caca&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== image ===&lt;br /&gt;
Save all the frames of a video as a sequence of images. You can select the output format using &#039;&#039;&#039;--image-out-format&#039;&#039;&#039; (currently you can only choose png), and the start of the file name with &#039;&#039;&#039;--image-out-prefix&#039;&#039;&#039;. Finally, to create an image once out of a number of frames, give that number to &#039;&#039;&#039;--image-out-ratio&#039;&#039;&#039;. For example,&lt;br /&gt;
 vlc [[v4l]]:// --image-out-prefix=webcam --image-out-ratio=20&lt;br /&gt;
will create a series of images named&lt;br /&gt;
 webcam000001.png&lt;br /&gt;
 webcam000002.png&lt;br /&gt;
 webcam000003.png&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== aa, caca ===&lt;br /&gt;
ASCII Art modules. &#039;&#039;&#039;aa&#039;&#039;&#039; displays output in black and white, &#039;&#039;&#039;caca&#039;&#039;&#039; in colour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== x11 ===&lt;br /&gt;
Use Linux&#039;s X11 video output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== xvideo ===&lt;br /&gt;
XVideo extension video output, a more advanced form of X11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== glx, opengl ===&lt;br /&gt;
Use OpenGL video output&lt;br /&gt;
&lt;br /&gt;
=== snapshot ===&lt;br /&gt;
&lt;br /&gt;
A pseudo video output that stores reduced-size snapshots of the video in a memory cache. The cache can thereafter be accessed through the [[MediaControlAPI]]. It is commonly used through the clone vout filter, in order to be able to watch the video and get snapshots on demand.&lt;br /&gt;
&lt;br /&gt;
=== dummy ===&lt;br /&gt;
Don&#039;t show output&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
== Cloning ==&lt;br /&gt;
&lt;br /&gt;
To display output in more than one window, video cloning can be used. To use this, specify&lt;br /&gt;
 --vout-filter=clone&lt;br /&gt;
on the [[command prompt|command line]]: this tells vlc to use cloning. You also need to tell vlc what output modules you want with, for example,&lt;br /&gt;
 --clone-vout-filter=&#039;&#039;caca,glx&#039;&#039;&lt;br /&gt;
 --clone-count=&#039;&#039;2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Video_Output&amp;diff=3279</id>
		<title>Video Output</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Video_Output&amp;diff=3279"/>
		<updated>2006-01-18T10:18:23Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* snapshot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VideoLAN comes with a selection of Video Output modules. These can display output on almost any computer.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want any video, you can use the &#039;&#039;&#039;--no-video&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Output Modules ==&lt;br /&gt;
&lt;br /&gt;
To select one of these modules, use the &#039;&#039;&#039;-V&#039;&#039;&#039; (&#039;&#039;&#039;--vout&#039;&#039;&#039;) command line option, eg:&lt;br /&gt;
 vlc my.avi -V caca&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== image ===&lt;br /&gt;
Save all the frames of a video as a sequence of images. You can select the output format using &#039;&#039;&#039;--image-out-format&#039;&#039;&#039; (currently you can only choose png), and the start of the file name with &#039;&#039;&#039;--image-out-prefix&#039;&#039;&#039;. Finally, to create an image once out of a number of frames, give that number to &#039;&#039;&#039;--image-out-ratio&#039;&#039;&#039;. For example,&lt;br /&gt;
 vlc [[v4l]]:// --image-out-prefix=webcam --image-out-ratio=20&lt;br /&gt;
will create a series of images named&lt;br /&gt;
 webcam000001.png&lt;br /&gt;
 webcam000002.png&lt;br /&gt;
 webcam000003.png&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== aa, caca ===&lt;br /&gt;
ASCII Art modules. &#039;&#039;&#039;aa&#039;&#039;&#039; displays output in black and white, &#039;&#039;&#039;caca&#039;&#039;&#039; in colour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== x11 ===&lt;br /&gt;
Use Linux&#039;s X11 video output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== xvideo ===&lt;br /&gt;
XVideo extension video output, a more advanced form of X11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== glx, opengl ===&lt;br /&gt;
Use OpenGL video output&lt;br /&gt;
&lt;br /&gt;
=== snapshot ===&lt;br /&gt;
&lt;br /&gt;
A pseudo video output that stores reduced-size snapshots of the video in a memory cache. The cache can thereafter be accessed through the MediacontrolAPI. It is commonly used through the clone vout filter, in order to be able to watch the video and get snapshots on demand.&lt;br /&gt;
&lt;br /&gt;
=== dummy ===&lt;br /&gt;
Don&#039;t show output&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
== Cloning ==&lt;br /&gt;
&lt;br /&gt;
To display output in more than one window, video cloning can be used. To use this, specify&lt;br /&gt;
 --vout-filter=clone&lt;br /&gt;
on the [[command prompt|command line]]: this tells vlc to use cloning. You also need to tell vlc what output modules you want with, for example,&lt;br /&gt;
 --clone-vout-filter=&#039;&#039;caca,glx&#039;&#039;&lt;br /&gt;
 --clone-count=&#039;&#039;2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VoutReworkUserRequirements&amp;diff=2885</id>
		<title>VoutReworkUserRequirements</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VoutReworkUserRequirements&amp;diff=2885"/>
		<updated>2006-01-03T10:01:11Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* User-side requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== User-side requirements ==&lt;br /&gt;
&lt;br /&gt;
* working hotkeys in embed, windowed, or fullscreen mode&lt;br /&gt;
** Partially related to GUI, but some work will have to be done, see lower&lt;br /&gt;
* ability to position subtitles virtually anywhere (eg outside the picture)&lt;br /&gt;
** Ok, planned. See vout_render, cropping/padding&lt;br /&gt;
* screen-resolution OSD&lt;br /&gt;
** Planned, see subpictures&lt;br /&gt;
* ability to switch from embed to windowed vouts with the mouse&lt;br /&gt;
* screenshots&lt;br /&gt;
** Already existing ... Want something more ? Answer: yes. The current architecture is meant for interactive use, but is not really usable from an external application embedding VLC (cf [[MediaControlAPI]]  for an example). Screenshot functionality should at least provide :&lt;br /&gt;
*** the ability to use a destination other than a file (think embedded)&lt;br /&gt;
*** a small cache of pictures to take into account the reaction time&lt;br /&gt;
*** precise timestamp of the snapshot (in movie time)&lt;br /&gt;
*** Replace image video output cleanly&lt;br /&gt;
* close helper vouts without stopping the stream&lt;br /&gt;
** More or less planned&lt;br /&gt;
* chained video filters&lt;br /&gt;
* on-the-fly AR correction&lt;br /&gt;
* enable/disable video filters on the fly&lt;br /&gt;
** Should work, currently buggy (suxxor thread suxxing). Planned&lt;br /&gt;
* stream video filters with stream output (eg start a stream, deinterlace it, invert the colors, distort the picture, add a logo and a rss feed and stream the result to your grandmother).&lt;br /&gt;
* Screensaver desactivation&lt;br /&gt;
* Screensaver output : maybe having sub-module with screensaver capatibilities and a way to ask the core to use a screensaver module instead of a regular vout module&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=2858</id>
		<title>Old Python bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Old_Python_bindings&amp;diff=2858"/>
		<updated>2005-12-31T17:33:57Z</updated>

		<summary type="html">&lt;p&gt;OlivierAubert: /* Python binding documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Python binding documentation =&lt;br /&gt;
&lt;br /&gt;
For a while, there has been a basic python binding for libvlc (located in &amp;lt;code&amp;gt;vlc/pyvlc&amp;lt;/code&amp;gt;), 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]]. It can be found in &amp;lt;code&amp;gt;vlc/bindings/python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Sources are browsable from [http://trac.videolan.org/vlc/browser/trunk/bindings/python python binding] and a code sample can be found in [http://liris.cnrs.fr/advene/download/].&lt;br /&gt;
&lt;br /&gt;
It has been compiled, and is being used, on Linux and Windows. It compiles and run on Mac OS X, but embedded vout support is under development in VLC.&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
The vlc python module provides 2 main classes : MediaControl and Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.Object&#039;&#039;&#039; provides a binding to the vlc object architecture. It allows to manipulate variables and configuration options, and explore the object hierrarchy. The vlcdebug.py script, located in the python bindings directory, wraps around the vlc.Object to provide an easier access to variables and objects (as illustrated in the code sample in [http://liris.cnrs.fr/advene/download/]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;vlc.MediaControl&#039;&#039;&#039; implements the [[MediaControlAPI]].&lt;br /&gt;
&lt;br /&gt;
Methods taking positions as parameters expect a &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; object, that provides a very flexible way to address absolute or relative positions, in a number of units (milliseconds, frames or bytes). For convenience, the python binding automatically converts integer positions into milliseconds &#039;&#039;&#039;vlc.Position&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Python specificities ==&lt;br /&gt;
&lt;br /&gt;
The python bindings provide a binding for the [MediaControlAPI], with some variations :&lt;br /&gt;
&lt;br /&gt;
* the methods taking a &#039;&#039;vlc.Position&#039;&#039; parameter also accept an integer, which will then be converted to a relative position in milliseconds (vlc.MediaTime)&lt;br /&gt;
* the start, stop, pause and resume method position parameter is optional. If omitted, it will default to a 0-relative position.&lt;br /&gt;
* RGBPicture (returned by snapshot) and StreamInformation (returned by get_stream_information) are not objects with attributes, but instead dictionaries.&lt;br /&gt;
&lt;br /&gt;
== Snapshot support ==&lt;br /&gt;
&lt;br /&gt;
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 :&lt;br /&gt;
&lt;br /&gt;
  mc=vlc.MediaControl([ &amp;quot;--vout-filter&amp;quot;, &amp;quot;clone&amp;quot; ])&lt;br /&gt;
  o=VLC.Object(0)&lt;br /&gt;
  o.config_set(&amp;quot;clone-vout-list&amp;quot;, &amp;quot;default,snapshot&amp;quot;)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-width&amp;quot;, 320)&lt;br /&gt;
  o.config_set(&amp;quot;snapshot-height&amp;quot;, 200)&lt;br /&gt;
&lt;br /&gt;
Note that all config options could have been given on the command line, but this illustrates the use of the vlc.Object API.&lt;br /&gt;
&lt;br /&gt;
There is a snapshot functionality built in the vlc core, associated to a hotkey. The MediaControlAPI could (should ?) use it, but&lt;br /&gt;
&lt;br /&gt;
* it did not exist at the time the extension was developped&lt;br /&gt;
* the builtin snapshot functionality is oriented towards interactive use (hotkey activation, saving into a file) and should be revamped to take into accound a more programmatic use&lt;br /&gt;
* the snapshot vout module holds a cache of reduced-size snapshots, that allow to take into account the reaction time of the user (around 200ms) and also to select the more appropriate snapshot from the cache.&lt;br /&gt;
&lt;br /&gt;
== Win32 initialization ==&lt;br /&gt;
&lt;br /&gt;
If the vlc module was not compiled with the exact same prefix as the VLC installation (e.g. c:\\Program Files\\Videolan), then it cannot find itself the installation directory (stored in the registry Software\VideoLAN\VLC\InstallDir), and the MediaControl instanciation will fail with a message like &amp;quot;Cannot find interface plugins&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The workaround consists in changing directory to the VLC installation directory before instanciating the MediaControl object. &lt;br /&gt;
&lt;br /&gt;
    def get_registry_value (self, subkey, name):&lt;br /&gt;
        import _winreg&lt;br /&gt;
        value = None&lt;br /&gt;
        for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:&lt;br /&gt;
            try:&lt;br /&gt;
                reg = _winreg.OpenKey(hkey, subkey)&lt;br /&gt;
                value, type_id = _winreg.QueryValueEx(reg, name)&lt;br /&gt;
                _winreg.CloseKey(reg)&lt;br /&gt;
            except _winreg.error:&lt;br /&gt;
                pass&lt;br /&gt;
        return value&lt;br /&gt;
    &lt;br /&gt;
    vlcpath=get_registry_value(&#039;Software\\VideoLAN\\VLC&#039;,&#039;InstallDir&#039;)&lt;br /&gt;
    if vlcpath is None:&lt;br /&gt;
        print &amp;quot;Cannot locate VLC installation directory&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        os.chdir(vlcpath)&lt;br /&gt;
        mc=vlc.MediaControl()&lt;/div&gt;</summary>
		<author><name>OlivierAubert</name></author>
	</entry>
</feed>