Skip to main content

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.9.0.tar.gz (195.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pympv-0.9.0-cp39-cp39-win_amd64.whl (26.6 MB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file pympv-0.9.0.tar.gz.

File metadata

  • Download URL: pympv-0.9.0.tar.gz
  • Upload date:
  • Size: 195.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pympv-0.9.0.tar.gz
Algorithm Hash digest
SHA256 0c034dd1ea0dd6b948639a3c1149e03de6e6f235ad707d431c0ee270bec351ef
MD5 f9d7bb649bf5f4cfeda086da840b03bf
BLAKE2b-256 3ce29903a1ac06235dd2ec995807952c41443dbfbe18d4ab5e8738f70d2426a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pympv-0.9.0.tar.gz:

Publisher: deploy.yml on marcan/pympv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pympv-0.9.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pympv-0.9.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 26.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pympv-0.9.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 adee635a7823ebaf856a62dd8dd04eaf18cb80ff2684f0abfc4ce9b50afc4c77
MD5 7801900a88f3cef8c86958587cba1979
BLAKE2b-256 f8495424ebf7c824af33b13ec82e50d68b8c472bac4c68016de53f0fa17770a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pympv-0.9.0-cp39-cp39-win_amd64.whl:

Publisher: deploy.yml on marcan/pympv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page