用java的Socket模拟realplayer的数据传送,资料是用WPE拦截的realplayer与服务器传送的数据和迅雷等下载日志。
String url="rtsp://";
RtspUrl rurl = new RtspUrl(url);
Socket sk=new Socket(rurlgetHost(),rurlgetPort());
BufferedInputStream in=new BufferedInputStream(skgetInputStream());
BufferedOutputStream out=new BufferedOutputStream(skgetOutputStream());
下面发送和接受用的都是in和out
第三、四步都发送 SETUP 请求时用到的RealChallenge2是网上找的算法,RealChallengejava,@author Roger Chen
第一步发送OPTIONS 正常接受到回复
第二步发送 DESCRIBE 也能正常接受到回复
第三、四步都发送 SETUP 都能正常接受到回复
SETUP rtsp://21026112183:5540/%C1%AC%D0%F8%BE%E7/%B3%FE%C1%F4%CF%E3%B4%AB%C6%E6/%B3%FE%C1%F4%CF%E3%B4%AB%C6%E643rmvb/streamid=0 RTSP/10
CSeq: 3
RealChallenge2: b2faca7cebcc827d08bc3a5bf92a8ed701d0a8e3, sd=bce803f8
RDTFeatureLevel: 2
Transport: x-pn-tng/tcp;mode=play,x-real-rdt/tcp;mode=play,RTP/AVP/TCP;unicast;mode=play
User-Agent: RealMedia Player (HelixDNAClient)/10000 (win32)
If-Match: 2143912-1
RTSP/10 200 OK
CSeq: 3
Date: Mon, 21 Jan 2008 14:08:02 GMT
Session: 2143912-1
Reconnect: true
RealChallenge3: ee313bac80b8938e70021c666d45cc8c4f213d09,sdr=e389716c
RDTFeatureLevel: 2
Transport: x-pn-tng/tcp;interleaved=0
第五步发送 SET_PARAMETER 也正常
SET_PARAMETER rtsp://21026112183:5540/%C1%AC%D0%F8%BE%E7/%B3%FE%C1%F4%CF%E3%B4%AB%C6%E6/%B3%FE%C1%F4%CF%E3%B4%AB%C6%E643rmvb RTSP/10
CSeq: 5
Subscribe: stream=0;rule=0,stream=0;rule=1,stream=1;rule=0,stream=1;rule=1
Session: 2143912-1
SetDeliveryBandwidth: Bandwidth=492592;BackOff=0
回复:
RTSP/10 200 OK
CSeq: 5
Date: Mon, 21 Jan 2008 14:08:03 GMT
Session: 2143912-1
然后PLAY就有问题了:
PLAY rtsp://21026112183:5540/%C1%AC%D0%F8%BE%E7/%B3%FE%C1%F4%CF%E3%B4%AB%C6%E6/%B3%FE%C1%F4%CF%E3%B4%AB%C6%E643rmvb RTSP/10
CSeq: 6
User-Agent: RealMedia Player (HelixDNAClient)/10000 (win32)
Session: 2143912-1
Range: npt=0000-
回复:
SET_PARAMETER RTSP/10
CSeq: 1
Alert: 0;You need to obtain a new player to play this clip Please point your web browser to >
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)