philwilson.org

More on the BBC iPlayer and RTMP

30 December, 2007

There appears to be some work going on to try and get iPlayer working on the XBox Media Center according to this thread on their forums (thanks for the link, Iain) and although it only seems to make progress up to where I did, it does include this comment from Ian Forrester of backstage.bbc.co.uk (a terribly nice chap who I met at XTech 2007 in Paris, and who as it turns out used to DJ at a club I used to go to in Bristol) We’re happy for people to hack around for non-commercial uses. which is really good to hear.

Additionally, tonight I came across WiidiaPlayer which is built in MTASC, an open-source ActionScript 2.0 compiler written in OCaml and plays back RTMP streams. Wiidiaplayer is open source and that source is on Google Code. My initial tests haven’t been that successful, but they’ve only been ten minutes long 🙂

See other posts tagged with bbc general iplayer real and other posts made in December 2007.

Comments

Reinoud Elhorst
30 December, 2007 at 11:14

Hi Phil,

Please let me know if you have any problems with WiidiaPlayer, if it’s MTASC you’re having trouble with, it took me a couple of days myself to get it working.

The player part of WiidiaPlayer is nothing more though than what you can build using the FLash IDE; it still won’t allow you to download anything.

The solution to downloading is not that hard though: the WiidiaServer should be able to get you on your way there. The problem is that the wiidiaserver speaks only the server-part of the protocol, and you’d need the client part; still almost all that you need is there.

RTMP (for video) is nothing more than a handshake, a play command from the client, and an flv file hacked into pieces and padded with headers.

Come to think of it: probably the easiest way to save an RTMP stream is just to let it play in the browser, capture the stream into a file (not entirely sure how to do this, I’m sure a little hacking with tcpdump should do the trick), and then using a simple parser to filter out the bits that are flv (most of the code for that is there in the WiidiaServer).

I wouldn’t mind helping you on your way, but as I recall the iPlayer streams are ip-limited to the UK (I live in the Netherlands); still anything I can do, let me know!

Phil
30 December, 2007 at 14:03

Thanks for that Reinoud, some useful information.

FYI, your suggested method of download via playing in the browser and capturing it is exactly how one of the commercial tools I tested, Replay Media Catcher, does it.

The last time I did anything at all in Flash was in 2001, so it’s all very exciting. Still, if the RTMP stream is as simple as you suggest, maybe I should take a closer at the python client I earlier dismissed for incompleteness.

Mark McLaren
06 January, 2008 at 20:14

Hi Phil,

This is all very interesting. On the above xbmc thread I saw the entry by Strawp with the PHP script showing how to derive the
RTMP stream URL and thought that it might be fun to create a Firefox bookmarklet that does the same thing.

The resultant bookmarklet works on both the BBC iPlayer page variants (e.g. http://www.bbc.co.uk/iplayer/page/item/aaaaaaaa.shtml and http://www.bbc.co.uk/programmes/aaaaaaaa).

Get it here:

http://mark.mclaren.googlepages.com/iPlayer.html

Phil
07 January, 2008 at 10:13

Excellent! I’d planned to turn it into a Greasemonkey script, and you seem to have done all the work for me 🙂

Stuart Langridge
21 January, 2008 at 07:22

I shall be deeply, deeply pleased when Gnash can do this 🙂

Gareth
24 January, 2008 at 17:19

I tried pulling the curl modifications from Gnash that rob had done, but alas it kept crashing my computer, I didn’t have time to pin it down.

In other words, gnash is probably going to be the only way to do it.

Dan W
07 March, 2008 at 16:43

BBC just launched an iPhone version with h.264 streaming. Could be workable for xbmc

Phil
07 March, 2008 at 17:02

Interesting stuff, thanks Dan.

fx
19 March, 2008 at 01:20

I am working on an xbmc universal type plugin to incorporate many streaming video sources, but mostly from flash video sites. I came across hulu.com which also uses RTMP streams to stream their video. I googled and read bits from the rtmp threads at xbmc.org and of course this article you wrote. 🙂 I just wanted let you know that RTMP support on xbmc is wanted for more applications than bbc player, and what’s the xbmc status on adding this? I couldn’t find any kind of definite answer on the forums..

Thanks..

Phil
19 March, 2008 at 10:18

In summary: there hasn’t been any progress at all 🙂

Thijs Triemstra
20 March, 2008 at 00:16

We started a RTMP implementation for Python in the RTMPy project and made the first successful connection between the flash player and python a few days ago. This should make it easy to grab streams from iPlayer, or setup your own iPlayer service.

James Robinson
28 January, 2009 at 18:43

Can you please tell me if there is a diect rtmp link for BBC3 and BBC4? As there is an auth code after the @ number, how can I use Aplian FLV Media Player to play BBC3 and 4 etc? Please reply direct to e-mail address (genuine replies only please!). Thanks.