Audio/video stream recording forums
|
Attention Visitor: |
You may have to register or log in before you can post:
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
[tutorial] Using RTMPDUMP to download from BBC iPlayerRTMPdump.exe issues a request to the RTMP server for a connection, by sending a command including the requisit elements, thereby initiating the process of negotiating a connection. Such a command may be constructed using connection and authentication information obtained previously from the server by client software applications such as rtmpsrv.exe
In negotiating a connection, an RTMP server sends and receives a data stream containing multiple elements, as a single command sequence. An on-demand stream, using protocol 0 (not tunnelled, not encrypted), typically includes the following elements - A. For a Limelight server --protocol : Protocol types include 0 (RTMP), 1 (RTMPT) [Tunnelled], or 3 (RTMPE) [Encrypted] --host : server address (a.k.a. domain address) -a : authentication elements (the alternative --app may be used instead) Typically in the format - {application}?as={data}&av={data}&te={data}&mp={da ta}&et={data}&fmta-token={data} application: A path address. For example, a1414/e3 as : For example, as=adobe-hmac-sha256 av : For example, av=1 te : For example, te=connect mp : Typically, two or more comma-separated URL addresses, for alternative bitrate streams (mpeg format, mp3 or mp4) et : Typically, a ten-character number (numerical) fmta-token : Typically, a 64-character authentication (auth) string [i.e. an authentication token] (alphanumeric) -y : playpath (URL address of the desired bitstream, one of those specified in mp above) Typically, in the format mp3:{path}/{filename}.mp3 or mp4:{path}/{filename}.mp4 -o : Output filename The foregoing are typically the only elements (or "switches") that are essential to a connection, if neither Tunnelling nor Encryption are in use by the server. Although other elements may be encountered in practice, they are normally non-essential. Hence the following elements are typically sent by RTMPdump, as a single command line - rtmpdump --protocol 0 --host xxxxxxxx.fcod.llnwd.net -a path?as=data&av=data&te=data&mp=data&et=data&fmta-token=data -y mp4:URL/filename.mp4 -o file_mp4.flv The parts comprising the -a (or --app) element must be incorporated in it in the order shown above, as the sequence in which its parts are received by the RTMP server is critical. The authentication strings (et= and fmta-token=) contain session information, so will change on each fresh connection made to the server (which in practice typically means they will expire if a new session is begun, not literally on every attempt to resume a connection), but the other elements will not usually vary from session to session. B. For an Akamai server The command sequence is typically as above, except that the -a (authentication) string contains the following elements instead - auth : Typically, a 62-character authentication (auth) string [i.e. an authentication token] (alphanumeric) aifp : For example, aifp=v001 slist : Typically, the URL address of the stream Hence the following elements are typically sent by RTMPdump.exe, as a single command line - rtmpdump --protocol 0 --host xxxxxxx.edgefcs.net -a ondemand?auth=data&aifp=data&slist=data -y mp3:URL/filename -o file_mp3.flv The parts comprising the -a (or --app) element must be incorporated in it in the order shown above, as the sequence in which its parts are received by the RTMP server is critical. The authentication string (auth=) contains session information, so will change on each fresh connection made to the server (typically, if a new session is begun, e.g. the computer is restarted, not literally on every attempt to resume a connection). The other elements will not usually vary from session to session. Note - The above describes the simplified form, whereby the stream is first saved to the user's hard disk, to be played back thereafter in a media player capable of playing an FLV encoded file (H.263 or H.264 encoding), such as GOM Player. If it's desired, instead, to play the stream directly from the RTMP server, thus giving immediate playback, then additional elements will be needed in the command string including - -f : This specifies the version of the Flash plugin installed on the user's computer. For example, -f "WIN 9,0,260,0" [which indicates the user has the Windows version of Flash Player 9, release 260] -W : The capital W command. This is the URL address of the SWF player used to play the stream, as indicated by the web page from which the stream is derived. For example - http://www.bbc.co.uk/emp/9player.swf...on=18269_21576 EXAMPLES from the RADIO iPLAYER Here are two examples, from the BBC's Radio iPlayer. Both of these are for an on-demand ("Listen Again") file. These examples can't be used with a Live stream. (NB: In principle these would be similar with a TV show, but in practice are rather more complicated because there can be up to six bitstreams to deal with at each step. Also, a 50 minute TV show will result in a download of up to 800MB as compared with 30MB for a 30 minute radio show.) First, open the Playlist page (replace the 8 zero's with the 8 digit ID number from the URL of the page that plays the radio show in question):- http://www.bbc.co.uk/iplayer/playlist/00000000 Second, open the Media Selector page (replace the 8 zero's with the 8 digit Identifier from the Playlist page), as the Media Selector page contains all the information needed below:- http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000 A. The highest quality on-demand stream: AAC in MP4A in FLV - This is the command string suggested by rtmpsrv.exe - rtmpdump -r "rtmp://bbcmedia.fcod.llnwd.net:1935/a1414/e3?as=adobe-hmac-sha256&av=1&te=connect&mp=bbc7/secure_auth/modem/RBN2_bbc7_-_friday_2300_b00bf9yc_2010_09_10_22_55_13.mp4,bbc7/secure_auth/RBN2_bbc7_-_friday_2300_b00bf9yc_2010_09_10_22_54_46.mp4&et=1284234325&fmta-token=65d90a5b552fdded243f9a43bc2cebd4c9dd134c7b0a8970d6 46ebb8e3cd59e0" -a "a1414/e3?as=adobe-hmac-sha256&av=1&te=connect&mp=bbc7/secure_auth/modem/RBN2_bbc7_-_friday_2300_b00bf9yc_2010_09_10_22_55_13.mp4,bbc7/secure_auth/RBN2_bbc7_-_friday_2300_b00bf9yc_2010_09_10_22_54_46.mp4&et=1284234325&fmta-token=65d90a5b552fdded243f9a43bc2cebd4c9dd134c7b0a8970d6 46ebb8e3cd59e0" -f "WIN 9,0,260,0" -W "http://www.bbc.co.uk/emp/9player.swf?revision=18269_21576" -p "http://www.bbc.co.uk/iplayer/console/b00bf9z0/Old_Harrys_Game_Series_4_Episode_2" -y "mp4:bbc7/secure_auth/RBN2_bbc7_-_friday_2300_b00bf9yc_2010_09_10_22_54_46.mp4" -o RBN2_bbc7_-_friday_2300_b00bf9yc_2010_09_10_22_54_46.mp4 The above format works. But here is the simplified (i.e. more useful) format from my .BAT batch file - SET mp=bbc7/secure_auth/modem/RBN2_bbc7_-_wednesday_1300_b006v244_2010_08_25_13_00_33.mp4,b bc7/secure_auth/RBN2_bbc7_-_wednesday_1300_b006v244_2010_08_25_13_00_06.mp4 SET et=1282760597 SET fmta-token=7d9c1938f53e65d3a30a0d9e313a917d580ec0055ecfa5b9d4 5bb35dc1aa7593 SET identifier=mp4:bbc7/secure_auth/RBN2_bbc7_-_wednesday_1300_b006v244_2010_08_25_13_00_33.mp4 rtmpdump --protocol 0 --host bbcmedia.fcod.llnwd.net -a a1414/e3?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token% -y %identifier% -o output_mp4a.flv B. The MP3 on-demand stream: MP3 in FLV - This is the format from my .BAT batch file - set server=cp48188.edgefcs.net set auth=daEdwabaccObnascHdZbCb4d7cxcRanc5bf-bmI9Jl-bWG-DnmDCpwoIBvGqzD set aifp=v001 set slist=secure/bbc7/RBN2_bbc7_-_saturday_1000_b005yg5q_2010_09_11_12_36_00 set identifier=mp3:secure/bbc7/RBN2_bbc7_-_saturday_1000_b005yg5q_2010_09_11_12_36_00 rtmpdump --protocol 0 --host %server% -a ondemand?auth=%auth%&aifp=%aifp%&slist=%slist% -y %identifier% -o output_mp3.flv |
Tags: akamai, bbc, bbc iplayer, iplayer, limelight, rtmpdump, rtmpsrv |
Thread Tools | |
Display Modes | |
|
|