Watching ustream.tv streams on a Raspberry Pi

Watching ustream.tv streams on a Raspberry Pi

I’ve got xbmc installed on my 512Mb Raspberry Pi Model B and although it can play live ustream streams via an add-on it seems rather bloated for the simple job I want it to do.

Having recently bought a Raspberry Pi Model B+ I wanted to install basic raspbian and just enough components to view streams from the command line. ┬áIt took a bit of trial and error and internet searching to work out exactly what packages I needed to install so for next time I need the information and in case it helps somebody else I’m sharing the procedure here.

  • Copy Raspbian onto an SD card using a method of your choice (in my case using dd on OS X)
  • Boot up and update Raspbian
sudo apt-get update && sudo apt-get upgrade
  • Install rtmpdump and python-pip
sudo apt-get install rtmpdump python-pip
  • Install livestreamer
sudo pip install livestreamer

At this point you can use livestreamer to watch ustream but you may find that only the low res mobile streams are available because python-librtmp isn’t installed.

To install python-librtmp you need to do the following:

sudo apt-get install python-dev
sudo apt-get install libffi-dev
sudo apt-get install librtmp-dev
sudo pip install cffi
sudo pip install python-librtmp

You can now watch the streams at the highest quality available with the following command

livestreamer ustream.tv/channel/streamid best -np 'omxplayer -o hdmi -live'

(Replace streamid with the name of the stream you want to watch)

Livestreamer docs are here – http://livestreamer.tanuki.se