Wednesday, July 24, 2013

Multicast HDHomeRun Content with VLC

Below is bash script to tune your HDHomeRun device to a channel and multicast the video with VLC. You can then consume the video throughout your house or business with XBMC clients or VLC clients.

Copy and paste the script into your favorite editor. Update the HDHOMERUN variable with your device's ID. Save the script. I named mine Make the script executable chmod +x Execute the script passing the tuner number (0 through 2 for HDHomeRun Prime), the EIA channel number, and the program number. For example: ./ 0 73 2.

# Tune HDHomeRun and multicast the video
# Example ./ 0 73 2
if [[ -z "$TUNER" ]]
 echo "Missing the tuner number. Please pass a tuner number."
 exit 1
if [[ -z "$CHANNEL" ]]
 echo "Missing a channel. Please pass a channel number."
 exit 1
if [[ -z "$PROGRAM" ]]
 echo "Missing program number. Please pass a program number."
 exit 1
echo "Setting HDHomeRun device: $HDHOMERUN to channel: $CHANNEL program: $PROGRAM"
hdhomerun_config $HDHOMERUN set /tuner$TUNER/channel $CHANNEL
hdhomerun_config $HDHOMERUN set /tuner$TUNER/program $PROGRAM
hdhomerun_config $HDHOMERUN save /tuner$TUNER - | cvlc --sout udp: -
hdhomerun_config $HDHOMERUN set /tuner$TUNER/channel none

You'll need the HDHomeRun configure command. If running Ubuntu you can get it with: sudo apt-get install hdhomerun-config.

To consume the video using VLC open a network stream to URL: udp://@ To consume the video using XBMC use steps 1 and 3 from my Multicast Video to XBMC using VLC blog post.

Post a Comment