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}


_______________________________________________
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer

Reply via email to