[rtmpdump] Parsing an RTMPE URL
Howard Chu
hyc at highlandsun.com
Sat Apr 10 07:40:37 CEST 2010
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.
More information about the rtmpdump
mailing list