XBMC BBC iPlayer Plugin

March 19th, 2008

xbmc iplayer plugin - jamie thompson - web developer

I’m sure the BBC won’t approve of this but within the last few days an XBMC plugin for the BBC iPlayer has been released for general consumption. Though it’s far from a finished product, it neatly lists and plays the H.264 encoded iPlayer streams designed for the Apple iPhone.

The BBC’s provision of non-DRM MPEG streams only for iPhone users has sparked widespread controversy not least because they have previously stated and continue to take the line that non-DRM versions can not be made available for legal reasons, meaning those wanting to download and watch iPlayer content are forced to use Microsoft Windows.

BBC iPlayer programmes specify the dates for which they are valid and
whether the programme is available for download at all.

In the interest of common decency, the [XBMC iPlayer plugin] should store and honour these
values – deleting programmes once they expire. – Developer of the XBMC iPlayer Plugin

So, just what argument can the BBC come up with to justify referring to projects such as this as ‘hacking’?

The XBMC iPlayer plugin looks like the first step on a promising path toward the British public being permitted to use an actual TV to watch the programming that they’re forced to pay for. Here’s hoping that this trend continues, and sets a precedent for the abandonment of pointless applications of badly executed DRM.

Posted in Rants | Tagged with: , , , ,

13 Responses

  1. Matt

    Hi, Would just like to say thanks, have just installed it and have been thoroughly impressed. Thanks very much for your hard work! ;)

  2. Jamie

    I’d just like to point out that i didn’t write the XBMC plugin. PLease forward your love in the direction of this guy

  3. james clarke

    Hi,

    “The XBMC iPlayer plugin looks like the first step on a promising path toward the British public being permitted to use an actual TV to watch the programming that they’re forced to pay for. Here’s hoping that this trend continues, and sets a precedent for the abandonment of pointless applications of badly executed DRM.”

    Kinda of incorrect. You’re not ‘paying’ for the iPlayer. If you don’t have a TV and only use the iPlayer, you don’t have to pay the license fee.

    See http://tinyurl.com/66mmok for details :)

    I’m also kind of miffed that this plugin no longer works (according to google code).

  4. Jamie

    It’s very interesting to see that the official line is no TV no TV license. It has been suggested in various arenas (one of those being the BBC Backstage mailing list) that the introduction of the iPlayer service is part of a plot to enforce TV licences on anyone who has an internet connection. But this obviously isn’t (currently) the case.

    Sorry to hear the iPLayer plugin is b0rked. I’ve never really used it since playing around with it initially. I tend to just use a perl script to dump mp4 streams direct to a share accessible by my xbox. With a bit of work the script can also pull down preview images from the BBC programmes service as they use the same naming convention across both services, but i watch so little TV lately that i’ve not really bothered.

  5. Jamie

    update: As of this month it appears that even my method will fail. although it is still possible to freely download the mp4 streams, the BBC have started encoding them so that they can only be played on Apple devices. Make of that what you will.

    This from http://beebhack.wiki.com

    From early June 2008, the BBC changed the mechanism used to encode their videos for the iPhone/iPod Touch. Although downloading via spoofing still works, the downloaded files will not play on any common desktop software. It is possible that a DRM scheme has been applied to the previously unencrypted H.264 video.

    A look at the video file headers suggests that the audio is now encoded by libfaac (1.26.1 unstable). Although no DRM scheme has been formally identified, the most likely candidate is Fairplay, which is built into QuickTime and the iPhone.

    In fact the DRM appears to be a simple XOR of a large section of the plain vanilla MP4 with a repeating two-byte pattern. Specifically, the first 0×2800 bytes are unchanged, then the next bytes are XOR’d with values beginning 0×3c, 0×53, 0×3c, etc., then the last 0×400 bytes are unchanged. Just to make things interesting the two bytes immediately before the last 0×400 clean ones are XOR’d with reversed values. So (for example) the file is XOR’d with 0, 0,..(0×2800 times).., 0×3c, 0×53, …. ,0×3c, 0×53, 0×3c, 0×53, 0×53, 0×3c, 0, 0, ..(0×400 times)… To recover the original file, just XOR again with these values.

  6. Banjo

    Thanks for the precise description of the encryption, however what is the decoding algorithm for a file with an odd number of bytes in length.

    I’ve come up with the following code fro decryption, but not sure what to do with byte n-403

    Is this correct?

    (i=0;i++<0×2800;ch=get(*in))
    put(*out,ch);
    (;i<n-403;i++)
    {
    ch=get(*in);
    i++;
    put(*out,ch ^ 0×3c);
    ch=get(*in);
    put(*out,ch ^ 0×53);
    }
    if (n%2=1)
    {
    ch=get(*in);
    i++;
    put(*out,ch ^ 0×3c);
    }
    ch=get(*in); i++ ; put(*out,ch ^ 0×53);
    ch=get(*in); i++ ; put(*out,ch ^ 0×3c);
    (;i++<n,ch=get(*in))
    put(*out,ch);

  7. Jamie

    take a look here

  8. Duke

    I’m afraid I can’t boast the same success as Matt, I installed the latest scripts but they just generate a few more .py files and do nothing more. Running the script via XBMC simply changes it’s state to ‘running’ for a moment then back again. :( Any ideas?

  9. Jamie Thompson

    To be honest. I haven’t used the plugin for a long time. I find it much simpler to use getiplayer to dump shows to a share accessible to my xbmc.

  10. Andy

    get_iplayer seems to work with linux installed xboxes only. Can youa ctually stream to xbmc using this ?

  11. Jamie Thompson

    Sorry I should have been more precise. I run get_iplayer on my (linux) machine to dump the files to a a samba share which my XBMC can see.

    The mp4’s that come down from iplayer are streamable in as much as you can play them whilst they’re still downloading

  12. Linuxcentre

    The mp4’s aren’t actually streamable as you download them, in get_iplayer I’ve had to relocate the ‘moov atom’ at the end of the quicktime stream to the beginning of the downloaded mov file which then makes it streamable before the entire file is downloaded.

  13. Derrick Sanders

    The BBC Iplayer is great, but looks impossible to download anything

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.