Update 5 November 2014

Installing Get_iplayer on Debian Wheezy Beta on the Raspberry Pi

Following on from my original posting on get_iplayer, which was installed on the Debian Squeeze distro for the Raspberry Pi, this is a set of instructions for the Wheezy beta release. It’s quite a bit simplified because we don’t need to bother with installing rpi-update, since most of the needed firmware updates are now incorporated into the distro. :-D That’s progress for you.

Starting point assumptions.

I’m assuming that you have an internet connected Raspberry Pi with SD card (4 Gb & up – 2Gb is not enough for compiling FFMPEG) booted up into a clean install of a Debian Wheezy distribution you got from the Raspberry Pi public beta announcement page. The current version at the time of writing is 2012-06-18-wheezy-beta.zip

If, you’re on Wheezy Beta, carry on with the instructions on this page.

sudo apt-get update

This will update your packages and may take a few minutes.

Next we need to install git, which is a version control system we will need to access the latest versions of various packages.

sudo apt-get install git-corey to confirm when prompted.

Install Packages

Now, let’s navigate to a known starting point

cd /home

and install a required perl package.

sudo apt-get install libwww-perly to confirm

We’re going to use git to get the files, install the get_iplayer files, then build (compile) and install rtmpdump and ffmpeg from the latest source code.

rtmpdump is used for recording the iplayer stream. ffmpeg is used for transcoding (repackaging) the resulting flv file into an mp4 wrapper – which means we can view it on our Pi with Omxplayer or XBMC etc

Now you will need to get hold of the latest version of get_iplayer…

sudo git clone git://git.infradead.org/get_iplayer.git

This will create a new folder called get_iplayer in your /home folder. All the get_iplayer files are in this folder. Let’s go there…

cd get_iplayer

we need to make the get_iplayer file itself writeable or it won’t work properly, so…

sudo chmod 777 get_iplayer

This changes its permissions so it can be read, written to and run by anyone.

Let’s get back to our home folder so we know where we are.

cd /home

Now we’re going to edit a file which contains the sources of debian repositories. We’ll do this with nano – a text editor.

sudo nano /etc/apt/sources.list

Then use the cursor keys to get to line 2 and add…

deb http://www.deb-multimedia.org/ wheezy main non-free

ThenCTRL-X to exity to confirm you want to saveenter to confirm the filename (don’t change it)

sudo apt-get update

It will update some package lists and give two errors. W: GPG error and W: Duplicate sources… We’ll deal with those next…

Build and Install rtmpdump

You will now see a some lines starting “gcc -Wall” and the process will take a few minutes. When it finishes, you’ve just compiled the latest version of rtmpdump. Now we need to install it…

sudo make install SYS=posix

You should then see some lines starting “cp” and “mkdir” as the files are copied over to their new homes. You have now compiled and installed rtmpdump. Congrats ;)

Test withrtmpdump -v
to check you are running the latest v2.4 (at the time of writing). Ignore the hostname error. We’ve got what we wanted. Onward.

Build and Install FFMPEG

Now I’ve got some good news and bad news for you. The good news is that our typing is nearly done. The bad news is that FFMPEG is quite a large, complex program and takes about 3.5 hours to compile on the Pi. But as long as you know this, you can plan round it, right?

Let’s get back to home so we don’t end up putting FFMPEG inside the rtmpdump build folder.cd /home

Now we need to install all the development libraries required to build FFMPEG. From sudo to libvorbis-dev is is all one line.sudo apt-get install libfaac-dev libmp3lame-dev libx264-dev libxvidcore-dev libgsm1-dev libtheora-dev libvorbis-dev

Now let’s get the FFMPEG files themselves.

sudo git clone git://source.ffmpeg.org/ffmpeg.git

This is quite a large download and will take a little while (10-20 mins). Once complete…

cd ffmpeg

Note that the following command from ./configure to --enable-nonfree is all one continuous command.

This will show you what it is doing as it goes. There will be lots of scary messages you don’t understand. Best go and do something else. And best run the “sudo make” directly on the Pi if you can. If you do it by ssh you’ll have to leave your other computer on and connected until it finishes.

Once compiled, the install is a fair bit faster (~2 minutes).sudo make install
sudo ldconfig

So we don’t stumble across permissions issues, if you are going to be logging in as a normal user (pi) rather than root, we need to give ourselves ownership of these directories…

It won’t work, for me, using the pi login without chowning the get_iplayer directory. I’m not 100% sure if it’s necessary to chown the ffmpeg and rtmpdump directories, but I can’t see it doing any harm.

Now your installation is finished, let’s try it out.

Starting using get_iplayer

Go to your get_iplayer directory

cd /home/get_iplayer
then./get_iplayer
If it tries to update and gives an error message, make sure you have full permissions on get_iplayersudo chmod 777 get_iplayer

Run get_iplayer and once it’s finished updating plugins etc. It will update the program list. You’ll know when that happens you will see about 1000 programmes displayed.

part of program list

Then you use it like this../get_iplayer keyword (substitute keyword for a keyword in a programme title)

This will result in a list of programmes (or none) with that keyword in. Make a note of your chosen programme’s ID number e.g. 460

Then, to download programme 460, type this

./get_iplayer --get 460 --modes=best

This will download the program at the best available resolution to your get_iplayer folder on your SD card, which you probably don’t want. I generally put my downloads on a USB memory stick. You can redirect the download wherever you like using…

-o /path/to/file-destination

so for me, with a USB stick mounted at /media/usbstick, the full command would be…

./get_iplayer --get 460 --modes=best -o /media/usbstick

All those flashhd etc. options ensure you download at the best available resolution.

Hello, Excellent tutorial and most appreciated (I can’t imagine how long it took to put together) but I’m stuck getting libfaac-dev. I got E: Unable to locate package libfaac-dev when trying to get it, but didn’t notice. Then I tried the “sudo ./configure blah blah” and didn’t get the warning about pkg-config not found as you mention, but that libfaac wasn’t found, so the “make” command failed.

I’ve tried sude get-apt libfaac-dev to no avail. Any ideas please (be gentle, I’m as green as you like).

Thanks, and thanks for bothering to put all of this together in the first place. Noobs like me would be knackered without your selflessness. :-)

Most people have left the Wheezy Beta behind since Raspbian came out in August. If you are in fact using Raspbian, you should follow these instructions, although you may well need to read the comments at the end of that page to get it fully up and running, as a few things have changed recently. Anyway – here’s the link…