| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: python-vlc |
| 3 |
Version: 3.0.21203 |
| 4 |
Summary: VLC bindings for python. |
| 5 |
Author-email: Olivier Aubert <[email protected]> |
| 6 |
Maintainer-email: Olivier Aubert <[email protected]> |
| 7 |
License: LGPL-2.1+ |
| 8 |
Project-URL: Homepage, https://wiki.videolan.org/PythonBinding |
| 9 |
Project-URL: Documentation, https://www.olivieraubert.net/vlc/python-ctypes/doc/ |
| 10 |
Project-URL: Repository, https://github.com/oaubert/python-vlc.git |
| 11 |
Project-URL: Alternate repository, https://git.videolan.org/?p=vlc/bindings/python.git;a=summary |
| 12 |
Project-URL: Bug Tracker, https://github.com/oaubert/python-vlc/issues |
| 13 |
Keywords: vlc,video |
| 14 |
Classifier: Development Status :: 5 - Production/Stable |
| 15 |
Classifier: Intended Audience :: Developers |
| 16 |
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) |
| 17 |
Classifier: Operating System :: MacOS :: MacOS X |
| 18 |
Classifier: Operating System :: Microsoft :: Windows |
| 19 |
Classifier: Operating System :: POSIX :: Linux |
| 20 |
Classifier: Operating System :: POSIX :: Other |
| 21 |
Classifier: Programming Language :: Python |
| 22 |
Classifier: Programming Language :: Python :: 2 |
| 23 |
Classifier: Programming Language :: Python :: 3 |
| 24 |
Classifier: Topic :: Multimedia |
| 25 |
Classifier: Topic :: Multimedia :: Sound/Audio |
| 26 |
Classifier: Topic :: Multimedia :: Video |
| 27 |
Description-Content-Type: text/x-rst |
| 28 |
License-File: COPYING |
| 29 |
|
| 30 |
Python ctypes-based bindings for libvlc |
| 31 |
======================================= |
| 32 |
|
| 33 |
The bindings use ctypes to directly call the libvlc dynamic lib, and |
| 34 |
the code is generated from the include files defining the public |
| 35 |
API. The same module should be compatible with various versions of |
| 36 |
libvlc 3.*. However, there may be incompatible changes between major |
| 37 |
versions. |
| 38 |
|
| 39 |
Installing the module |
| 40 |
--------------------- |
| 41 |
|
| 42 |
You can install the module through PyPI: |
| 43 |
|
| 44 |
pip install python-vlc |
| 45 |
|
| 46 |
Using the module |
| 47 |
---------------- |
| 48 |
|
| 49 |
The module offers two ways of accessing the API - a raw access to all |
| 50 |
exported methods, and more convenient wrapper classes. |
| 51 |
|
| 52 |
Using wrapper classes |
| 53 |
+++++++++++++++++++++ |
| 54 |
|
| 55 |
Most major structures of the libvlc API (Instance, Media, MediaPlayer, |
| 56 |
etc) are wrapped as classes, with shorter method names and some |
| 57 |
adaptations to provide a more pythonic API: |
| 58 |
|
| 59 |
>>> import vlc |
| 60 |
>>> player = vlc.MediaPlayer('file:///tmp/foo.avi') |
| 61 |
>>> player.play() |
| 62 |
>>> player.get_instance() # returns the corresponding instance |
| 63 |
|
| 64 |
In this case, a default ``vlc.Instance`` will be instanciated and |
| 65 |
stored in ``vlc._default_instance``. It will be used to instanciate |
| 66 |
the various classes (``Media``, ``MediaList``, ``MediaPlayer``, etc). |
| 67 |
|
| 68 |
You also can use wrapper methods closer to the original libvlc API: |
| 69 |
|
| 70 |
>>> import vlc |
| 71 |
>>> instance = vlc.Instance('--no-audio', '--fullscreen') |
| 72 |
>>> player = instance.media_player_new() |
| 73 |
>>> player.audio_get_volume() |
| 74 |
50 |
| 75 |
>>> media = instance.media_new('file:///tmp/foo.avi') |
| 76 |
>>> media.get_mrl() |
| 77 |
'file:///tmp/foo.avi' |
| 78 |
>>> player.set_media(m) |
| 79 |
>>> player.play() |
| 80 |
|
| 81 |
Using raw access |
| 82 |
++++++++++++++++ |
| 83 |
|
| 84 |
Libvlc methods are available as attributes of the vlc module (as |
| 85 |
vlc.libvlc_*). Use their docstring (any introspective shell like |
| 86 |
ipython is your friend) to explore them, or refer to the online |
| 87 |
documentation at https://olivieraubert.net/vlc/python-ctypes/ |
| 88 |
|
| 89 |
>>> import vlc |
| 90 |
>>> vlc.libvlc_get_version() |
| 91 |
'3.0.0-rc2 Vetinari' |
| 92 |
>>> exc = vlc.VLCException() |
| 93 |
>>> instance = vlc.libvlc_new(0, [], exc) |
| 94 |
>>> instance |
| 95 |
<vlc.Instance object at 0x8384a4c> |
| 96 |
>>> vlc.libvlc_audio_get_volume(instance, exc) |
| 97 |
50 |
| 98 |
|
| 99 |
Example code |
| 100 |
++++++++++++ |
| 101 |
|
| 102 |
You can find [example |
| 103 |
files](https://github.com/oaubert/python-vlc/tree/master/examples) in |
| 104 |
the repository. |
| 105 |
|
| 106 |
Note that the ``vlc.py`` module can itself be invoked as an |
| 107 |
application using its own features, which also serves as a API usage |
| 108 |
example. See the [end of the |
| 109 |
module](https://github.com/oaubert/python-vlc/blob/master/generated/3.0/vlc.py#L12525) |
| 110 |
after the line ``if __name__ == "__main__":`` |
| 111 |
|
| 112 |
License |
| 113 |
------- |
| 114 |
|
| 115 |
The generated module is licensed, like libvlc, under the GNU Lesser |
| 116 |
General Public License 2.1 or later. |