Skip to main content

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.

Metadata

Release files for pympv 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pympv 0.7.0
File Size Uploaded
pympv-0.7.0.tar.gz 137.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pympv 0.7.0
File Interpreter ABI Platform
pympv-0.7.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details

Total release size: 26.7 MB

Release files / pympv-0.7.0.tar.gz

Download URL pympv-0.7.0.tar.gz
Size 137.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a018d862a7faf847430bb74cba064c5ffac5d4cfbf29343a2c6b132b0443732e
BLAKE2b-256 checksum
How to use checksums
90c2473993da2ed3282d5ed6ac3d977c6e28816fc2037eec9284b70b647f5987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

Release files / pympv-0.7.0-cp37-cp37m-win_amd64.whl

Download URL pympv-0.7.0-cp37-cp37m-win_amd64.whl
Size 26.6 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
842e2f1767ffb960d0fd51203e23132e889966bea846ee0a7b42bf1b1b263cdc
BLAKE2b-256 checksum
How to use checksums
bd292e5ea9ce431bbd0430ddd17ed35297ab91ac673cd71efc797f66f059d6cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

Release history Release notifications | RSS feed

0.9.0

2 release files

0.7.1

2 release files

This release

0.7.0 This release

2 release files

0.6.0

1 release file

0.5.1

1 release file

0.4.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page