User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 6:46 am

Hi,

Anyway, my Raspberry Pi has turned up! I haven't been this excited since I went to got my Amiga.

I've got a plan to use the Pi as a low power, always on device, which will download the latest tv & radio shows from BBC iPlayer so I can watch / listen later.

I have managed to get get_iplayer (http://linuxcentre.net/getiplayer) running on the Pi and downloading streams from BBC iPlayer.

Ive posted the setup process on my blog (http://stuffaboutcode.blogspot.co.uk/20 ... m-bbc.html), Ive seen a few people mention using get_iplayer on the forum, so I thought I'd share...

LHIS
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 7:34 am

That's very cool - looking forward to having a play with it later!
Director of Communications, Raspberry Pi

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 12:48 pm

You really need a big hard disk or nas as it can fill up the disk space very quickly.

E
Posts: 143
Joined: Thu Sep 29, 2011 7:30 pm

Re: Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 2:35 pm

Very nice :)

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 8:11 pm

Exellent. I've got this running on a Ubuntu box (Pentium4) - thought it might be a bit intense on the Pi. What res files are you streaming? Mine streams 832 x 462 flv which it then converts to mp4 (rather quickly). Does the Pi handle that?
Alex Eames RasPi.TV, RasP.iO

Ogoshi
Posts: 46
Joined: Wed Dec 28, 2011 5:13 pm
Location: Southend-on-Sea, Essex, England

Re: Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 8:18 pm

Thanks for the guide, unfortunately everything I try to download throws up an error!:

(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Failed to open file! /media/Raspi/Downloads/get_iplayer-2.80/Click_-_19_05_2012_b01j8n5p_default.partial.mp4.flv
INFO: Command exit code 1 (raw code = 256)
WARNING: Failed to stream file /media/Raspi/Downloads/get_iplayer-2.80/Click_-_19_05_2012_b01j8n5p_default.partial.mp4.flv via RTMP
INFO: skipping flashhigh1 mode
INFO: Trying flashhigh2 mode to record tv: Click - 19/05/2012
INFO: File name prefix = Click_-_19_05_2012_b01j8n5p_default

any takers?!

btw, perl-libwww should be libwww-perl and you also have to make get_iplayer writable so I ran "sudo chmod 777 get_iplayer" which seemed to work, hopefully none of these variatons from your guide are causing this issue!

**edit**
ignore that, had to make the entire directory writable.
Thanks again, seems to be downloading fine :-)

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 8:45 pm

Thank Ogoshi. I've updated the guide. Weirdly I remembered about making get_iplayer executable while shopping... Funny how the mind works.

I'm surprised I only missed out a couple of things, I wrote it from memory...
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Sat May 26, 2012 10:10 pm

Actually perl-libwww worked just fine for me on my install.

The only problem I had was that because I'm running only a 2 Gig SD card, I wanted to save the file on a memory stick and ran into write permission issues. Solved it eventually by running the ./get_iplayer command as sudo - then it let me write to the memory stick.

Can't quite explain why it downloaded Have I got news for you as 640 x 360 instead of 1280 x 720 on my Ubuntu machine. Must be something in the setup I guess?

Edit to add: There are four additional modes (flashhd1, flashhd2, flashvhigh1 & flashvhigh2) on the Ubuntu install, which haven't appeared on this version. I wonder if there is a way we can activate/get/install them to take advantage of the Pi's HD capability? ISTR when I installed the Ubuntu version I added something afterwards from one of the get_iplayer mailing list guys' personal git - it may be a bit more bleeding edge than 2.80?
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Sun May 27, 2012 2:18 pm

Finally found out what I put on my ubuntu machine to make it do the get_iplayer HD thing. :)

It was this 2.80+n18-gitace42f3-ppa5
I think it came from here https://launchpad.net/~jon-hedgerows/+a ... er-testing

But this is a Ubuntu release. I'm trying to figure out how to implement it on the Pi - I have a feeling that it might not be totally straightforward.

Trouble is I can't even remember how I installed it on the Ubuntu machine. I believe Jon Davies answered a forum post somewhere and I followed the instructions in that - but can no longer find the forum post. Think I'll have to join the get_iplayer mailing list and ask how we would go about getting this onto the Pi. Unless any of you clever people know what to do?
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

And the solution is...

Sun May 27, 2012 9:51 pm

Really simple solution - and it works. Thanks to dinkypumpkin from the Get_iplayer list.

If a programme is available in HD, just add

Code: Select all

--tvmode=flashhd,flashvhigh,flashhigh,flashnormal
to the end of your get_iplayer command and it will download the best available version.

I've just downloaded the HD (720p) version of Have I Got News for You, which was my test file. Good news is that the transcoding didn't take very long at all - just a few minutes.

I've now created a root password as I got fed up with all the sudoing and read-write permissions for memory sticks.

It's much more sensible (in my opinion) to put these files on an external drive or stick because I will be watching them with OpenELEC or Raspbmc using another SD card.

In the end, the full command to achieve this was...

Code: Select all

./get_iplayer --get 372 --force ----tvmode=flashhd,flashvhigh,flashhigh,flashnormal -o /media/usbstick
Having previously mounted the usb stick to /media/usbstick

where 372 was the programme id number
--force was needed because I'd previously downloaded that programme
-o allows you to specify the location to record the file to
Alex Eames RasPi.TV, RasP.iO

yeahbox
Posts: 36
Joined: Sun May 27, 2012 10:35 pm
Location: Manchester, UK

Re: Got get_iplayer downloading from BBC iPlayer

Mon May 28, 2012 12:35 am

This is my first post on the forum, so have patience :)

I've been using get-iplayer for some time now on another linux machine and getting it to work on the RasPi was quite straight forward using the debian distro.

First, run

Code: Select all

pi@raspberrypi:~$ sudo apt-get update
to make sure all packages are up to date. It might complain something about double sources (mine did), just run "sudo apt-get update" again

Now, we install the debian version of the packages we need:

Code: Select all

pi@raspberrypi:~$ sudo apt-get install get-iplayer ffmpeg git
We also install git because we want to fetch the latest source from the get-iplayer folks (yes, we want to live on the edge). After the installation is done we could start using get-iplayer but it won't work because the version from debian (2.78) is too old. Even the official 2.80 version is too old. That's why we need to use git to get the latest bleeding edge version.

Create a folder somewhere, for example in your home folder:

Code: Select all

pi@raspberrypi:~$ mkdir get_iplayer_source
pi@raspberrypi:~$ cd get_iplayer_source
pi@raspberrypi:~/get_iplayer_source$ 
now we check out the latest code:

Code: Select all

pi@raspberrypi:~/get_iplayer_source$ git clone git://git.infradead.org/get_iplayer.git
Now comes the sneaky part. All we (by "we" I mean "I") really need is the get-iplayer perl script. So we can copy the new version of the perl script to the place were the old version is. What we don't get is the correct man pages and if someone else knows the proper way of updating please add a comment.

Rename the old script so that we can keep it in case we need it and copy the new:

Code: Select all

pi@raspberrypi:~/get_iplayer_source$ sudo mv /usr/bin/get-iplayer /usr/bin/get-iplayer_1_78
pi@raspberrypi:~/get_iplayer_source$ sudo cp get_iplayer/get_iplayer /usr/bin/
note that it is the _script_ and not the whole folder that we are copying.

This should do it. I tried to download a program and it worked just fine. I haven't watch it play on my RasPi since I only have SSH access to it. Did the mistake of buying a Texet keyboard that just won't work so I haven't even logged in locally yet :)

The syntax for get-iplayer is well documented in the man pages (man get-iplayer) but because of the hack above the man pages are for version 2.78 and we are using 2.80 and also it is the latest development version. There is an excellent mailing list that I suggest people to join if they have further questions. Also as mentioned above I would recommend to use an external drive to download to since these video files really take up a lot of space and also to keep that poor SD card from blowing up.

Just as a final note, this is the command line that I use:

Code: Select all

get-iplayer --subtitles --thumb --thumbsize 6 --metadata generic -s --tvmode flashhd,flashvhigh --radiomode flashaachigh,flashaacstd --file-prefix="<nameshort>-<senum>-<episodeshort>" --get 130

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Mon May 28, 2012 11:48 am

Thanks yeahbox. Good post. :D
I'm using my Pi a lot through SSH because it's so easy to copy and paste commands :lol:
I bet you never type all that last command line from scratch?
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Mon May 28, 2012 5:23 pm

Just spotted a mistake in my post http://www.raspberrypi.org/phpBB3/viewt ... 317#p85317 above. The second command should not have ---- in it where it says ----tvmode=flashhd should just be --tvmode=flashhd
Alex Eames RasPi.TV, RasP.iO

Charax
Posts: 11
Joined: Tue Apr 03, 2012 1:16 pm

Re: Got get_iplayer downloading from BBC iPlayer

Mon May 28, 2012 6:14 pm

It's been a long time since I played with get_iplayer, do the community-maintained versions still have the funky web GUI? running that from the Pi would be brilliant

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Tue May 29, 2012 1:27 pm

It does indeed have the web GUI and it runs a treat on the Pi. You need to run the get_iplayer.cgi script using the following command:

perl get_iplayer.cgi --port=1935 --getiplayer=/path/to/get_iplayer

Then just point your browser to http://<IP of PI>:1935/
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

madproforg
Posts: 1
Joined: Wed May 30, 2012 5:05 pm

Re: Got get_iplayer downloading from BBC iPlayer

Wed May 30, 2012 5:08 pm

Updating the man page takes another two commands

Code: Select all

gzip get_iplayer.1
sudo cp get_iplayer.1.gz /usr/share/man/man1/

robwriter
Posts: 114
Joined: Sat Feb 25, 2012 6:26 pm

Re: Got get_iplayer downloading from BBC iPlayer

Wed May 30, 2012 5:43 pm

Not sure if this is obvious - but I found the video files that GetIplayer produces on my desktop play fine on the Pi.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Wed May 30, 2012 5:48 pm

robwriter wrote:Not sure if this is obvious - but I found the video files that GetIplayer produces on my desktop play fine on the Pi.
Using OpenELEC, Omxplayer or XBMC? Or something else? H-264 MP4s should work fine on the Pi, but other formats may be problematic.
Alex Eames RasPi.TV, RasP.iO

yeahbox
Posts: 36
Joined: Sun May 27, 2012 10:35 pm
Location: Manchester, UK

Re: Got get_iplayer downloading from BBC iPlayer

Wed May 30, 2012 7:49 pm

alexeames wrote:
robwriter wrote:Not sure if this is obvious - but I found the video files that GetIplayer produces on my desktop play fine on the Pi.
Using OpenELEC, Omxplayer or XBMC? Or something else? H-264 MP4s should work fine on the Pi, but other formats may be problematic.
I've tried omxplayer with some files that was previously downloaded as "flashhd" and "flashvhigh" and they played nice without hickups. I don't have an audio receiver that can take HDMI but video is playing nice on the screen and the audio is also playing on the analog jack on the RasPi. The quality of the analog output is not good but it works and it is certainly usable.

robwriter
Posts: 114
Joined: Sat Feb 25, 2012 6:26 pm

Re: Got get_iplayer downloading from BBC iPlayer

Wed May 30, 2012 9:32 pm

In RaspMC - looking at the files I see they're H-264 MP4's so obviously they're fine, I had it my head they were a different format.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Wed May 30, 2012 9:48 pm

robwriter wrote:In RaspMC - looking at the files I see they're H-264 MP4's so obviously they're fine, I had it my head they were a different format.
I think they are streamed as .flv wrapped round H-264 MP4, but get_iplayer uses FFMPEG after the download to strip away the flash wrapper (not sure I've got the terms right, but I think you get the idea.) :)
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Sat Jun 02, 2012 8:38 pm

I've got my get_iplayer setup on the Raspberry Pi with the latest versions of RTMPdump and FFMPEG. It's now very robust and resumes well from timeouts. I found, before fully updating, that if the download would time out (RTMPdump) then the whole process would hang and have to be killed from an ssh session on a different machine. A bit inconvenient really.

I've now documented the whole process on a new blog I've just started.
You can find it here http://raspi.tv/2012/get_iplayer-full-i ... om-scratch

It's designed to be as complete as possible, such that a total Linux beginner should be able to do this install successfully. At least, that's my aim. Feel free to have a look and leave a comment on the blog or report back here if you try it out.
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Thu Jun 21, 2012 9:48 am

For anyone interested in installing Get_iplayer on the new Wheezy beta distro, the instructions are different from the previous post. It's a bit simpler in wheezy. I've made a new blog entry here...

http://raspi.tv/2012/get_iplayer-instal ... heezy-beta
Alex Eames RasPi.TV, RasP.iO

xxxstarmanxxx
Posts: 42
Joined: Fri Sep 16, 2011 3:35 pm
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Thu Jun 21, 2012 10:05 am

Heres a tip for getting the best available download via get_iplayer.

Rather than probing the schedule number to find out what formats are avaiable for the programme you need just use the following command:

--modes=best

This will download 720p if available for the programme or flashhd if not
Example:
get_iplayer --get 200 --modes=best

Justin :)

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Got get_iplayer downloading from BBC iPlayer

Thu Jun 21, 2012 10:30 am

xxxstarmanxxx wrote:Heres a tip for getting the best available download via get_iplayer.

Rather than probing the schedule number to find out what formats are avaiable for the programme you need just use the following command:

--modes=best

This will download 720p if available for the programme or flashhd if not
Example:
get_iplayer --get 200 --modes=best

Justin :)
Excellent - thanks - that saves some typing :)
Alex Eames RasPi.TV, RasP.iO

Return to “Media centres”