← Back

ofxMPVPlayer

github.com/PeteHaughie/ofxMPVPlayer · @PeteHaughie
OF 0.12 Video/Camera Raspberry Pi

Drop-in replacement for ofxVideoPlayer that plays videos via the mpv library, including efficient HAP decoding on 64-bit Raspberry Pi.

5 0 Last commit 1y ago Created 1y ago

README

ofxMPVPlayer



This project leverages the powerful mpv library to play videos in a standalone application. It is built to be a drop-in replacement for the default GStreamer ofxVideoPlayer addon, but with more features and better performance.

Why?



The main reason for this project is that MPV can decode HAP files easily and efficiently on Raspberry Pi running a 64bit OS. While there are other openFrameworks libraries that can do this none of them support this platform and I (Pete Haughie, hello) was desperate to do this. The fact that it works on MacOS, Linux and Windows is entirely coincidental and down to the hard work that the MPV project has put into it.

Requirements



This addon was developed on openFrameworks 0.12 but should work with older versions. As I only use the make build system I have not tried QT, Xcode or Visual Studio. You'll have to try it yourself. Feel free to make contributions to this addon.

Features



API



Refer to the official openFrameworks videoPlayer class documentation for full the documentation on the API. The MPV API documentation resides here.

The Basics



The ofxMPVPLayer class is a wrapper around the mpv library. It can be used to play videos in your application.

object.load('video.mp4'); object.setLoopState(OF_LOOP_NORMAL|OF_LOOP_PINGPONG); object.setup(width, height); object.setPosition(seconds); object.getDuration(); object.getCurrentTime(); object.play(); object.pause(); object.stop();

Get this addon

HTTPS
SSH