Hello, So I've been experimenting with using librtmp (the latest version from svn) integrated into XBMC. For the most part things work well, but I've been having a problem trying to connect to a video URL from a flash based TV website in Canada named CTV (only accessible from Canada I believe). I should point out that I'm only having these problems because of the different URL format of the RTMPE streams. RTMP streams work fine, it is only the encrypted streams that fail, and as I said, I think it is because of the URL format, not an encryption issue. The complete URL looks like this (notice, I'm breaking it up across multiple lines to avoid 80 char line limits): rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 ?auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt &aifp=v001 &slist=/s_!ctv/shows/2010/03/31/ So I take this URL and programatically change it to this before it is passed to librtmp: rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=true auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt authflag=true app=ondemand tcUrl=/s_!ctv/shows/2010/03/31/ So this results in a connect packet like this being sent out: DEBUG: RTMP_Connect1, handshaked DEBUG2: RTMP_SendPacket: fd=21152, size=284 0000: 03 00 00 00 00 01 1c 14 00 00 00 00 ............ 0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?.... 0010: 00 00 00 03 00 03 61 70 70 02 00 08 6f 6e 64 65 ......app...onde 0020: 6d 61 6e 64 00 06 73 77 66 55 72 6c 02 00 24 68 mand..swfUrl..$h 0030: 74 74 70 3a 2f 2f 77 61 74 63 68 2e 63 74 76 2e ttp://watch.ctv. 0040: 63 61 2f 46 6c 61 73 68 2f 70 6c 61 79 65 72 2e ca/Flash/player. 0050: 73 77 66 00 05 74 63 55 72 6c 02 00 19 2f 73 5f swf..tcUrl.../s_ 0060: 21 63 74 76 2f 73 68 6f 77 73 2f 32 30 31 30 2f !ctv/shows/2010/ 0070: 30 33 2f 33 31 2f 00 04 66 70 61 64 01 00 00 0c 03/31/..fpad.... 0000: c3 . 0000: 63 61 70 61 62 69 6c 69 74 69 65 73 00 40 2e 00 capabilities.@.. 0010: 00 00 00 00 00 00 0b 61 75 64 69 6f 43 6f 64 65 .......audioCode 0020: 63 73 00 40 a8 ee 00 00 00 00 00 00 0b 76 69 64 cs.@.........vid 0030: 65 6f 43 6f 64 65 63 73 00 40 6f 80 00 00 00 00 eoCodecs.@o..... 0040: 00 00 0d 76 69 64 65 6f 46 75 6e 63 74 69 6f 6e ...videoFunction 0050: 00 3f f0 00 00 00 00 00 00 00 00 09 01 01 02 00 .?.............. 0060: 3b 64 62 45 62 7a 64 44 64 34 62 4c 63 4b 64 67 ;dbEbzdDd4bLcKdg 0070: 64 77 63 41 64 4b 63 7a 64 73 64 50 61 41 64 54 dwcAdKczdsdPaAdT 0000: c3 . 0000: 64 35 64 6b 2d 62 6c 57 61 71 61 2d 65 53 2d 69 d5dk-blWaqa-eS-i 0010: 59 47 2d 74 78 4e 34 74 6d 4b 43 74 YG-txN4tmKCt DEBUG: Invoking connect Unfortunately the response from the server is a connection reject message that looks like this: DEBUG2: RTMP_ReadPacket: fd=21152 0000: 03 00 00 00 00 00 78 14 00 00 00 00 ......x..... 0000: 02 00 06 5f 65 72 72 6f 72 00 3f f0 00 00 00 00 ..._error.?..... 0010: 00 00 05 03 00 05 6c 65 76 65 6c 02 00 05 65 72 ......level...er 0020: 72 6f 72 00 04 63 6f 64 65 02 00 1e 4e 65 74 43 ror..code...NetC 0030: 6f 6e 6e 65 63 74 69 6f 6e 2e 43 6f 6e 6e 65 63 onnection.Connec 0040: 74 2e 52 65 6a 65 63 74 65 64 00 0b 64 65 73 63 t.Rejected..desc 0050: 72 69 70 74 69 6f 6e 02 00 1b 5b 20 41 63 63 65 ription...[ Acce 0060: 73 73 4d 61 6e 61 67 65 72 2e 52 65 6a 65 63 74 ssManager.Reject 0070: 20 5d 20 3a 20 00 00 09 ] : ... DEBUG: RTMP_ClientPacket, received: invoke 120 bytes DEBUG: (object begin) DEBUG: Property: <Name: no-name., STRING: _error> DEBUG: Property: <Name: no-name., NUMBER: 1.00> DEBUG: Property: NULL DEBUG: Property: <Name: no-name., OBJECT> DEBUG: (object begin) DEBUG: Property: <Name: level, STRING: error> DEBUG: Property: <Name: code, STRING: NetConnection.Connect.Rejected> DEBUG: Property: <Name: description, STRING: [ AccessManager.Reject ] : > DEBUG: (object end) Now, I don't think the way this video service is unique in the way it uses auth, aifp, and slist params, I'm just hoping someone knows how to transform this URL format into a connect packet that will succeed. Any advice? Anony
Anony Mous wrote:
Hello,
So I've been experimenting with using librtmp (the latest version from svn) integrated into XBMC. For the most part things work well, but I've been having a problem trying to connect to a video URL from a flash based TV website in Canada named CTV (only accessible from Canada I believe). I should point out that I'm only having these problems because of the different URL format of the RTMPE streams. RTMP streams work fine, it is only the encrypted streams that fail, and as I said, I think it is because of the URL format, not an encryption issue. The complete URL looks like this (notice, I'm breaking it up across multiple lines to avoid 80 char line limits):
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 ?auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt &aifp=v001 &slist=/s_!ctv/shows/2010/03/31/
Looks like your slist= part of the URL is truncated here.
So I take this URL and programatically change it to this before it is passed to librtmp:
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=true auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt authflag=true app=ondemand tcUrl=/s_!ctv/shows/2010/03/31/
So this results in a connect packet like this being sent out:
Now, I don't think the way this video service is unique in the way it uses auth, aifp, and slist params, I'm just hoping someone knows how to transform this URL format into a connect packet that will succeed. Any advice?
That looks like a typical Akamai CDN URL. The librtmp auth= parameter is not what you think it is. I have no idea which CDN uses it, but Akamai definitely does not. For the most part, you should never use the auth= parameter. The correct URL for Akamai looks something like this: rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 Though I believe you also need to fix the filename and extension in this case: rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 (Not sure though. Try it both ways.) So the entire string to pass to librtmp should include rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfurl=whatever swfvfy=1 playpath=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 I don't think it should need anything else.
Hey Howard, Thanks for the info. I tried your suggestion (with & without the 'mp4:' prefix), but neither seemed to work. The first one looked like this: rtmpe://cp45924.edgefcs.net/ondemand ?fcs_vhost=cp45924.edgefcs.net &auth=dbEbUdPcIdjcZd9bTdycGafdObBaqb6bRdV-blWtBI-eS-iYG-uxF3roMCo &aifp=v001 &slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=1 playpath=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 with this as the sent data during the connect: DEBUG2: RTMP_SendPacket: fd=21112, size=557 0000: 03 00 00 00 00 02 2d 14 00 00 00 00 ......-..... 0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?.... 0010: 00 00 00 03 00 03 61 70 70 02 00 ab 6f 6e 64 65 ......app...onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 62 55 64 50 63 et&auth=dbEbUdPc 0050: 49 64 6a 63 5a 64 39 62 54 64 79 63 47 61 66 64 IdjcZd9bTdycGafd 0060: 4f 62 42 61 71 62 36 62 52 64 56 2d 62 6c 57 74 ObBaqb6bRdV-blWt 0070: 42 49 2d 65 53 2d 69 59 47 2d 75 78 46 33 72 6f BI-eS-iYG-uxF3ro 0000: c3 . 0000: 4d 43 6f 26 61 69 66 70 3d 76 30 30 31 26 73 6c MCo&aifp=v001&sl 0010: 69 73 74 3d 73 5f 21 63 74 76 2f 73 68 6f 77 73 ist=s_!ctv/shows 0020: 2f 32 30 31 30 2f 30 33 2f 33 31 2f 41 4c 4c 4d /2010/03/31/ALLM 0030: 59 43 48 2d 31 30 33 34 34 2d 45 50 2e 43 4c 49 YCH-10344-EP.CLI 0040: 50 30 31 2e 6d 70 34 00 06 73 77 66 55 72 6c 02 P01.mp4..swfUrl. 0050: 00 24 68 74 74 70 3a 2f 2f 77 61 74 63 68 2e 63 .$http://watch.c 0060: 74 76 2e 63 61 2f 46 6c 61 73 68 2f 70 6c 61 79 tv.ca/Flash/play 0070: 65 72 2e 73 77 66 00 05 74 63 55 72 6c 02 00 c7 er.swf..tcUrl... 0000: c3 . 0000: 72 74 6d 70 65 3a 2f 2f 63 70 34 35 39 32 34 2e rtmpe://cp45924. 0010: 65 64 67 65 66 63 73 2e 6e 65 74 2f 6f 6e 64 65 edgefcs.net/onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 62 55 64 50 63 et&auth=dbEbUdPc 0050: 49 64 6a 63 5a 64 39 62 54 64 79 63 47 61 66 64 IdjcZd9bTdycGafd 0060: 4f 62 42 61 71 62 36 62 52 64 56 2d 62 6c 57 74 ObBaqb6bRdV-blWt 0070: 42 49 2d 65 53 2d 69 59 47 2d 75 78 46 33 72 6f BI-eS-iYG-uxF3ro 0000: c3 . 0000: 4d 43 6f 26 61 69 66 70 3d 76 30 30 31 26 73 6c MCo&aifp=v001&sl 0010: 69 73 74 3d 73 5f 21 63 74 76 2f 73 68 6f 77 73 ist=s_!ctv/shows 0020: 2f 32 30 31 30 2f 30 33 2f 33 31 2f 41 4c 4c 4d /2010/03/31/ALLM 0030: 59 43 48 2d 31 30 33 34 34 2d 45 50 2e 43 4c 49 YCH-10344-EP.CLI 0040: 50 30 31 2e 6d 70 34 00 04 66 70 61 64 01 00 00 P01.mp4..fpad... 0050: 0c 63 61 70 61 62 69 6c 69 74 69 65 73 00 40 2e .capabilities.@. 0060: 00 00 00 00 00 00 00 0b 61 75 64 69 6f 43 6f 64 ........audioCod 0070: 65 63 73 00 40 a8 ee 00 00 00 00 00 00 0b 76 69 ecs.@.........vi 0000: c3 . 0000: 64 65 6f 43 6f 64 65 63 73 00 40 6f 80 00 00 00 deoCodecs.@o.... 0010: 00 00 00 0d 76 69 64 65 6f 46 75 6e 63 74 69 6f ....videoFunctio 0020: 6e 00 3f f0 00 00 00 00 00 00 00 00 09 n.?.......... DEBUG: Invoking connect If I use the 'mp4:' prefix, things look like this: rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net &auth=dbEcBdbbJdic7c3cXdPdhbTcocSafdaa3ax-blWtHY-eS-iYG-vxF2soLCw &aifp=v001 &slist=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=1 playpath=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 DEBUG2: RTMP_SendPacket: fd=21212, size=565 0000: 03 00 00 00 00 02 35 14 00 00 00 00 ......5..... 0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?.... 0010: 00 00 00 03 00 03 61 70 70 02 00 af 6f 6e 64 65 ......app...onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 63 42 64 62 62 et&auth=dbEcBdbb 0050: 4a 64 69 63 37 63 33 63 58 64 50 64 68 62 54 63 Jdic7c3cXdPdhbTc 0060: 6f 63 53 61 66 64 61 61 33 61 78 2d 62 6c 57 74 ocSafdaa3ax-blWt 0070: 48 59 2d 65 53 2d 69 59 47 2d 76 78 46 32 73 6f HY-eS-iYG-vxF2so 0000: c3 . 0000: 4c 43 77 26 61 69 66 70 3d 76 30 30 31 26 73 6c LCw&aifp=v001&sl 0010: 69 73 74 3d 6d 70 34 3a 73 5f 21 63 74 76 2f 73 ist=mp4:s_!ctv/s 0020: 68 6f 77 73 2f 32 30 31 30 2f 30 33 2f 33 31 2f hows/2010/03/31/ 0030: 41 4c 4c 4d 59 43 48 2d 31 30 33 34 34 2d 45 50 ALLMYCH-10344-EP 0040: 2e 43 4c 49 50 30 31 2e 6d 70 34 00 06 73 77 66 .CLIP01.mp4..swf 0050: 55 72 6c 02 00 24 68 74 74 70 3a 2f 2f 77 61 74 Url..$http://wat 0060: 63 68 2e 63 74 76 2e 63 61 2f 46 6c 61 73 68 2f ch.ctv.ca/Flash/ 0070: 70 6c 61 79 65 72 2e 73 77 66 00 05 74 63 55 72 player.swf..tcUr 0000: c3 . 0000: 6c 02 00 cb 72 74 6d 70 65 3a 2f 2f 63 70 34 35 l...rtmpe://cp45 0010: 39 32 34 2e 65 64 67 65 66 63 73 2e 6e 65 74 2f 924.edgefcs.net/ 0020: 6f 6e 64 65 6d 61 6e 64 3f 66 63 73 5f 76 68 6f ondemand?fcs_vho 0030: 73 74 3d 63 70 34 35 39 32 34 2e 65 64 67 65 66 st=cp45924.edgef 0040: 63 73 2e 6e 65 74 26 61 75 74 68 3d 64 62 45 63 cs.net&auth=dbEc 0050: 42 64 62 62 4a 64 69 63 37 63 33 63 58 64 50 64 BdbbJdic7c3cXdPd 0060: 68 62 54 63 6f 63 53 61 66 64 61 61 33 61 78 2d hbTcocSafdaa3ax- 0070: 62 6c 57 74 48 59 2d 65 53 2d 69 59 47 2d 76 78 blWtHY-eS-iYG-vx 0000: c3 . 0000: 46 32 73 6f 4c 43 77 26 61 69 66 70 3d 76 30 30 F2soLCw&aifp=v00 0010: 31 26 73 6c 69 73 74 3d 6d 70 34 3a 73 5f 21 63 1&slist=mp4:s_!c 0020: 74 76 2f 73 68 6f 77 73 2f 32 30 31 30 2f 30 33 tv/shows/2010/03 0030: 2f 33 31 2f 41 4c 4c 4d 59 43 48 2d 31 30 33 34 /31/ALLMYCH-1034 0040: 34 2d 45 50 2e 43 4c 49 50 30 31 2e 6d 70 34 00 4-EP.CLIP01.mp4. 0050: 04 66 70 61 64 01 00 00 0c 63 61 70 61 62 69 6c .fpad....capabil 0060: 69 74 69 65 73 00 40 2e 00 00 00 00 00 00 00 0b ities.@......... 0070: 61 75 64 69 6f 43 6f 64 65 63 73 00 40 a8 ee 00 audioCodecs.@... 0000: c3 . 0000: 00 00 00 00 00 0b 76 69 64 65 6f 43 6f 64 65 63 ......videoCodec 0010: 73 00 40 6f 80 00 00 00 00 00 00 0d 76 69 64 65 s.@o........vide 0020: 6f 46 75 6e 63 74 69 6f 6e 00 3f f0 00 00 00 00 oFunction.?..... 0030: 00 00 00 00 09 ..... DEBUG: Invoking connect I have to guess that the problem is with the app or tcUrl parameters in the connect packet. Because the failure happens as part of the connect, it hasn't even gotten far enough to to send the playpath. The app and tcUrl are the only important things I'm aware of in the connect packet. I know capabilities, audiocodecs, videocodecs and videofunction are in there, but they're pretty hard coded. There's also pageUrl, and I guess its possible I need to include that... but seems doubtful to me. Any other suggestions? Did I make a mistake somewhere along the way? BTW: I've gotten librtmp compiling under win32/VisualStudio2008. There were a bunch of edits made to allow things to compile under visual studio (it didn't like the implicit casts from void * that were done in librtmp). Would anyone be interested in taking these changes into svn? On 4/9/2010 11:40 PM, Howard Chu wrote:
Anony Mous wrote:
Hello,
So I've been experimenting with using librtmp (the latest version from svn) integrated into XBMC. For the most part things work well, but I've been having a problem trying to connect to a video URL from a flash based TV website in Canada named CTV (only accessible from Canada I believe). I should point out that I'm only having these problems because of the different URL format of the RTMPE streams. RTMP streams work fine, it is only the encrypted streams that fail, and as I said, I think it is because of the URL format, not an encryption issue. The complete URL looks like this (notice, I'm breaking it up across multiple lines to avoid 80 char line limits):
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
?auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt &aifp=v001 &slist=/s_!ctv/shows/2010/03/31/
Looks like your slist= part of the URL is truncated here.
So I take this URL and programatically change it to this before it is passed to librtmp:
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=true auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt authflag=true app=ondemand tcUrl=/s_!ctv/shows/2010/03/31/
So this results in a connect packet like this being sent out:
Now, I don't think the way this video service is unique in the way it uses auth, aifp, and slist params, I'm just hoping someone knows how to transform this URL format into a connect packet that will succeed. Any advice?
That looks like a typical Akamai CDN URL. The librtmp auth= parameter is not what you think it is. I have no idea which CDN uses it, but Akamai definitely does not. For the most part, you should never use the auth= parameter.
The correct URL for Akamai looks something like this:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
Though I believe you also need to fix the filename and extension in this case:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
(Not sure though. Try it both ways.)
So the entire string to pass to librtmp should include
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfurl=whatever swfvfy=1 playpath=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
I don't think it should need anything else.
FYI: Found this site which provides some interesting info about akamai streams: On 4/10/2010 8:57 PM, Anony Mous wrote:
Hey Howard,
Thanks for the info. I tried your suggestion (with & without the 'mp4:' prefix), but neither seemed to work. The first one looked like this:
rtmpe://cp45924.edgefcs.net/ondemand ?fcs_vhost=cp45924.edgefcs.net &auth=dbEbUdPcIdjcZd9bTdycGafdObBaqb6bRdV-blWtBI-eS-iYG-uxF3roMCo &aifp=v001 &slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=1 playpath=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
with this as the sent data during the connect:
DEBUG2: RTMP_SendPacket: fd=21112, size=557 0000: 03 00 00 00 00 02 2d 14 00 00 00 00 ......-..... 0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?.... 0010: 00 00 00 03 00 03 61 70 70 02 00 ab 6f 6e 64 65 ......app...onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 62 55 64 50 63 et&auth=dbEbUdPc 0050: 49 64 6a 63 5a 64 39 62 54 64 79 63 47 61 66 64 IdjcZd9bTdycGafd 0060: 4f 62 42 61 71 62 36 62 52 64 56 2d 62 6c 57 74 ObBaqb6bRdV-blWt 0070: 42 49 2d 65 53 2d 69 59 47 2d 75 78 46 33 72 6f BI-eS-iYG-uxF3ro 0000: c3 . 0000: 4d 43 6f 26 61 69 66 70 3d 76 30 30 31 26 73 6c MCo&aifp=v001&sl 0010: 69 73 74 3d 73 5f 21 63 74 76 2f 73 68 6f 77 73 ist=s_!ctv/shows 0020: 2f 32 30 31 30 2f 30 33 2f 33 31 2f 41 4c 4c 4d /2010/03/31/ALLM 0030: 59 43 48 2d 31 30 33 34 34 2d 45 50 2e 43 4c 49 YCH-10344-EP.CLI 0040: 50 30 31 2e 6d 70 34 00 06 73 77 66 55 72 6c 02 P01.mp4..swfUrl. 0050: 00 24 68 74 74 70 3a 2f 2f 77 61 74 63 68 2e 63 .$http://watch.c 0060: 74 76 2e 63 61 2f 46 6c 61 73 68 2f 70 6c 61 79 tv.ca/Flash/play 0070: 65 72 2e 73 77 66 00 05 74 63 55 72 6c 02 00 c7 er.swf..tcUrl... 0000: c3 . 0000: 72 74 6d 70 65 3a 2f 2f 63 70 34 35 39 32 34 2e rtmpe://cp45924. 0010: 65 64 67 65 66 63 73 2e 6e 65 74 2f 6f 6e 64 65 edgefcs.net/onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 62 55 64 50 63 et&auth=dbEbUdPc 0050: 49 64 6a 63 5a 64 39 62 54 64 79 63 47 61 66 64 IdjcZd9bTdycGafd 0060: 4f 62 42 61 71 62 36 62 52 64 56 2d 62 6c 57 74 ObBaqb6bRdV-blWt 0070: 42 49 2d 65 53 2d 69 59 47 2d 75 78 46 33 72 6f BI-eS-iYG-uxF3ro 0000: c3 . 0000: 4d 43 6f 26 61 69 66 70 3d 76 30 30 31 26 73 6c MCo&aifp=v001&sl 0010: 69 73 74 3d 73 5f 21 63 74 76 2f 73 68 6f 77 73 ist=s_!ctv/shows 0020: 2f 32 30 31 30 2f 30 33 2f 33 31 2f 41 4c 4c 4d /2010/03/31/ALLM 0030: 59 43 48 2d 31 30 33 34 34 2d 45 50 2e 43 4c 49 YCH-10344-EP.CLI 0040: 50 30 31 2e 6d 70 34 00 04 66 70 61 64 01 00 00 P01.mp4..fpad... 0050: 0c 63 61 70 61 62 69 6c 69 74 69 65 73 00 40 2e .capabilities.@. 0060: 00 00 00 00 00 00 00 0b 61 75 64 69 6f 43 6f 64 ........audioCod 0070: 65 63 73 00 40 a8 ee 00 00 00 00 00 00 0b 76 69 ecs.@.........vi 0000: c3 . 0000: 64 65 6f 43 6f 64 65 63 73 00 40 6f 80 00 00 00 deoCodecs.@o.... 0010: 00 00 00 0d 76 69 64 65 6f 46 75 6e 63 74 69 6f ....videoFunctio 0020: 6e 00 3f f0 00 00 00 00 00 00 00 00 09 n.?.......... DEBUG: Invoking connect
If I use the 'mp4:' prefix, things look like this:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net &auth=dbEcBdbbJdic7c3cXdPdhbTcocSafdaa3ax-blWtHY-eS-iYG-vxF2soLCw &aifp=v001 &slist=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=1 playpath=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
DEBUG2: RTMP_SendPacket: fd=21212, size=565 0000: 03 00 00 00 00 02 35 14 00 00 00 00 ......5..... 0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?.... 0010: 00 00 00 03 00 03 61 70 70 02 00 af 6f 6e 64 65 ......app...onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 63 42 64 62 62 et&auth=dbEcBdbb 0050: 4a 64 69 63 37 63 33 63 58 64 50 64 68 62 54 63 Jdic7c3cXdPdhbTc 0060: 6f 63 53 61 66 64 61 61 33 61 78 2d 62 6c 57 74 ocSafdaa3ax-blWt 0070: 48 59 2d 65 53 2d 69 59 47 2d 76 78 46 32 73 6f HY-eS-iYG-vxF2so 0000: c3 . 0000: 4c 43 77 26 61 69 66 70 3d 76 30 30 31 26 73 6c LCw&aifp=v001&sl 0010: 69 73 74 3d 6d 70 34 3a 73 5f 21 63 74 76 2f 73 ist=mp4:s_!ctv/s 0020: 68 6f 77 73 2f 32 30 31 30 2f 30 33 2f 33 31 2f hows/2010/03/31/ 0030: 41 4c 4c 4d 59 43 48 2d 31 30 33 34 34 2d 45 50 ALLMYCH-10344-EP 0040: 2e 43 4c 49 50 30 31 2e 6d 70 34 00 06 73 77 66 .CLIP01.mp4..swf 0050: 55 72 6c 02 00 24 68 74 74 70 3a 2f 2f 77 61 74 Url..$http://wat 0060: 63 68 2e 63 74 76 2e 63 61 2f 46 6c 61 73 68 2f ch.ctv.ca/Flash/ 0070: 70 6c 61 79 65 72 2e 73 77 66 00 05 74 63 55 72 player.swf..tcUr 0000: c3 . 0000: 6c 02 00 cb 72 74 6d 70 65 3a 2f 2f 63 70 34 35 l...rtmpe://cp45 0010: 39 32 34 2e 65 64 67 65 66 63 73 2e 6e 65 74 2f 924.edgefcs.net/ 0020: 6f 6e 64 65 6d 61 6e 64 3f 66 63 73 5f 76 68 6f ondemand?fcs_vho 0030: 73 74 3d 63 70 34 35 39 32 34 2e 65 64 67 65 66 st=cp45924.edgef 0040: 63 73 2e 6e 65 74 26 61 75 74 68 3d 64 62 45 63 cs.net&auth=dbEc 0050: 42 64 62 62 4a 64 69 63 37 63 33 63 58 64 50 64 BdbbJdic7c3cXdPd 0060: 68 62 54 63 6f 63 53 61 66 64 61 61 33 61 78 2d hbTcocSafdaa3ax- 0070: 62 6c 57 74 48 59 2d 65 53 2d 69 59 47 2d 76 78 blWtHY-eS-iYG-vx 0000: c3 . 0000: 46 32 73 6f 4c 43 77 26 61 69 66 70 3d 76 30 30 F2soLCw&aifp=v00 0010: 31 26 73 6c 69 73 74 3d 6d 70 34 3a 73 5f 21 63 1&slist=mp4:s_!c 0020: 74 76 2f 73 68 6f 77 73 2f 32 30 31 30 2f 30 33 tv/shows/2010/03 0030: 2f 33 31 2f 41 4c 4c 4d 59 43 48 2d 31 30 33 34 /31/ALLMYCH-1034 0040: 34 2d 45 50 2e 43 4c 49 50 30 31 2e 6d 70 34 00 4-EP.CLIP01.mp4. 0050: 04 66 70 61 64 01 00 00 0c 63 61 70 61 62 69 6c .fpad....capabil 0060: 69 74 69 65 73 00 40 2e 00 00 00 00 00 00 00 0b ities.@......... 0070: 61 75 64 69 6f 43 6f 64 65 63 73 00 40 a8 ee 00 audioCodecs.@... 0000: c3 . 0000: 00 00 00 00 00 0b 76 69 64 65 6f 43 6f 64 65 63 ......videoCodec 0010: 73 00 40 6f 80 00 00 00 00 00 00 0d 76 69 64 65 s.@o........vide 0020: 6f 46 75 6e 63 74 69 6f 6e 00 3f f0 00 00 00 00 oFunction.?..... 0030: 00 00 00 00 09 ..... DEBUG: Invoking connect
I have to guess that the problem is with the app or tcUrl parameters in the connect packet. Because the failure happens as part of the connect, it hasn't even gotten far enough to to send the playpath. The app and tcUrl are the only important things I'm aware of in the connect packet. I know capabilities, audiocodecs, videocodecs and videofunction are in there, but they're pretty hard coded. There's also pageUrl, and I guess its possible I need to include that... but seems doubtful to me.
Any other suggestions? Did I make a mistake somewhere along the way?
BTW: I've gotten librtmp compiling under win32/VisualStudio2008. There were a bunch of edits made to allow things to compile under visual studio (it didn't like the implicit casts from void * that were done in librtmp). Would anyone be interested in taking these changes into svn?
On 4/9/2010 11:40 PM, Howard Chu wrote:
Anony Mous wrote:
Hello,
So I've been experimenting with using librtmp (the latest version from svn) integrated into XBMC. For the most part things work well, but I've been having a problem trying to connect to a video URL from a flash based TV website in Canada named CTV (only accessible from Canada I believe). I should point out that I'm only having these problems because of the different URL format of the RTMPE streams. RTMP streams work fine, it is only the encrypted streams that fail, and as I said, I think it is because of the URL format, not an encryption issue. The complete URL looks like this (notice, I'm breaking it up across multiple lines to avoid 80 char line limits):
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
?auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt &aifp=v001 &slist=/s_!ctv/shows/2010/03/31/
Looks like your slist= part of the URL is truncated here.
So I take this URL and programatically change it to this before it is passed to librtmp:
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=true auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt authflag=true app=ondemand tcUrl=/s_!ctv/shows/2010/03/31/
So this results in a connect packet like this being sent out:
Now, I don't think the way this video service is unique in the way it uses auth, aifp, and slist params, I'm just hoping someone knows how to transform this URL format into a connect packet that will succeed. Any advice?
That looks like a typical Akamai CDN URL. The librtmp auth= parameter is not what you think it is. I have no idea which CDN uses it, but Akamai definitely does not. For the most part, you should never use the auth= parameter.
The correct URL for Akamai looks something like this:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
Though I believe you also need to fix the filename and extension in this case:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
(Not sure though. Try it both ways.)
So the entire string to pass to librtmp should include
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
swfurl=whatever swfvfy=1 playpath=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
I don't think it should need anything else.
_______________________________________________ rtmpdump mailing list rtmpdump@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/rtmpdump
ugh, sorry, hit ctrl+enter by accident before finishing the last message. As I was saying, this site provides some interesting debug info on akamai streams: http://support.akamai.com/flash/index.html From my URL, I got this output: =========== New Test #2 =========== [7] Date: Sat Apr 10 2010 [8] Time: 21:26:23 GMT-0600 [10] Flash version: WIN 10,0,45,2 [12] OS: Windows XP [13] Client IP: 96.52.60.62 [14] Override server IP: false [16] Stop after first good connection: true [44] Preferred buffer length: 3 seconds [45] Use fast start buffer: false [47] Raw source: rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4?auth=dbEd.bWbKdbdpdEcPdFaJbsatdsakaCcnd2-blWueB-eS-iYG-qvM2toEDs&aifp=v001&slist=/s_!ctv/shows/2010/03/31/ [49] Source type: AMD_ONDEMAND [51] Host name: cp45924.edgefcs.net [52] App name: ondemand [54] Stream name: s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 [72] Connection Auth Params: auth=dbEd.bWbKdbdpdEcPdFaJbsatdsakaCcnd2-blWueB-eS-iYG-qvM2toEDs&aifp=v001&slist=/s_!ctv/shows/2010/03/31/ [73] Making IDENT request to: http://cp45924.edgefcs.net/fcs/ident [395] IDENT request returned: 24.244.3.79 [816] Connect success on rtmpe:1935 after 306 ms [875] Found first good connection so stopping port/protocol testing [1483] NetStream.Play.Reset at 00:00 [1486] NetStream.Play.Start at 00:00 [1762] Metadata received: [1765] moovPosition : 55224402 [1768] aacaot : 2 [1777] width : 416 [1780] avcprofile : 77 [1783] audiocodecid : mp4a [1791] height : 312 [1795] videocodecid : avc1 [1798] trackinfo : [object Object],[object Object] [1806] duration : 739.563 [1809] videoframerate : 29.97 [1812] audiochannels : 2 [1815] audiosamplerate : 48000 [1823] avclevel : 31 [1849] NetStream.Buffer.Full at 00:00 Which would seem to indicate that my app parameter during connect needs to be 'ondemand'. Idea what the tcUrl needs to be, but at least its a start. On 4/10/2010 8:57 PM, Anony Mous wrote:
Hey Howard,
Thanks for the info. I tried your suggestion (with & without the 'mp4:' prefix), but neither seemed to work. The first one looked like this:
rtmpe://cp45924.edgefcs.net/ondemand ?fcs_vhost=cp45924.edgefcs.net &auth=dbEbUdPcIdjcZd9bTdycGafdObBaqb6bRdV-blWtBI-eS-iYG-uxF3roMCo &aifp=v001 &slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=1 playpath=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
with this as the sent data during the connect:
DEBUG2: RTMP_SendPacket: fd=21112, size=557 0000: 03 00 00 00 00 02 2d 14 00 00 00 00 ......-..... 0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?.... 0010: 00 00 00 03 00 03 61 70 70 02 00 ab 6f 6e 64 65 ......app...onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 62 55 64 50 63 et&auth=dbEbUdPc 0050: 49 64 6a 63 5a 64 39 62 54 64 79 63 47 61 66 64 IdjcZd9bTdycGafd 0060: 4f 62 42 61 71 62 36 62 52 64 56 2d 62 6c 57 74 ObBaqb6bRdV-blWt 0070: 42 49 2d 65 53 2d 69 59 47 2d 75 78 46 33 72 6f BI-eS-iYG-uxF3ro 0000: c3 . 0000: 4d 43 6f 26 61 69 66 70 3d 76 30 30 31 26 73 6c MCo&aifp=v001&sl 0010: 69 73 74 3d 73 5f 21 63 74 76 2f 73 68 6f 77 73 ist=s_!ctv/shows 0020: 2f 32 30 31 30 2f 30 33 2f 33 31 2f 41 4c 4c 4d /2010/03/31/ALLM 0030: 59 43 48 2d 31 30 33 34 34 2d 45 50 2e 43 4c 49 YCH-10344-EP.CLI 0040: 50 30 31 2e 6d 70 34 00 06 73 77 66 55 72 6c 02 P01.mp4..swfUrl. 0050: 00 24 68 74 74 70 3a 2f 2f 77 61 74 63 68 2e 63 .$http://watch.c 0060: 74 76 2e 63 61 2f 46 6c 61 73 68 2f 70 6c 61 79 tv.ca/Flash/play 0070: 65 72 2e 73 77 66 00 05 74 63 55 72 6c 02 00 c7 er.swf..tcUrl... 0000: c3 . 0000: 72 74 6d 70 65 3a 2f 2f 63 70 34 35 39 32 34 2e rtmpe://cp45924. 0010: 65 64 67 65 66 63 73 2e 6e 65 74 2f 6f 6e 64 65 edgefcs.net/onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 62 55 64 50 63 et&auth=dbEbUdPc 0050: 49 64 6a 63 5a 64 39 62 54 64 79 63 47 61 66 64 IdjcZd9bTdycGafd 0060: 4f 62 42 61 71 62 36 62 52 64 56 2d 62 6c 57 74 ObBaqb6bRdV-blWt 0070: 42 49 2d 65 53 2d 69 59 47 2d 75 78 46 33 72 6f BI-eS-iYG-uxF3ro 0000: c3 . 0000: 4d 43 6f 26 61 69 66 70 3d 76 30 30 31 26 73 6c MCo&aifp=v001&sl 0010: 69 73 74 3d 73 5f 21 63 74 76 2f 73 68 6f 77 73 ist=s_!ctv/shows 0020: 2f 32 30 31 30 2f 30 33 2f 33 31 2f 41 4c 4c 4d /2010/03/31/ALLM 0030: 59 43 48 2d 31 30 33 34 34 2d 45 50 2e 43 4c 49 YCH-10344-EP.CLI 0040: 50 30 31 2e 6d 70 34 00 04 66 70 61 64 01 00 00 P01.mp4..fpad... 0050: 0c 63 61 70 61 62 69 6c 69 74 69 65 73 00 40 2e .capabilities.@. 0060: 00 00 00 00 00 00 00 0b 61 75 64 69 6f 43 6f 64 ........audioCod 0070: 65 63 73 00 40 a8 ee 00 00 00 00 00 00 0b 76 69 ecs.@.........vi 0000: c3 . 0000: 64 65 6f 43 6f 64 65 63 73 00 40 6f 80 00 00 00 deoCodecs.@o.... 0010: 00 00 00 0d 76 69 64 65 6f 46 75 6e 63 74 69 6f ....videoFunctio 0020: 6e 00 3f f0 00 00 00 00 00 00 00 00 09 n.?.......... DEBUG: Invoking connect
If I use the 'mp4:' prefix, things look like this:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net &auth=dbEcBdbbJdic7c3cXdPdhbTcocSafdaa3ax-blWtHY-eS-iYG-vxF2soLCw &aifp=v001 &slist=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4 swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=1 playpath=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
DEBUG2: RTMP_SendPacket: fd=21212, size=565 0000: 03 00 00 00 00 02 35 14 00 00 00 00 ......5..... 0000: 02 00 07 63 6f 6e 6e 65 63 74 00 3f f0 00 00 00 ...connect.?.... 0010: 00 00 00 03 00 03 61 70 70 02 00 af 6f 6e 64 65 ......app...onde 0020: 6d 61 6e 64 3f 66 63 73 5f 76 68 6f 73 74 3d 63 mand?fcs_vhost=c 0030: 70 34 35 39 32 34 2e 65 64 67 65 66 63 73 2e 6e p45924.edgefcs.n 0040: 65 74 26 61 75 74 68 3d 64 62 45 63 42 64 62 62 et&auth=dbEcBdbb 0050: 4a 64 69 63 37 63 33 63 58 64 50 64 68 62 54 63 Jdic7c3cXdPdhbTc 0060: 6f 63 53 61 66 64 61 61 33 61 78 2d 62 6c 57 74 ocSafdaa3ax-blWt 0070: 48 59 2d 65 53 2d 69 59 47 2d 76 78 46 32 73 6f HY-eS-iYG-vxF2so 0000: c3 . 0000: 4c 43 77 26 61 69 66 70 3d 76 30 30 31 26 73 6c LCw&aifp=v001&sl 0010: 69 73 74 3d 6d 70 34 3a 73 5f 21 63 74 76 2f 73 ist=mp4:s_!ctv/s 0020: 68 6f 77 73 2f 32 30 31 30 2f 30 33 2f 33 31 2f hows/2010/03/31/ 0030: 41 4c 4c 4d 59 43 48 2d 31 30 33 34 34 2d 45 50 ALLMYCH-10344-EP 0040: 2e 43 4c 49 50 30 31 2e 6d 70 34 00 06 73 77 66 .CLIP01.mp4..swf 0050: 55 72 6c 02 00 24 68 74 74 70 3a 2f 2f 77 61 74 Url..$http://wat 0060: 63 68 2e 63 74 76 2e 63 61 2f 46 6c 61 73 68 2f ch.ctv.ca/Flash/ 0070: 70 6c 61 79 65 72 2e 73 77 66 00 05 74 63 55 72 player.swf..tcUr 0000: c3 . 0000: 6c 02 00 cb 72 74 6d 70 65 3a 2f 2f 63 70 34 35 l...rtmpe://cp45 0010: 39 32 34 2e 65 64 67 65 66 63 73 2e 6e 65 74 2f 924.edgefcs.net/ 0020: 6f 6e 64 65 6d 61 6e 64 3f 66 63 73 5f 76 68 6f ondemand?fcs_vho 0030: 73 74 3d 63 70 34 35 39 32 34 2e 65 64 67 65 66 st=cp45924.edgef 0040: 63 73 2e 6e 65 74 26 61 75 74 68 3d 64 62 45 63 cs.net&auth=dbEc 0050: 42 64 62 62 4a 64 69 63 37 63 33 63 58 64 50 64 BdbbJdic7c3cXdPd 0060: 68 62 54 63 6f 63 53 61 66 64 61 61 33 61 78 2d hbTcocSafdaa3ax- 0070: 62 6c 57 74 48 59 2d 65 53 2d 69 59 47 2d 76 78 blWtHY-eS-iYG-vx 0000: c3 . 0000: 46 32 73 6f 4c 43 77 26 61 69 66 70 3d 76 30 30 F2soLCw&aifp=v00 0010: 31 26 73 6c 69 73 74 3d 6d 70 34 3a 73 5f 21 63 1&slist=mp4:s_!c 0020: 74 76 2f 73 68 6f 77 73 2f 32 30 31 30 2f 30 33 tv/shows/2010/03 0030: 2f 33 31 2f 41 4c 4c 4d 59 43 48 2d 31 30 33 34 /31/ALLMYCH-1034 0040: 34 2d 45 50 2e 43 4c 49 50 30 31 2e 6d 70 34 00 4-EP.CLIP01.mp4. 0050: 04 66 70 61 64 01 00 00 0c 63 61 70 61 62 69 6c .fpad....capabil 0060: 69 74 69 65 73 00 40 2e 00 00 00 00 00 00 00 0b ities.@......... 0070: 61 75 64 69 6f 43 6f 64 65 63 73 00 40 a8 ee 00 audioCodecs.@... 0000: c3 . 0000: 00 00 00 00 00 0b 76 69 64 65 6f 43 6f 64 65 63 ......videoCodec 0010: 73 00 40 6f 80 00 00 00 00 00 00 0d 76 69 64 65 s.@o........vide 0020: 6f 46 75 6e 63 74 69 6f 6e 00 3f f0 00 00 00 00 oFunction.?..... 0030: 00 00 00 00 09 ..... DEBUG: Invoking connect
I have to guess that the problem is with the app or tcUrl parameters in the connect packet. Because the failure happens as part of the connect, it hasn't even gotten far enough to to send the playpath. The app and tcUrl are the only important things I'm aware of in the connect packet. I know capabilities, audiocodecs, videocodecs and videofunction are in there, but they're pretty hard coded. There's also pageUrl, and I guess its possible I need to include that... but seems doubtful to me.
Any other suggestions? Did I make a mistake somewhere along the way?
BTW: I've gotten librtmp compiling under win32/VisualStudio2008. There were a bunch of edits made to allow things to compile under visual studio (it didn't like the implicit casts from void * that were done in librtmp). Would anyone be interested in taking these changes into svn?
On 4/9/2010 11:40 PM, Howard Chu wrote:
Anony Mous wrote:
Hello,
So I've been experimenting with using librtmp (the latest version from svn) integrated into XBMC. For the most part things work well, but I've been having a problem trying to connect to a video URL from a flash based TV website in Canada named CTV (only accessible from Canada I believe). I should point out that I'm only having these problems because of the different URL format of the RTMPE streams. RTMP streams work fine, it is only the encrypted streams that fail, and as I said, I think it is because of the URL format, not an encryption issue. The complete URL looks like this (notice, I'm breaking it up across multiple lines to avoid 80 char line limits):
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
?auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt &aifp=v001 &slist=/s_!ctv/shows/2010/03/31/
Looks like your slist= part of the URL is truncated here.
So I take this URL and programatically change it to this before it is passed to librtmp:
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
swfUrl=http://watch.ctv.ca/Flash/player.swf swfVfy=true auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt authflag=true app=ondemand tcUrl=/s_!ctv/shows/2010/03/31/
So this results in a connect packet like this being sent out:
Now, I don't think the way this video service is unique in the way it uses auth, aifp, and slist params, I'm just hoping someone knows how to transform this URL format into a connect packet that will succeed. Any advice?
That looks like a typical Akamai CDN URL. The librtmp auth= parameter is not what you think it is. I have no idea which CDN uses it, but Akamai definitely does not. For the most part, you should never use the auth= parameter.
The correct URL for Akamai looks something like this:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
Though I believe you also need to fix the filename and extension in this case:
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=mp4:s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
(Not sure though. Try it both ways.)
So the entire string to pass to librtmp should include
rtmpe://cp45924.edgefcs.net/ondemand?fcs_vhost=cp45924.edgefcs.net&auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt&aifp=v001&slist=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
swfurl=whatever swfvfy=1 playpath=s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
I don't think it should need anything else.
_______________________________________________ rtmpdump mailing list rtmpdump@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/rtmpdump
Anony Mous wrote:
Hey Howard,
Thanks for the info. I tried your suggestion (with& without the 'mp4:' prefix), but neither seemed to work. The first one looked like this:
Then it's best to just stop guessing and use rtmpsrv or rtmpsuck to find out for sure.
BTW: I've gotten librtmp compiling under win32/VisualStudio2008. There were a bunch of edits made to allow things to compile under visual studio (it didn't like the implicit casts from void * that were done in librtmp). Would anyone be interested in taking these changes into svn?
Post what you've got. If it makes sense, we'll incorporate it.
On 11 April 2010 03:57, Anony Mous <anonymous247@gmail.com> wrote: [..]
I have to guess that the problem is with the app or tcUrl parameters in the connect packet. Because the failure happens as part of the connect, it hasn't even gotten far enough to to send the playpath. The app and tcUrl are the only important things I'm aware of in the connect packet. I know capabilities, audiocodecs, videocodecs and videofunction are in there, but they're pretty hard coded. There's also pageUrl, and I guess its possible I need to include that... but seems doubtful to me.
Any other suggestions? Did I make a mistake somewhere along the way?
If it helps there's some perl code that I'm told works for CTV here: http://github.com/monsieurvideo/get-flash-videos/blob/master/FlashVideo/Site... The important bit being where it makes @rtmpdump_commands, those parameters match the arguments to the command line rtmpdump.
Alright, so rtmpsrv did the trick. Fantastic utility! Perfect way to extract the otherwise encrypted connect data. About the only thing I would add is to have it output tcUrl. And ya, the parameters pretty much matched the perl code provided by Monsieur Video. Thanks so much to Howard and Monsieur Video. I'm going to spend some more time and tidy things up before offering up changes to allow visual studio builds. On that topic: this is going to sound stupid, but bear with me: did you guys intend to build the lib as straight C? or C++? Your makefile is invoking gcc, but it is unclear what language you're targeting. If C: then there are some places that seem to violate the declaration of variables rules in C. Visual Studio complained about that when first attempting to compile the *.c files as C code. ->This is the path I took locally<- If C++: then for easiest compiling under Visual Studio, the file extensions should be renamed from *.c to *.cpp, and a bunch of the implicit casts from void * need to be fixed up. Also, because the exported API doesn't actually use any C++ features, it would be easiest to wrap public headers in extern "C" {...}, as that will help with binary compatibility. Regardless of what language to target, I would suggest moving the public API headers to a separate "include" directory. Anyways, I'm rambling. On 4/11/2010 5:49 AM, Monsieur Video wrote:
On 11 April 2010 03:57, Anony Mous <anonymous247@gmail.com <mailto:anonymous247@gmail.com>> wrote: [..]
I have to guess that the problem is with the app or tcUrl parameters in the connect packet. Because the failure happens as part of the connect, it hasn't even gotten far enough to to send the playpath. The app and tcUrl are the only important things I'm aware of in the connect packet. I know capabilities, audiocodecs, videocodecs and videofunction are in there, but they're pretty hard coded. There's also pageUrl, and I guess its possible I need to include that... but seems doubtful to me.
Any other suggestions? Did I make a mistake somewhere along the way?
If it helps there's some perl code that I'm told works for CTV here: http://github.com/monsieurvideo/get-flash-videos/blob/master/FlashVideo/Site...
The important bit being where it makes @rtmpdump_commands, those parameters match the arguments to the command line rtmpdump.
_______________________________________________ rtmpdump mailing list rtmpdump@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/rtmpdump
Anony Mous wrote:
Alright, so rtmpsrv did the trick. Fantastic utility! Perfect way to extract the otherwise encrypted connect data. About the only thing I would add is to have it output tcUrl. And ya, the parameters pretty much matched the perl code provided by Monsieur Video.
Thanks so much to Howard and Monsieur Video.
I'm going to spend some more time and tidy things up before offering up changes to allow visual studio builds. On that topic: this is going to sound stupid, but bear with me: did you guys intend to build the lib as straight C? or C++? Your makefile is invoking gcc, but it is unclear what language you're targeting.
Sounds like you didn't read the ChangeLog. http://rtmpdump.mplayerhq.hu/ChangeLog 16 December 2009, v2.0 - rewrote everything else in C, reorganized to make it usable again as a library - fixed more portability bugs - plugged memory leaks
If C: then there are some places that seem to violate the declaration of variables rules in C. Visual Studio complained about that when first attempting to compile the *.c files as C code.
Obviously if we meant C++ we would have left the filenames as *.cpp, like they were in the 1.x code. The fact is, a lot of the conversion from C++ to C was done hastily, and so there's probably a lot I missed. But also, the code compiles with gcc, and I have no motivation to support Visual Studio. Again: you're welcome to submit your patch, I make no promises about using it.
Sounds like you didn't read the ChangeLog.
You're right. My apologies.
But also, the code compiles with gcc, and I have no motivation to support Visual Studio. Again: you're welcome to submit your patch, I make no promises about using it.
Understood.
participants (3)
-
Anony Mous -
Howard Chu -
Monsieur Video