Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Raspberry Pi Media Player

From wiki.openlighting.org

Revision as of 17:10, 28 December 2013 by Mrpackethead (talk | contribs) (Created page with "Being stuck at home definatly has its advantages, one is that i finally got to mess with my Raspberry PI's a little.. What i've wanted for quite a while is to be able to trigg...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Being stuck at home definatly has its advantages, one is that i finally got to mess with my Raspberry PI's a little.. What i've wanted for quite a while is to be able to trigger Video/audio via DMX/E1.31/Artnet.. And now i have the start of solution.

(1) Rasberry PI model B, 4GB Class 4 SDcard ( i'm using a SanDisk one ).. (2) Used Raspbian Operating System. ( Raspbian is Debian Linux built for raspberry PI ).. i'm sure you can use somethign else if you want (3) Installed Open Lighting Architecture ( www.opendmx.net )

Media playback is via omxplayer ( its part of the raspbian build );

to play a file, its pretty simple.. You'll obviously need to copy a file to the machien or be able to access it via a network.

omxplayer file.mp4 ; there are some other options like -o hdmi to play audio via the hdmi, etc, check the man pages

omxplayer accepts some basic transport controls via keypress's... ie 'p' for pause.. Not much use for control via DMX... so..

set up a FIFO ( mkfifo /tmp/cmd )

Start up omxplayer with a redirect

omxplayer file.mp4 < /tmp/cmd it will just sit there;

then via the fifo send it some key press's

aka;

echo -n p > /tmp/cmd this sends it a pause, but what it will do is load the file to memory and be ready to play.

send it another 'p' and it will play

echo -n p >/tmp/cmd


ok, so thats not Dmx controlled.. thats where OLA_trigger comes in.

OLA trigger lets you run arbitory commands based on the values of DMX data coming in.. http://www.opendmx.net/index.php/OLA_DMX_Trigger

Unfortuantly you can't use a redirect in the OLA config file, so what i do is create a small shell script, and make the action in the OLA trigger config, that shell script..

Config file looks like this

1 128-255 mycommands

Shell script is really simple and looks like this;


echo -n p >/tmp/cmd


You also of course need to have configured teh universes in OLA.. Then from your favorite sequencer you can send it dmx commands and fire off your videos in sync.. The methods can be extended of course to be able to select multiple videos and the likes..

Still a work in progress, and certainly the above is likely to be confusing and definatly incomplete, but it actually works, and you have a HD 1080p capable palyer for $35 that you can control via dmx or e1.31