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
pympv-0.7.0.tar.gz
(137.5 kB
view hashes)
Built Distribution
Close
Hashes for pympv-0.7.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 842e2f1767ffb960d0fd51203e23132e889966bea846ee0a7b42bf1b1b263cdc |
|
MD5 | 55536c80c823e3ec9301ee2ed5fd9b22 |
|
BLAKE2b-256 | bd292e5ea9ce431bbd0430ddd17ed35297ab91ac673cd71efc797f66f059d6cb |