← Back

ofxHapPlayer

github.com/bangnoise/ofxHapPlayer · @bangnoise
OF 0.12 Releases Video/Camera

A Hap player for OpenFrameworks

159 49 Last commit 1y ago Created 13y ago

Forks

Forks pushed to more recently than bangnoise/ofxHapPlayer itself, plus any admin-confirmed fork with commits of its own — worth checking if you're hitting issues with the original.

PeteHaughie/ofxHapPlayer by @PeteHaughie · ★ 0 · pushed 20d ago
crowds-video/ofxHapPlayer by @crowds-video · ★ 0 · pushed 24d ago
fusefactory/ofxHapPlayer by @fusefactory · ★ 0 · pushed 5mo ago
b0yaux/ofxHapPlayer by @b0yaux · ★ 0 · pushed 6mo ago
ffunatsu/ofxHapPlayer by @ffunatsu · ★ 0 · pushed 7mo ago
ofWorks/ofxHapPlayer by @ofWorks · ★ 0 · pushed 10mo ago
hanasaan/ofxHapPlayer by @hanasaan · ★ 1 · pushed 11mo ago
StudioDanielCanogar/ofxHapPlayer by @StudioDanielCanogar · ★ 0 · pushed 11mo ago

Branches ahead of master

These branches have commits not yet on master — could be unmerged fixes or work in progress worth a look.

of_head 1 commit ahead · last commit 1y ago
OpenFrameworks-0.8 1 commit ahead · last commit 10y ago

README

ofxHapPlayer



A Hap player for OpenFrameworks on macOS, Windows and Linux.

Hap is a codec for fast video playback. You can learn more about Hap, and find codecs for encoding, at the main Hap project.

Installation



This repo has branches for major OF versions. Use the branch which matches the version of OF you are using. The master branch matches the current OF release.

For example, if you want to use the addon with OpenFrameworks 0.9.x:

$ cd addons/ofxHapPlayer $ git checkout OpenFrameworks-0.9

Linux Requirements



This step is only necessary on Linux. On macOS and Windows, the required libraries are bundled with the addon.

On Linux, ofxHapPlayer uses system libraries. For Ubuntu, the following packages are required:

libsnappy-dev, libswresample-dev, libavcodec-dev, libavformat-dev, libtbb-dev

sudo apt-get install libsnappy-dev libswresample-dev libavcodec-dev libavformat-dev libtbb-dev

Pull-requests with instructions for other distributions are welcomed.

MSYS2 Requirements



ofxHapPlayer will use MSYS2-installed libraries. The following are required (assuming you are using the suggested MINGW64):

mingw-w64-x86_64-snappy, mingw-w64-x86_64-tbb, mingw-w64-x86_64-ffmpeg

pacman -S mingw-w64-x86_64-snappy mingw-w64-x86_64-tbb mingw-w64-x86_64-ffmpeg

Some of these will usually have been installed as dependencies for OpenFrameworks.

Usage



Use the OF Project Generator to generate build files for your project, selecting ofxHapPlayer as an addon.

#import "ofxHapPlayer.h"

ofxHapPlayer inherits from ofBaseVideoPlayer

player.loadMovie("movies/MyMovieName.mov");

When you want to draw:

player.draw(20, 20);

Note that there is no direct access to pixels and calls to getPixels() will return NULL.

Advanced Usage



You can access the texture directly:

ofTexture texture = player.getTexture();

Note that if you access the texture directly for a Hap Q movie, you will need to use a shader when you draw:

ofShader
shader = player.getShader(); // the result of getShader() will be NULL if the movie is not Hap Q if (shader) { shader->begin(); } texture.draw(x,y,w,h); if (shader) { shader->end(); }

Credits and License



ofxHapPlayer was written by Tom Butterworth, initially in April 2013, supported by Igloo Vision and James Sheridan. Since then it has been supported by Vidvox. It is released under a FreeBSD License.

Get this addon

HTTPS
SSH

Latest release

version2 ofxHapPlayer 2 for OF 0.8.4 published 12y ago
Windows and MacOS X support