Coder Social home page Coder Social logo

pyomxplayer's Introduction

pyomxplayer

Python wrapper module around OMXPlayer for the Raspberry Pi.

Unlike other implementations, this module does not rely on any external scripts and FIFOs, but uses the pexpect module for communication with the OMXPlayer process.

CPU overhead is rather low (~3% for the Python process on my development RPi) and the object-oriented design makes it easy to re-use in other projects.

Installation:

git clone https://github.com/jbaiter/pyomxplayer.git
python pyomxplayer/setup.py install

Example:

>>> from pyomxplayer import OMXPlayer
>>> from pprint import pprint
>>> omx = OMXPlayer('/tmp/video.mp4')
>>> pprint(omx.__dict__)
{'_position_thread': <Thread(Thread-5, started 1089234032)>,
'_process': <pexpect.spawn object at 0x1a435d0>,
'audio': {'bps': 16,
        'channels': 2,
        'decoder': 'mp3',
        'rate': 48000,
        'streams': 1},
'chapters': 0,
'current_audio_stream': 1,
'current_volume': 0.0,
'paused': True,
'position': 0.0,
'subtitles': 0,
'subtitles_visible': False,
'video': {'decoder': 'omx-mpeg4',
        'dimensions': (640, 272),
        'fps': 23.976025,
        'profile': 15,
        'streams': 1}}
>>> omx.toggle_pause()
>>> omx.position
9.43
>>> omx.stop()

pyomxplayer's People

Contributors

jbaiter avatar sa7mon avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.