锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 开源技术 / Darwin服务器 / Darwin概念之自动播送 / 跟踪实例:实例一
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

QuickTime Broadcaste使用TCP的踪迹


下面是QuickTime Broadcaster通过TCP发送MPEG 4流的踪迹。TCP连接使用同样系列的RTSP请求和端口标识,请求中带有由标准定义的RTP/AVP/TCP传输协议信息,每个流都有interleaved= 这样的关键字来指定端口。

对于这个例子,我们通过qtaccess文件中的设定将认证和授权禁用了,这使所有用户都可以向服务器发布流。播送文件的路径是相对于电影目录的。如果请求中的URL指定的SDP文件已经存在,则会被替代掉。已经连接到该URL的客户不会被更新,因为如果要更新的话,需要客户端重新发送一个新的DESCRIBE请求,目前没有办法可以将SDP的变化通知给客户。

客户端发送给服务器端:

ANNOUNCE rtsp://127.0.0.1/mystream.sdp RTSP/1.0\r\n
CSeq: 1\r\n
Content-Type: application/sdp\r\n
User-Agent: QTS (qtver=6.1;cpu=PPC;os=Mac 10.2.3)\r\n
Content-Length: 790\r\n
\r\n
c=IN IP4
127.0.0.1\ra=x-qt-text-nam:test\ra=x-qt-text-cpy:apple\ra=x-qt-text-aut:
john\ra=x-qt-text-inf:none\ra=mpeg4-iod:"data:application/
mpeg4-iod;base64,AoF/
AE8BAQEBAQOBEgABQHRkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBVGdC
R3dVZkF4Y0F5U1FBWlFRTklCRUFGM0FBQVBvQUFBRERVQVlCQkFFWkFwOERGUUJsQlFRTlFC
VUFCOUFBQUQ2QUFBQStnQVlCQXc9PQQNAQUAAMgAAAAAAAAAAAYJAQAAAAAAAAAAA2EAAkA+
ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTZ1RBcUJYSmhCSWhR
UlFVL0FBPT0EEgINAAAUAAAAAAAAAAAFAwAAQAYJAQAAAAAAAAAA"\ra=isma-
compliance:1,1.0,1\rm=audio 0 RTP/AVP 96\ra=rtpmap:96
X-QT/8000/1\ra=control:trackid=1\rm=video 0 RTP/AVP 97\ra=rtpmap:97
MP4V-ES\ra=fmtp:97
profile-level-id=1;config=000001B0F3000001B50EE040C0CF0000010000000120008440FA285020F0
A31F\ra=mpeg4-esid:201\ra=cliprect:0,0,240,320\ra=control:trackid=2\r

 

服务器端发送给客户端:

RTSP/1.0 200 OK\r\n
Server: QTSS/4.1.3.x (Build/425; Platform/MacOSX; Release/Development;)\r\n
Cseq: 1\r\n
\r\n

 

客户端发送给服务器端:

// The broadcaster is trying to determine if RECORD is supported. QTSS 4.0 used an Apple
// method of RECEIVE instead of the RECORD.

OPTIONS rtsp://127.0.0.1/mystream.sdp RTSP/1.0\r\n
CSeq: 2\r\n
User-Agent: QTS (qtver=6.1;cpu=PPC;os=Mac 10.2.3)\r\n
\r\n

 

服务器端发送给客户端:

RTSP/1.0 200 OK\r\n
Server: QTSS/4.1.3.x (Build/425; Platform/MacOSX; Release/Development;)\r\n
Cseq: 2\r\n
Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, ANNOUNCE, SET_PARAMETER, RECORD\r\n
\r\n

 

客户端发送给服务器端:

// Here is the first setup with the transport defined from the client to the 
// server. The URL is the same as when a client performs a setup requesting
// a stream. QTSS does not allow a SETUP on a stream that is already set up
// and will return an error. This can happen in two ways.
// 1) A broadcast software error that does not change the URL.
// 2) A broadcast dies without performing a teardown. In this case, the
// broadcast session has to timeout and die before another setup can occur.
// The server uses a short timeout of 20 seconds for broadcast sessions. The
// timeout is refreshed by any packet received from the broadcaster.
SETUP rtsp://127.0.0.1/mystream.sdp/trackid=1 RTSP/1.0\r\n
CSeq: 3\r\n
Transport: RTP/AVP/TCP;unicast;mode=record;interleaved=0-1\r\n
User-Agent: QTS (qtver=6.1;cpu=PPC;os=Mac 10.2.3)\r\n
Accept-Language: en-US\r\n
\r\n

 

服务器端发送给客户端:

// The server responds with the interleaved values. If the values conflict,
// the client will change them so each stream has a unique set of
// interleaved IDs.

RTSP/1.0 200 OK\r\n
Server: QTSS/4.1.3.x (Build/425; Platform/MacOSX; Release/Development;)\r\n
Cseq: 3\r\n
Cache-Control: no-cache\r\n
Session: 6664885458621367225\r\n
Date: Thu, 13 Feb 2003 21:34:27 GMT\r\n
Expires: Thu, 13 Feb 2003 21:34:27 GMT\r\n
Transport: RTP/AVP/TCP;unicast;mode=record;interleaved=0-1\r\n
\r\n

 

客户端发送给服务器端:

SETUP rtsp://127.0.0.1/mystream.sdp/trackid=2 RTSP/1.0\r\n
CSeq: 4\r\n
Transport: RTP/AVP/TCP;unicast;mode=record;interleaved=2-3\r\n
Session: 6664885458621367225\r\n
User-Agent: QTS (qtver=6.1;cpu=PPC;os=Mac 10.2.3)\r\n
Accept-Language: en-US\r\n
\r\n

 

服务器端发送给客户端:

RTSP/1.0 200 OK\r\n
Server: QTSS/4.1.3.x (Build/425; Platform/MacOSX; Release/Development;)\r\n
Cseq: 4\r\n
Session: 6664885458621367225\r\n
Cache-Control: no-cache\r\n
Date: Thu, 13 Feb 2003 21:34:27 GMT\r\n
Expires: Thu, 13 Feb 2003 21:34:27 GMT\r\n
Transport: RTP/AVP/TCP;unicast;mode=record;interleaved=2-3\r\n
\r\n

 

客户端发送给服务器端:

// This is the equivalent to a client PLAY request. The broadcaster is now
// starting the streams.

RECORD rtsp://127.0.0.1/mystream.sdp RTSP/1.0\r\n
CSeq: 5\r\n
Session: 6664885458621367225\r\n
User-Agent: QTS (qtver=6.1;cpu=PPC;os=Mac 10.2.3)\r\n
\r\n

 

服务器端发送给客户端:

// RTCPs will be sent back on the channels to show the number of watching
// clients.
RTSP/1.0 200 OK\r\n
Server: QTSS/4.1.3.x (Build/425; Platform/MacOSX; Release/Development;)\r\n
Cseq: 5\r\n
Session: 6664885458621367225\r\n
RTP-Info: url=trackid=1,url=trackid=2\r\n
\r\n

 

客户端发送给服务器端:

PAUSE rtsp://127.0.0.1/mystream.sdp RTSP/1.0\r\n
CSeq: 6\r\n
Session: 6664885458621367225\r\n
User-Agent: QTS (qtver=6.1;cpu=PPC;os=Mac 10.2.3)\r\n
\r\n

 

服务器端发送给客户端:

RTSP/1.0 200 OK\r\n
Server: QTSS/4.1.3.x (Build/425; Platform/MacOSX; Release/Development;)\r\n
Cseq: 6\r\n
Session: 6664885458621367225\r\n
\r\n

 

客户端发送给服务器端:

// A TEARDOWN stops the broadcast streams. It does not stop the clients or 
// their streams. By default, QTSS allows a restarted or different broadcaster
// to send to the same URL and the clients will receive the new streams. This
// can be both good and bad since the broadcaster can change the stream media
// type on the clients. The streamingserver.xml file provides an attribute
// that allows the server to force clients to disconnect if the broadcaster
// disconnects. The broadcast receiver is recommended to have a way for an
// administrator or the broadcaster to tear down sessions that have failed.
// The server adds a 30 second timeout between SSRC values to prevent someone
// from pirating a stream.  As long as a stream is playing with the initial
// SSRC, another stream arriving on the same ports will not be reflected to
// clients. Attempts to pirate a steam usually occur by accident when users
// manually set their SDP ports.
TEARDOWN rtsp://127.0.0.1/mystream.sdp RTSP/1.0\r\n
CSeq: 7\r\n
Session: 6664885458621367225\r\n
User-Agent: QTS (qtver=6.1;cpu=PPC;os=Mac 10.2.3)\r\n
\r\n

 

服务器端发送给客户端:

// The server removes the SDP file from the movies directory on teardown or
// broadcaster timeout.
RTSP/1.0 200 OK\r\n
Server: QTSS/4.1.3.x (Build/425; Platform/MacOSX; Release/Development;)\r\n
Cseq: 7\r\n
Session: 6664885458621367225\r\n
Connection: Close\r\n
\r\n

 

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内