View Single Post
  #3  
Old 04-07-2011, 02:43 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

iPlayer


The BBC iPlayer uses similar techniques for all streams that it serves, regardless of whether the show is tv or radio.

One important common factor is that all its Flash streams use RTMP, never RTMPE. Another is that all its Flash streams are either Akamai or Limelight.

All its Akamai streams use basically the same format, and all its Limelight streams also use a common format; so once you know what these two basic formats are, you can fairly easily cope with almost any iPlayer flash stream.

The tv streams look superficially more daunting, simply because there are many more streams. Radio - like all audio - has only one choice, between mono or stereo. But tv can be served up as 4:3 or 16:9, etc, and can use a bewildering range of video bitrates, depending on how low definition a picture you want to watch.


BBC Radio -

Playlist page:

http://www.bbc.co.uk/iplayer/playlist/00000000

To open the Playlist page you need the 8-digit ID number (PID) from the iPlayer webpage!

[NB: That 8-digit number is in the URL (the page address) of the page that plays the show]

Media Selector page:

http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000

To open the Media Selector page you need the 8-digit Identifier from the Playlist page!

[NB: You need the Identifier from the section marked: 128Kbps aac]


MP4 (Limelight server) : MP4A (AAC) in FLV, 128 Kbps -

File is: AAC+LC - 44,100 - 128 kbps - Stereo - 16bit

Uses only six switches:
-r : rtmp address (protocol + server + port + application + authString)
-a : application (application + authString) [duplicated from -r]
-y : Identifier (mp4 plaYpath) [duplicated from authString]
-p : Page address (iPlayer console page) [NB: Non-essential]
-f : Flash version installed [NB: Non-essential]
-W : sWf player address [NB: Non-essential]


Details from Console page -

Examples:
set page=http://www.bbc.co.uk/iplayer/console/________
set swf=http://www.bbc.co.uk/emp/9player.swf?revision=18269_21576


Details from Media Selector page -

Examples:

1. Details that never change

set protocol=rtmp
set server=bbcmedia.fcod.llnwd.net
set port=1935
set application=a1414/e3

2. Contents of authString (as, av & te never change)

set as=adobe-hmac-sha256
set av=1
set te=connect
set mp=bbc7/secure_auth/modem/_________________.mp4,bbc7/secure_auth/___________________.mp4
set et=__________
set fmta-token=____________________________________________ ____________________

3. The Playpath (mp4 URL)
set identifier=mp4:bbc7/secure_auth/RBN2_bbc7_-_________________________________________.mp4


Command -

rtmpdump -r "%protocol%://%server%:%port%/%application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=% et%&fmta-token=%fmta-token%" -a "%application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et= %et%&fmta-token=%fmta-token%" -f "WIN 9,0,280,0" -W "%swf%" -p "%page%" -y "%identifier%" -o output.flv

Notes:
1. If no port is specified, the download will still work!
2. The -p switch is NOT essential, the download will still work if it's omitted!
3. The -f switch is NOT essential, the download will still work if it's omitted!
4. The -W switch is NOT essential, the download will still work if it's omitted!
5. The -p, -f and -W switches are all derived from the iPlayer's Console page, which plays the stream aloud, so they are not needed where the stream is being downloaded instead of played. [NB: Even a completely *wrong* -p, -f or -W switch will NOT break the download!]
6. The entire -r switch after the : can be omitted, as all its functions are contained in the -a switch.
7. The entire -r switch before the : can be replaced by --protocol & --host switches.
8. The order of the authString elements in the -a switch can NOT be altered; the download fails if those elements are included in an out-of-order sequence.
9. The mp= switch must contain both of the secure_auth links: dial-up AND broadband; select the active one in the -y switch. [NB: Even though the dial-up URL (48Kbps) is not selected in the -y switch, it MUST be correct in the -a switch or the download fails!]
10. Sometimes the only way to get a connection is to remove the "modem" (i.e. dial-up) secure_auth alternative URL from both the -r switch and the -a switch.
11. By replacing the strings et= and fmta-token= in -r and in -a with current versions (obtained by refreshing the Media Selector page), it is possible to get an earlier version of the file than the default version, e.g. the 8am instead of the 7pm, if you have the URL address of the earlier version for the -a and -y switches.
12. To resume a partially completed download add: --resume [NB: Unfortunately, this useful option does NOT work with all the current iPlayer streams.]
To resume faster (the default timeout is 120 seconds) add: --timeout 10
13. Handshake type mismatch: a WARNING is not an ERROR. A type 6 request can validly get 6, 8 or 9 in the reply. Other values would probably indicate an actual problem.


This is the bare bones Command:

rtmpdump --protocol 0 --host %server% -a %application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=% et%&fmta-token=%fmta-token% -y %identifier% -o output_mp4.flv

Notes:
1. Contains only details from the Media Selector page.
2. In Win9x must be run from a PIF with Initial Environment of 1024 KB.



MP4 (Limelight server) : MP4A (AAC) in FLV, 96 kbps [Modem alternative] -

File is: AAC+SBR - 44,100 - 96 kbps - Stereo - 16bit


Details from Media Selector page -

1. Details that never change
set server=bbcmedia.fcod.llnwd.net
set application=a1414/e3

2. Contents of authString (as, av & te never change)
set as=adobe-hmac-sha256
set av=1
set te=connect
set mp=bbc7/secure_auth/modem/_________________.mp4,bbc7/secure_auth/___________________.mp4
set et=__________
set fmta-token=____________________________________________ ____________________

3. The Playpath (mp4 URL) (Modem version)
set identifier=mp4:bbc7/secure_auth/modem/RBN2_bbc7_-___________________________________.mp4


rtmpdump --protocol 0 --host %server% -a %application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=% et%&fmta-token=%fmta-token% -y %identifier% -o output_aac_128kbps_modem_mp4.flv


MP3 (Akamai server) : MP3 in FLV, 128 Kbps -

Details from Media Selector page -

1. Details that never change
set server=cp48188.edgefcs.net

2. Contents of authString (aifp never changes)
set auth=_____________________________________________ _________________
set aifp=v001
set slist=secure/bbc7/RBN2_bbc7_________________________________________ ____

3. The Playpath (mp3 URL)
set identifier=mp3:secure/bbc7/RBN2_bbc7_________________________________________ ____


This is the bare bones Command:

rtmpdump --protocol 0 --host %server% -a ondemand?auth=%auth%&aifp=%aifp%&slist=%slist% -y %identifier% -o output_mp3.flv

Notes:
1. Contains only details from the Media Selector page.
2. In Win9x must be run from a PIF with Initial Environment of 1024 KB.


Live stream (Akamai server) : MP4A (AAC) in FLV -

Details from Media Selector page -
http://www.bbc.co.uk/mediaselector/4/mtis/stream/bbc_7

1. Details that never change
set server=cp60691.live.edgefcs.net
set identifier=Radio_7_UK@s6464

2. Details from authString
set auth=_____________________________________________ _________________
set slist==_________________________


This is the bare bones Command:

rtmpdump --live --protocol 0 --host %server% -a live?auth=%auth%&aifp=v001&slist=%slist% -y %identifier%?auth=%auth%&aifp=v001&slist=%slist% -o output_live_mp4.flv

Notes:
1. Contains only details from the Media Selector page.
2. In Win9x must be run from a PIF with Initial Environment of 1024 KB.
Reply With Quote