Python bindings for the libmpv library
Project description
pympv
A python wrapper for libmpv.
Basic usage
import sys
import mpv
def main(args):
if len(args) != 1:
print('pass a single media file as argument')
return 1
try:
m = mpv.Context()
except mpv.MPVError:
print('failed creating context')
return 1
m.set_option('input-default-bindings')
m.set_option('osc')
m.set_option('input-vo-keyboard')
m.initialize()
m.command('loadfile', args[0])
while True:
event = m.wait_event(.01)
if event.id == mpv.Events.none:
continue
print(event.name)
if event.id in [mpv.Events.end_file, mpv.Events.shutdown]:
break
if __name__ == '__main__':
try:
exit(main(sys.argv[1:]) or 0)
except mpv.MPVError as e:
print(str(e))
exit(1)
More examples can be found in the samples directory.
libmpv is a client library for the media player mpv
For more info see: https://github.com/mpv-player/mpv/blob/master/libmpv/client.h
pympv was originally written by Andre D, and the PyPI package is maintained by Hector Martin.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pympv-0.7.1.tar.gz.
File metadata
- Download URL: pympv-0.7.1.tar.gz
- Upload date:
- Size: 141.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24305a8e14440fa60f5dcbadd1ad0943c04072104e6d5e90c347301c9ab585a9
|
|
| MD5 |
f12e9c0998264806c4988fc93ee04afd
|
|
| BLAKE2b-256 |
0969b4b441892325aced7befd29155c2bf3442cc930d386217f89a83ac0b334b
|
File details
Details for the file pympv-0.7.1-cp37-cp37m-win_amd64.whl.
File metadata
- Download URL: pympv-0.7.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 26.6 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7567b7aaca5c96a053fbc6690197a2e86f175b6ee03c7f4aff70afbabe54a2a
|
|
| MD5 |
c135676491f0a0114147890b637fbb77
|
|
| BLAKE2b-256 |
7e91a6f00dced13e634a730ac2ee0e3fa1fd49c2fec5ce66f4070767f2bd8c68
|