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.

Difference between revisions of "Raspberry Pi Media Player"

From wiki.openlighting.org

Jump to: navigation, search
m (Peternewman moved page Rasberry PI Media Player to Raspberry Pi Media Player: SPaG)
m (SPaG/Formatting)
 
Line 1: Line 1:
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.
+
Being stuck at home definitely 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 )..
+
Instructions:
(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 );
+
#Raspberry Pi model B, 4GB Class 4 SD card ( I'm using a SanDisk one )..
 +
#Used Raspbian Operating System. ( Raspbian is Debian Linux built for Raspberry Pi ).. I'm sure you can use something else if you want
 +
#Installed Open Lighting Architecture ( www.opendmx.net )
  
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.
+
Media playback is via omxplayer ( its part of the Raspbian build );
  
omxplayer file.mp4 ; there are some other options like -o hdmi to play audio via the hdmi, etc, check the man pages
+
To play a file, it's pretty simple.. You'll obviously need to copy a file to the machine 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..
 
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 )
+
Set up a FIFO:
 +
mkfifo /tmp/cmd
  
 
Start up omxplayer with a redirect
 
Start up omxplayer with a redirect
  
omxplayer file.mp4 < /tmp/cmd it will just sit there;
+
omxplayer file.mp4 < /tmp/cmd it will just sit there;
  
then via the fifo send it some key press's
+
then via the fifo send it some key presses
  
aka;
+
e.g.:
  
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.
+
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
 
send it another 'p' and it will play
  
echo -n p >/tmp/cmd
+
echo -n p >/tmp/cmd
 
 
  
ok, so thats not Dmx controlled.. thats where OLA_trigger comes in.
+
OK, so that's not DMX controlled.. that's where ola_trigger comes in.
  
OLA trigger lets you run arbitory commands based on the values of DMX data coming in..  
+
OLA trigger lets you run arbitrary commands based on the values of DMX data coming in..  
http://www.opendmx.net/index.php/OLA_DMX_Trigger
+
[[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..
+
Unfortunately 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
 
Config file looks like this
  
1 128-255 mycommands
+
1 128-255 mycommands
  
 
Shell script is really simple and looks like this;
 
Shell script is really simple and looks like this;
  
 +
echo -n p >/tmp/cmd
  
echo -n p >/tmp/cmd
+
You also of course need to have configured the universes in OLA.. Then from your favourite 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..
 
 
 
 
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
+
Still a work in progress, and certainly the above is likely to be confusing and definitely incomplete, but it actually works, and you have a HD 1080p capable player for $35 that you can control via DMX or e1.31

Latest revision as of 17:24, 28 December 2013

Being stuck at home definitely 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.

Instructions:

  1. Raspberry Pi model B, 4GB Class 4 SD card ( 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 something 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, it's pretty simple.. You'll obviously need to copy a file to the machine 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 presses

e.g.:

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 that's not DMX controlled.. that's where ola_trigger comes in.

OLA trigger lets you run arbitrary commands based on the values of DMX data coming in.. OLA_DMX_Trigger

Unfortunately 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 the universes in OLA.. Then from your favourite 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 definitely incomplete, but it actually works, and you have a HD 1080p capable player for $35 that you can control via DMX or e1.31