Kevin Vance - Speaking RTMP

Entries | Archive | Friends | Friends' Friends | User Info

03:57 pm

Speaking RTMP

Wednesday, September 13th, 2006
Previous Entry Share Next Entry

There! I can speak RTMP, thanks to this reversed RTMP specification jpeg and this AMF python library. That was not hard at all, and I don't know anything about flash or ActionScript. Why hasn't someone already done this yet? Anyway:

>>> c = rtmpclient.RTMPConnection('81.52.133.208')
>>> c.connect()
>>> c.call(0, 'connect', 1.0, {'app':'ondemand', 'flashVer':'WIN 8,0,22,0', 'swfUrl': 'http://video.scifi.com/embed/300/embedded.swf', 'tcUrl': 'rtmp://cp23371.edgefcs.net:1935/ondemand', 'fpad': False, 'audioCodecs': 615, 'videoCodecs': 76, 'pageUrl': 'http://www.scifi.com/battlestar/'})

I don't parse the responses yet, but it appears to work:

00000C41  5f 72 65 73 75 6c 74 00  3f f0 00 00 00 00 00 00 _result. ?.......
00000C51  05 03 00 05 6c 65 76 65  6c 02 00 06 73 74 61 74 ....leve l...stat
00000C61  75 73 00 04 63 6f 64 65  02 00 1d 4e 65 74 43 6f us..code ...NetCo
00000C71  6e 6e 65 63 74 69 6f 6e  2e 43 6f 6e 6e 65 63 74 nnection .Connect
00000C81  2e 53 75 63 63 65 73 73  00 0b 64 65 73 63 72 69 .Success ..descri
00000C91  70 74 69 6f 6e 02 00 15  43 6f 6e 6e 65 63 74 69 ption... Connecti
00000CA1  6f 6e 20 73 75 63 63 65  65 64 65 64 2e 00 00 09 on succe eded....
Link )Reply )

Comments
[User Picture]From: rspeed
2006-09-14 01:58 am (UTC)
Oh shit, there's some hex on my LJ friends page!
(Reply) (Thread)
[User Picture]From: dormando
2006-09-14 06:36 pm (UTC)
Hmm... I wanted to write an RTMP proxy in perl (for work). Think you can share the wealth later? :) Would make it a bit easier.
(Reply) (Thread)
[User Picture]From: kvance
2006-09-15 03:02 pm (UTC)
Sure thing. But it may be of limited use, since I intend to implement as little of RTMP as possible. I suggest checking out the Red5 server, since they are much closer to a complete implementation.
(Reply) (Parent) (Thread)
[User Picture]From: dormando
2006-09-17 09:01 pm (UTC)
I had a hard time working through Red5... I'll probably check through the code again when I get down to business.
(Reply) (Parent) (Thread)
From: (Anonymous)
2006-10-10 06:05 am (UTC)

were you able to figure out the response parsing?

were you able to figure out the response parsing? I am trying to learn how to package these responses.

~Gary
(Reply) (Thread)