Raspberry Pi, omxplayer and streaming
Charles Johnson
cehjohnson at gmail.com
Sat Jul 14 07:57:18 EDT 2012
I knocked the below up as i wanted to take advantage of the GPU in the
RPi to play tv streams. The idea was to stream it over the network and
receive and play it on my RPi.
Since omxplayer can't, for some reason, accept stdin as input, i had to
jump through some hoops.
I was wondering if any of you can see any possible better ways of doing
this. Also, there are some problems of the whole chain not dismantling
itself gracefully when the stream ends.
#!/bin/bash
# Stream prog into a TCP/IP socket so it can be connected to
# and read over a network
###############
# For Rpi + omxplayer, since the latter apparently
# can't read from stdin, we'll create a named pipe
# which can be given to omxplayer as a file name.
# This means we need another command on the Rpi receiver
# to read netcat into the named pipe, such as
# nc hostname port >named_pipe
# before we point omxplayer at the pipe
##############
# Port on which we listen
port=8888
# Which mode are we using?
mode_du_jour=flashvhigh1
if [ $# -eq 0 ]
then
echo "Usage: $(basename ${0}) <prog id>"
exit 1
fi
id=${1}
get_iplayer --stream "${id}" --mode=${mode_du_jour}
--flvstreamer=/usr/local/bin/rtmpdump --stdout | netcat -l -p ${port}
More information about the get_iplayer
mailing list