← Back

ofxPiMapper_PVJexh

github.com/magdesign/ofxPiMapper_PVJexh · @magdesign
OF 0.11 Releases Raspberry Pi

offline fork of ofxPiMapper

3 0 Last commit 5y ago Created 6y ago

Branches ahead of master

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

EdgeBlend 3 commits ahead · last commit 6y ago
FullScreenQuad 1 commit ahead · last commit 6y ago

README

offline fork of ofxPiMapper

This is for my own backup purpose and to be able to use the search function. <p/>

original by: https://github.com/kr15h/ofxPiMapper <p/> additions added on request by: https://github.com/pierrep/ofxPiMapper <p/>

relies on: <p/> https://github.com/pierrep/ofxVideoSync <p/> https://github.com/pierrep/ofxOMXPlayer <p/> <p/> <p/>

Development of this fork is generously supported by:



SEHNERV.org - Verein zur Förderung von Medienkunst

The shortcuts are changed to fit PocketVJ Exhibition Control Panel (had to do this because there where some special characters which could not be sent remotely).<p/> Removed unused examples.

Features



next features which might be requested when there is a sponsor available:



Good to know



Change the audio volume in: ofxOMXPlayer/src/ofxOMXPlayerSettings.h => initialVolume from 0.3 to 0.5 <p/> before compiling! <p/>

To enable hdmi audio, change in: ofxPiMapper/src/Sources/VideoSource.cpp => bool VideoSource::enableAudio = true; and bool VideoSource::useHDMIForAudio = true;

ofxPiMapper



Join the chat at https://gitter.im/kr15h/ofxPiMapper Build Status Build status

Projection mapping addon for openFrameworks that runs on the Raspberry Pi.

The project started as master's thesis project by Krisjanis Rijnieks at the Helsinki Media Lab. Currently undergoing changes. Expect the API to be incompatible with your projects from the past or present-day.

Notes on Video Encoding



Easiest way to achieve success is to use HandBrake with the following settings. This will produce a .mkv file with 16bit FLAC audio with 22.05KHz sampling rate.

Preset: Fast 720p30
Summary / Format: MKV File
Video / Framerate: Same as source
Video / Profile: Baseline
Audio / Codec: FLAC 16-bit
Audio / Samplerate: 22.05


If you are familiar with ffmpeg, use the following. It will produce a .mov file. PCM audio codec with 22KHz sampling rate is used.

ffmpeg -i input-video.mp4 -s 1280x720 -aspect 16:9 \
  -c:v libx264 -profile:v baseline \
  -c:a pcm_s16le -ar 22000 -ac 2 \
  output-video.mov


These two settings have shown the best results so far. Audio problems and video playback at the beginning of longer video files was the main issue in most cases. Please open an issue if you have better suggestions.

Running the Example



You can use the example application of the addon for projection mapping projects where static images or videos have to be projection mapped. Make sure you are using the latest stable version of openFrameworks.

1. Put your own sources in the example/bin/data/sources directory.

2. Compile and run the example project.
    cd openFrameworks/addons/ofxPiMapper/example
    make && ./bin/example
    


3. Use the -f flag to launch it fullscreen.
    ./bin/example -f
    


Extended Functionality



Examples represent extended functionality of ofxPiMapper. Enter each example separately to find out more.

Compiling on Linux



There might be issues with compiling because ofxOMXPlayer and ofxRPiCameraVideoGrabber addons do not exist on Linux and also other non-RPi platforms. To avoid the issues, do the following.

1. Open example/addons.make and remove ofxOMXPlayer line. 2. Open example-camera/addons.make and remove ofxRPiCameraVideoGrabber line. 3. Compile one or both examples by using make.

Problems with Audio



If you are having problems with audio playback, here are two steps for you. Before you do these, make sure audio of your video file works.

Step 1



Open example openFrameworks application ofApp.cpp file in a text editor.

cd /home/pi/openFrameworks/addons/ofxPiMapper/example
nano src/ofApp.cpp


Make sure that the following line looks as follows.

ofx::piMapper::VideoSource::enableAudio = true;


Save the file (CTRL + X, Y and ENTER). Recompile and run the example.

make && make run


Step 2



If the sound still does not work, try to use raspi-config.

sudo raspi-config


Select "7 Advanced Options" and "A9 Audio" then "0 Auto". You can use one of the force options if you want to be 100% sure.

Open alsamixer.

alsamixer


Set the volume to a value between 90 to 100 by using the arrow keys. ESC to exit the mixer.

Launch ofxPiMapper example, select a surface and set a video source with audio. Should work.

Development



Keeping it simple. Developing ofxPiMapper master branch against the latest stable release version of openFrameworks.

Licence



ofxPiMapper is distributed under the MIT License. See the LICENSE file for further details. Just add my name somewhere along your project Krisjanis Rijnieks whenever possible.

Supporters



You can become a supporter by donating BitCoins, via PayPal or becoming a Patreon. Please check https://ofxpimapper.com for details. List of supporters below.



Dependencies



Before moving on, make sure that you have all the dependencies installed.

To install dependencies, cd into openFrameworks/addons directory and execute the following:

git clone https://github.com/jvcleave/ofxOMXPlayer.git


The ofxOMXPlayer addon recommends you to use its releases. Currently the latest release is 0.9.0-compatible. To checkout the code of the relase, go to the ofxOMXPlayer addon directory and checkout the relase.

cd openFrameworks/addons/ofxOMXPlayer
git checkout 0.9.0-compatible


You can check the latest releases on the ofxOMXPlayer GitHub repository.

Usage



Currently a keyboard and a mouse has to be used in order to do the mapping with ofxPiMapper.

Modes



PiMapper has 4 modes:

1. Presentation mode 2. Texture mapping mode 3. Surface editing mode 4. Source assignment mode

You can access these modes by pressing 1, 2, 3 or 4 respectively.

Presentation mode



This mode is activated once the application starts up. It does not show anything else except the final projection mapping as it was saved previously.

Texture mapping mode



In this mode you can adjust the texture coordinates of the surface you have selected in the surface editing mode.

Surface editing mode



Here you can select, move and distort the surfaces you have created.

Source assignment mode



After you select a surface in surface editing mode, activate this mode to be able to choose a source for the surface. Afterwards you might want to go to the texture mapping mode to adjust texture coordinates.

Other shortcuts



These other shortcuts that you can use while using the example app in this modified PVJ version.

KeyFunction
1Presentation mode
2Texture editing mode
3Projection mapping mode, use this to select a surface first
4Source selection mode
iShow info
tAdd triangle surface
qAdd quad surface
gAdd grid warp surface
cAdd circle surface
aduplicate selected surface
\+Scale surface up
\-Scale surface down
ptoggle perspective warping (quad surfaces only)
vadd columns to grid surface (grid warp surfaces only)
bremove columns from grid surface (grid warp surfaces only)
nadd rows to grid surface (grid warp surfaces only)
mremove rows from grid surface (grid warp surfaces only)
.select next surface (projection mapping mode only)
/select previous surface (projection mapping mode only)
kselect next vertex
lselect previous vertex
hMove selected surface one layer up
jMove selected surface one layer down
sSave composition
yHide/show layer panel
zUndo
rbt | Reboot (Raspberry Pi only) sdn | Shutdown (Raspberry Pi only) new | Clear composition (remove all surfaces) ext | Exit application and return to command line

d | Delete surface. w | Toggle pause for video sources (texture and projection mapping modes) 5 | Select next source (no need to use the source selection interface) 8 | Move selection up 9 | Move selection down 7 | Move selection left 0 | Move selection right

\/ | Toggle 1px/10px steps for keyboard moves on Raspberry Pi

Get this addon

HTTPS
SSH

Latest release

v0.1 Remote Client v0.1 published 6y ago
Built version of the remote client.

Linux Version built on 28.02.20 under Ubuntu 18.04 LTS run ./example_remote-client You might need to install dependencies: sudo apt-get install libglfw3 sudo apt-get install libfreeimage3 sudo apt-get install liburiparser1 sudo apt-get install libglew2.0

Windows Version built on 19.02.20 on Windows 10 run example_remote-client.exe Both 32-bit and 64-bit releases are available

OSX Version built on 23.04.18 run MapperRemote.app Needs some tests on newest OSX systems

All credits go to https://github.com/kr15h