[REQUEST] BBC iPlayer (Video) Plugin or Script?

  Thread Rating:
  • 7 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
paperclipmonkey Offline
Member
Posts: 56
Joined: Apr 2007
Reputation: 0
Post: #61
It seems like we have a lot of information to work with now that We have an experimental LibCurl over http and we have Gnash that has support for it.
It might be a challenge, but not too difficult, to merge xbmc version of Curl with the modified one, then try and implement the protocol not over http by using Gnash as a reference.
Anyone else think this is possible?
I don't see any other way of doing it at present.
find
cubicgarden Offline
Junior Member
Posts: 28
Joined: Apr 2006
Reputation: 0
Location: London
Wink   
Post: #62
Sounds like a plan...
find
Strawp Offline
Member
Posts: 77
Joined: Apr 2004
Reputation: 0
Post: #63
We just need one of the XBMC team to say they'll do it.
find
elupus Offline
Team-XBMC Developer
Posts: 3,799
Joined: Mar 2004
Reputation: 3
Post: #64
i'm more then happy to add support for RTMP in xbmc, but i've got no time nor interest (well mainly interest), to write a rtmp protocol client myself. i've not yet looked at gnash, but if the RTMP client part is reasonbly clean, maybe it isn't too hard to create a seperate library from it.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find
paperclipmonkey Offline
Member
Posts: 56
Joined: Apr 2007
Reputation: 0
Post: #65
That's brilliant elupus!
It would bring XBMC right up to the bleeding edge as a media center and maybe get some mythtv fans interested in switching (or checking out the linux port).
Thanks Very Much
Keep us posted
find
C-Quel Offline
Retired Team-Kodi Member
Posts: 1,375
Joined: Aug 2004
Reputation: 0
Post: #66
ahhh Eastenders on demand on the XBOX id never get the bloody girlfriend of my trusty black box Wink

Zotac ID89 + 4GB + 160GB Intel SSD + Samsung UE40D7000 + DS411+II / 2 x 3TB WD RED CAVIAR (TVHeadend Package + 4 Tuners) + Fibaro HC2 Home Automation Intergration!

^^^

Fucking awesome springs to mind :)

iNerd Store

iNerd Forum
find
Strawp Offline
Member
Posts: 77
Joined: Apr 2004
Reputation: 0
Post: #67
That would be fantastic - I think it would open up XBMC to scripting from other media sources too.
find
Strawp Offline
Member
Posts: 77
Joined: Apr 2004
Reputation: 0
Post: #68
elupus Wrote:i'm more then happy to add support for RTMP in xbmc, but i've got no time nor interest (well mainly interest), to write a rtmp protocol client myself. i've not yet looked at gnash, but if the RTMP client part is reasonbly clean, maybe it isn't too hard to create a seperate library from it.

Elupus: Just had a quick read of the source on Gnash - it's surprisingly brief (in libamf) http://cvs.savannah.gnu.org/viewvc/gnash...root=gnash

I hope you can get it in there! I've been looking around and I think taking RTMP support from Gnash is the only likely solution. There's the RTMPy project as well, but not only is that in Python, it doesn't look like it's working yet either.
find
Strawp Offline
Member
Posts: 77
Joined: Apr 2004
Reputation: 0
Post: #69
Sorry for spamming the thread, people!

Phil: You know we had the odd missing pages earlier? Well If you look on the HTML of the actual page the player is embedded on, you might find different versions of the same content. I'm looking at: http://www.bbc.co.uk/iplayer/page/item/b008mfcn.shtml

and there is javascript in there which adds an array of version info:

Code:
<script type="text/javascript">
    <!--
iplayer = {};
iplayer.host = "www.bbc.co.uk";
iplayer.flash_debug = false;
iplayer.prog = " The Shadow in the North";
iplayer.guidance = "";
iplayer.pid = 'b008mfcn';
iplayer.versions = [
  {
    type      : 'Original',
    pid       : 'b008mf9w',
    download  : [
      { start : new Date(2007, 11, 30, 22, 31, 00),
        end   : new Date(2008, 0, 06, 22, 29, 00)}
    ],
    streaming : [
      { start : new Date(2007, 11, 30, 22, 31, 00),
        end   : new Date(2008, 0, 06, 22, 29, 00)}
    ],
    filesize  : '950Mb'
  },
  {
    type      : 'Signed',
    pid       : 'b008q17j',
    download  : [
    ],
    streaming : [
    ],
    filesize  : 'Mb'
  }
];

    var year = 2008;
    var month = 01 - 1;
    iplayer.dateNow = new Date(year,month,02,01,26,15);
    iplayer.timeNow = iplayer.dateNow.getTime();
    
    addLoadEvent(function(){
        iplayer.authoriser.onload();
    });

    //-->
    </script>

If you try to request the mediaselector info for the same ID of that page, you get an error. If you go through the next ID down though, you can see it.
find
Strawp Offline
Member
Posts: 77
Joined: Apr 2004
Reputation: 0
Post: #70
OK, here's my quick-n-dirty script which takes a programme ID or iPlayer page and works out the RTMP stream URL from it. Designed to be run from the command line, first argument is your programme URL:

Code:
#!/usr/bin/php
<?php

  /*
    BBC iPlayer RTMP feed URL generator
    
    Pass URL or programme page, iplayer page or just programme ID, prints out RTMP feed URL.
  */
  // e.g. http://www.bbc.co.uk/iplayer/page/item/b008mfcn.shtml
  
  // Media selector base
  define( "MS_BASE", "http://www.bbc.co.uk/mediaselector/3/stream/check/iplayer?pid=" );
  define( "PLAYER_BASE", "http://www.bbc.co.uk/iplayer/page/item/" );
  
  if( !preg_match( "/([a-z0-9]{8})(\.shtml)?$/", $argv[1], $m ) ) die( "That doesn't look like a valid programme to me\n" );
  $pid = $m[1];
  
  // Refer back to the actual page to see if there are multiple versions of the content
  echo "Getting iPlayer page at ".PLAYER_BASE.$pid.".shtml...\n";
  $page = file_get_contents( PLAYER_BASE.$pid.".shtml" );
  if( preg_match( "/pid       : '([^']+)',/", $page, $m ) ){
    $pid = $m[1];
    echo "Set version PID as ".$pid."\n";
  }
  
  // Get media selector info
  echo "Getting data from ".MS_BASE.$pid."...\n";
  $ms_data = file_get_contents( MS_BASE.$pid );
  
  $aVars = array( "token", "identifier", "server" );
  
  // Get all the vars from the media selector XML
  foreach( $aVars as $var ){
    if( preg_match( "/<".$var.">([^<]+)<\/".$var.">/", $ms_data, $m ) ){
      $$var = $m[1];
      echo $var.": ".$$var."\n";
    }
  }
  
  $auth = 'auth=' . $token . '&aifp=v001&slist=' . $identifier;
  
  // Get the ident
  /*
  echo "Getting IP address from ident info from http://".$server."/fcs/ident...\n";
  $ident = file_get_contents( "http://".$server."/fcs/ident" );
  echo $ident."\n\n";
  
  if( preg_match( "/<ip>([^<]+)<\/ip>/", $ident, $m ) ){
    $ip = $m[1];
    echo "IP: ".$ip."\n";
  }
  */
  // For some reason the above takes ages, and this doesn't seem to vary, so hard code for the moment...
  $ip = "217.243.192.45";
  
  // RTMP and port 1935 are defaults of the actual application
  $url = "rtmp://".$ip.':1935/ondemand?_fcs_vhost='.$server."&".$auth;
  
  echo "\nStream URL:\n".$url."\n";
  
?>

I'll port that to Python and get it running on XBMC once I know I can play the URL that comes out the other end. I have nothing which can play or record RTMP (under linux) right now so I don't know if the URLs will just work. I'll dust off my XP machine tomorrow and give Orbit or similar a run in the OS it was designed for Tongue
find
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 10
Location: Sweden
Question   
Post: #71
Strawp Wrote:Elupus: Just had a quick read of the source on Gnash - it's surprisingly brief (in libamf) http://cvs.savannah.gnu.org/viewvc/gnash...root=gnash

I hope you can get it in there! I've been looking around and I think taking RTMP support from Gnash is the only likely solution.
Again, I'm not a programmer myself but I noticed that as well Nod
http://www.gnu.org/software/gnash/manual...ource.html
http://www.gnu.org/software/gnash/manual..._8cpp.html
http://www.gnu.org/software/gnash/manual..._8cpp.html
http://wiki.gnashdev.org/wiki/index.php/RTMP/AMF/SOL
http://osflash.org/documentation/rtmp

The questions left then is how and where in XBMC it should be implemented? ...assuming that XBMC's own DVDPlayer video-playback core will be the prefered player for RTMP streams then should the RTMP client code from Gnash be implemented for it via libcurl, or as a new separate library (IE. "libamf" or "librtmp"), or should it just be directly implemented into FFmpeg?, ...or is there a other alternative way?

Confused

I believe that there are advantages and advantages with each. IMHO to directly implemented that code or library into FFmpeg is probably the best choose, however if we then like to submit a such patch upstream (to try to hand over maintenance of that client to the FFmpeg project) know that the FFmpeg developers are kind of strict on what they will implement, it has to be really clean and module code.

Eek

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find
PhilWilson Offline
Junior Member
Posts: 5
Joined: Dec 2007
Reputation: 0
Post: #72
Strawp - excellent work. I absolutely hadn't noticed the multiple PIDs in the actual page. Assuming your code works, this should give us a reliable method of actually determining the stream URL for download using whatever. Ace.
find
cubicgarden Offline
Junior Member
Posts: 28
Joined: Apr 2006
Reputation: 0
Location: London
Thumbs Up   
Post: #73
I wanted to just add what I wrote to the backstage list recently. The last part should be of interest to you guys working on the XBMC & Wii living near London.

Quote:Just in case anyone missed it, there's a bunch of developers trying to bring BBC iPlayer content to the Xbox1 and Wii. The main thread can be found here - http://forum.xbmc.org/showthread.php?tid=27063

I spoke to our iPlayer team and I can mention a couple of things.

1. The ability to play BBC iplayer content via a Xbox360 using the media extender system is being considered and maybe be turned on in the near future. This means Dan and CW in these threads will be very happy - http://thegreenbutton.com/forums/thread/225653.aspx
http://thegreenbutton.com/forums/post/225836.aspx

2. We are looking to build iplayer for the Wii, iPhone and others by the end of this quarter. But with the device experience in mind.

3. My thoughts about bringing the iplayer to other devices was correct. If you don't break the DRM on the download version, re-transcode the streaming version, make the content available outside of the UK (break the GeoIP) and finally not screw with the actual content streams. Your able to build what you like, for any platform under the backstage licence.

4. Last but not least, we would like to invite some of the developers working on iPlayer for other devices into the BBC, so you can talk openly about what your doing. The iplayer team would attend and would love to show you what there also working on too. Who knows maybe we could help each other?

So if your building a iplayer for an exotic device platform, do get in touch.

Cheers

Ian Forrester

This e-mail is: [] private; [] ask first; [x] bloggable

Senior Producer, BBC Backstage
find
Strawp Offline
Member
Posts: 77
Joined: Apr 2004
Reputation: 0
Post: #74
PhilWilson Wrote:Strawp - excellent work. I absolutely hadn't noticed the multiple PIDs in the actual page. Assuming your code works, this should give us a reliable method of actually determining the stream URL for download using whatever. Ace.

Still haven't booted up my XP box and tested if the URLs it produces actually work. The multiple PID thing is something about signed and unsigned versions of the same programme. I don't know what significance this is (cubicgarden, you must know what this is?) but I think new programmes first appear as unsigned and then a little while later the signed one appears, which is why when you came back to your notes it appeared to be wrong.

Does one of the people with a high post count here know who'd do a good job getting the GUI in XBMC for this? For me the fun part was taking the player apart and seeing how it works.

cubicgarden: I'd love an excuse to have a meeting with the Beeb tech guys. No idea what I could tell them that they don't already know though. IMO the best thing that the Beeb could do right now is to create an open source RTMP library and submit it back the mplayer project so an open source iplayer could be created. I bet they've heard this multiple times from plenty of different groups though.
find
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 10
Location: Sweden
Wink   
Post: #75
Strawp Wrote:Does one of the people with a high post count here know who'd do a good job getting the GUI in XBMC for this?
Maybe Nuka1195 or Blittan would volunteer if a few other guys (like yourselves) helped activly. Best is probably if you try asking them directly.

Strawp Wrote:IMO the best thing that the Beeb could do right now is to create an open source RTMP library and submit it back the mplayer project so an open source iplayer could be created.
...or simpler and more likely just switch over to using FLV over HTTP (instead of RTMP), or even better standard MPEG-4 ASP (H.263) or MPEG-4 AVC (H.264) over HTTP, ...or even DivX (DivX, Inc.) if they want a commercial solution, as they are still so much more open source friendly than Adobe.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2008-01-04 23:20 by Gamester17.)
find
Thread Closed