首页 > 其他分享 >RTSP协议报文交互过程全记录

RTSP协议报文交互过程全记录

时间:2023-07-07 14:11:11浏览次数:48  
标签:10.0 RTSP 1.0 554 报文 rtsp 全记录 CSeq

一。rtsp拉流(UDP)


1.OPTIONS:

OPTIONS rtsp://10.0.16.111:554/Streaming/Channels/101 RTSP/1.0
CSeq: 1
User-Agent: Lavf59.26.100
 



RTSP/1.0 200 OK
CSeq: 1
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, TEARDOWN, SET_PARAMETER, GET_PARAMETER
Date:  Thu, Mar 23 2023 18:37:12 GMT
 


2.DESCRIBE:

DESCRIBE rtsp://10.0.16.111:554/Streaming/Channels/101 RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: Lavf59.26.100
 



RTSP/1.0 401 Unauthorized
CSeq: 2
WWW-Authenticate: Digest realm="IP Camera(11266)", nonce="abc4a07789be480e64f821c677104d37", stale="FALSE"
Date:  Thu, Mar 23 2023 18:37:12 GMT
 


3.DESCRIBE:

DESCRIBE rtsp://10.0.16.111:554/Streaming/Channels/101 RTSP/1.0
Accept: application/sdp
CSeq: 3
User-Agent: Lavf59.26.100
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="abc4a07789be480e64f821c677104d37", uri="rtsp://10.0.16.111:554/Streaming/Channels/101", response="4e94cd299a516d985f31aae4c3020c38"
 



RTSP/1.0 200 OK
CSeq: 3
Content-Type: application/sdp
Content-Base: rtsp://10.0.16.111:554/Streaming/Channels/101/
Content-Length: 894
 
v=0
o=- 1679596632450757 1679596632450757 IN IP4 10.0.16.111
s=Media Presentation
e=NONE
b=AS:5100
t=0 0
a=control:rtsp://10.0.16.111:554/Streaming/Channels/101/
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:5000
a=recvonly
a=x-dimensions:1280,720
a=control:rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z0IAH52oFAFum4CAgKAAAAMAIAAABlCA,aM48gA==
m=audio 0 RTP/AVP 104
c=IN IP4 0.0.0.0
b=AS:50
a=recvonly
a=control:rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2
a=rtpmap:104 mpeg4-generic/44100/1
a=fmtp:104 profile-level-id=15; streamtype=5; mode=AAC-hbr; config=1208;SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=Media_header:MEDIAINFO=494D4B4801020000040000010120011044AC0000007D000000000000000000000000000000000000;
a=appversion:1.0
 


4.SETUP:

SETUP rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1 RTSP/1.0
Transport: RTP/AVP/UDP;unicast;client_port=33118-33119
CSeq: 4
User-Agent: Lavf59.26.100
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="abc4a07789be480e64f821c677104d37", uri="rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1", response="cf9d37aafe4a4cfa1b4bf9ea784dc368"
 



RTSP/1.0 200 OK
CSeq: 4
Session:        557408106;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=33118-33119;server_port=8260-8261;ssrc=7845ed13;mode="play"
Date:  Thu, Mar 23 2023 18:37:12 GMT
 


5.SETUP:

SETUP rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2 RTSP/1.0
Transport: RTP/AVP/UDP;unicast;client_port=33120-33121
CSeq: 5
User-Agent: Lavf59.26.100
Session: 557408106
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="abc4a07789be480e64f821c677104d37", uri="rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2", response="968bae386bf2ff48793b1ab7f0f643be"
 



RTSP/1.0 200 OK
CSeq: 5
Session:        557408106;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=33120-33121;server_port=8262-8263;ssrc=45962de4;mode="play"
Date:  Thu, Mar 23 2023 18:37:12 GMT
 


6.PLAY:

PLAY rtsp://10.0.16.111:554/Streaming/Channels/101/ RTSP/1.0
Range: npt=0.000-
CSeq: 6
User-Agent: Lavf59.26.100
Session: 557408106
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="abc4a07789be480e64f821c677104d37", uri="rtsp://10.0.16.111:554/Streaming/Channels/101/", response="ab319a7d0f7c5f9491c2b3cb24695634"
 



RTSP/1.0 200 OK
CSeq: 6
Session:        557408106
RTP-Info: url=rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1;seq=36723;rtptime=2574626712,url=rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2;seq=23132;rtptime=3280209523
Date:  Thu, Mar 23 2023 18:37:12 GMT


二。rtsp拉流(TCP)


1.OPTIONS:


OPTIONS rtsp://10.0.16.111:554/Streaming/Channels/101 RTSP/1.0
CSeq: 1
User-Agent: Lavf59.26.100
 





RTSP/1.0 200 OK
CSeq: 1
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, TEARDOWN, SET_PARAMETER, GET_PARAMETER
Date: Fri, Mar 24 2023 11:15:59 GMT
 



2.DESCRIBE:


DESCRIBE rtsp://10.0.16.111:554/Streaming/Channels/101 RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: Lavf59.26.100
 





RTSP/1.0 401 Unauthorized
CSeq: 2
WWW-Authenticate: Digest realm="IP Camera(11266)", nonce="f6995a36c2ed0cccfb4e6c2a33a882c9", stale="FALSE"
Date: Fri, Mar 24 2023 11:15:59 GMT
 



3.DESCRIBE:


DESCRIBE rtsp://10.0.16.111:554/Streaming/Channels/101 RTSP/1.0
Accept: application/sdp
CSeq: 3
User-Agent: Lavf59.26.100
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="f6995a36c2ed0cccfb4e6c2a33a882c9", uri="rtsp://10.0.16.111:554/Streaming/Channels/101", response="9858265ba07711a41cb2ab44c9547c98"
 





RTSP/1.0 200 OK
CSeq: 3
Content-Type: application/sdp
Content-Base: rtsp://10.0.16.111:554/Streaming/Channels/101/
Content-Length: 894
 
v=0
o=- 1679656559712847 1679656559712847 IN IP4 10.0.16.111
s=Media Presentation
e=NONE
b=AS:5100
t=0 0
a=control:rtsp://10.0.16.111:554/Streaming/Channels/101/
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:5000
a=recvonly
a=x-dimensions:1280,720
a=control:rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z0IAH52oFAFum4CAgKAAAAMAIAAABlCA,aM48gA==
m=audio 0 RTP/AVP 104
c=IN IP4 0.0.0.0
b=AS:50
a=recvonly
a=control:rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2
a=rtpmap:104 mpeg4-generic/44100/1
a=fmtp:104 profile-level-id=15; streamtype=5; mode=AAC-hbr; config=1208;SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=Media_header:MEDIAINFO=494D4B4801020000040000010120011044AC0000007D000000000000000000000000000000000000;
a=appversion:1.0
 



4.SETUP:


SETUP rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1 RTSP/1.0
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
CSeq: 4
User-Agent: Lavf59.26.100
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="f6995a36c2ed0cccfb4e6c2a33a882c9", uri="rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1", response="baeb31267ec09ef055e840db6100d3cc"
 




RTSP/1.0 200 OK
CSeq: 4
Session: 995122684;timeout=60
Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=1ef00f82;mode="play"
Date: Fri, Mar 24 2023 11:15:59 GMT
 


5.SETUP:


SETUP rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2 RTSP/1.0
Transport: RTP/AVP/TCP;unicast;interleaved=2-3
CSeq: 5
User-Agent: Lavf59.26.100
Session: 995122684
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="f6995a36c2ed0cccfb4e6c2a33a882c9", uri="rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2", response="24f2a019ea2a9a468279a43058d40170"
 





RTSP/1.0 200 OK
CSeq: 5
Session: 995122684;timeout=60
Transport: RTP/AVP/TCP;unicast;interleaved=2-3;ssrc=4832454a;mode="play"
Date: Fri, Mar 24 2023 11:15:59 GMT
 



6.PLAY:


PLAY rtsp://10.0.16.111:554/Streaming/Channels/101/ RTSP/1.0
Range: npt=0.000-
CSeq: 6
User-Agent: Lavf59.26.100
Session: 995122684
Authorization: Digest username="admin", realm="IP Camera(11266)", nonce="f6995a36c2ed0cccfb4e6c2a33a882c9", uri="rtsp://10.0.16.111:554/Streaming/Channels/101/", response="128ce9612d84af58bfb2a5a78b4e61db"
 




RTSP/1.0 200 OK
CSeq: 6
Session: 995122684
RTP-Info: url=rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=1;seq=41402;rtptime=3673114076,url=rtsp://10.0.16.111:554/Streaming/Channels/101/trackID=2;seq=47264;rtptime=1628033996
Date: Fri, Mar 24 2023 11:15:59 GMT


三。rtsp推流(TCP)

1.OPTIONS:
OPTIONS rtsp://172.168.1.38:554/live/test RTSP/1.0
CSeq: 1
User-Agent: -_-


RTSP/1.0 200 OK
CSeq: 1
Date: Fri, Mar 24 2023 01:09:38 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, ANNOUNCE, RECORD, SET_PARAMETER, GET_PARAMETER
Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08)

2.ANNOUNCE: ANNOUNCE rtsp://172.168.1.38:554/live/test RTSP/1.0 Content-Type: application/sdp CSeq: 2 User-Agent: -_- Session: Content-Length: 304 v=0 o=- 91679620178 1 IN IP4 10.0.16.115 t=0 0 a=control:* m=video 0 RTP/AVP 96 a=rtpmap:96 H264/90000 a=control:track0 m=audio 0 RTP/AVP 97 a=rtpmap:97 MPEG4-GENERIC/44100/1 a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1208 a=control:track1 RTSP/1.0 200 OK CSeq: 2 Date: Fri, Mar 24 2023 01:09:38 GMT Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08) Session: Kzao4p5Wdp7u 3.SETUP(视频H264): SETUP rtsp://172.168.1.38:554/live/test/track0 RTSP/1.0 Transport: RTP/AVP/TCP;unicast;mode=record;interleaved=0-1 CSeq: 3 User-Agent: -_- Session: Kzao4p5Wdp7u RTSP/1.0 200 OK CSeq: 3 Date: Fri, Mar 24 2023 01:09:38 GMT Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08) Session: Kzao4p5Wdp7u Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=00000000 x-Dynamic-Rate: 1 x-Transport-Options: late-tolerance=1.400000 4.SETUP(音频AAC): SETUP rtsp://172.168.1.38:554/live/test/track1 RTSP/1.0 Transport: RTP/AVP/TCP;unicast;mode=record;interleaved=2-3 CSeq: 4 User-Agent: -_- Session: Kzao4p5Wdp7u RTSP/1.0 200 OK CSeq: 4 Date: Fri, Mar 24 2023 01:09:38 GMT Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08) Session: Kzao4p5Wdp7u Transport: RTP/AVP/TCP;unicast;interleaved=2-3;ssrc=00000000 x-Dynamic-Rate: 1 x-Transport-Options: late-tolerance=1.400000 5.RECORD: RECORD rtsp://172.168.1.38:554/live/test RTSP/1.0 Range: npt=0.000- CSeq: 5 User-Agent: -_- Session: Kzao4p5Wdp7u RTSP/1.0 200 OK CSeq: 5 Date: Fri, Mar 24 2023 01:09:38 GMT RTP-Info: url=rtsp://172.168.1.38:554/live/test/track0,url=rtsp://172.168.1.38:554/live/test/track1 Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08) Session: Kzao4p5Wdp7u 6.TEARDOWN: TEARDOWN rtsp://172.168.1.38:554/live/test RTSP/1.0 CSeq: 6 User-Agent: Lavf59.26.100 Session: Kzao4p5Wdp7u RTSP/1.0 200 OK CSeq: 6 Date: Fri, Mar 24 2023 02:51:35 GMT Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08) Session: Kzao4p5Wdp7u

四。rtsp推流(UDP)


1.OPTIONS:


OPTIONS rtsp://172.168.1.38:554/test/live4 RTSP/1.0
CSeq: 1
User-Agent: Lavf59.26.100
 





RTSP/1.0 200 OK
CSeq: 1
Date: Fri, Mar 24 2023 02:57:49 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, ANNOUNCE, RECORD, SET_PARAMETER, GET_PARAMETER
Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08)
 



2.ANNOUNCE:


ANNOUNCE rtsp://172.168.1.38:554/test/live4 RTSP/1.0
Content-Type: application/sdp
CSeq: 2
User-Agent: Lavf59.26.100
Content-Length: 327
 
v=0
o=- 0 0 IN IP4 127.0.0.1
s=Media Presentation
c=IN IP4 172.168.1.38
t=0 0
a=tool:libavformat LIBAVFORMAT_VERSION
m=video 0 RTP/AVP 96
b=AS:1938
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z00AKp24HgCJ+WbgICAoAAADAAgAAAMBlCA=,aO48gA==; profile-level-id=4D002A
a=control:streamid=0
 





RTSP/1.0 200 OK
CSeq: 2
Date: Fri, Mar 24 2023 02:57:49 GMT
Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08)
Session: BnMb7rU90LPW
 



3.SETUP(视频H264):


SETUP rtsp://172.168.1.38:554/test/live4/streamid=0 RTSP/1.0
Transport: RTP/AVP/UDP;unicast;client_port=29326-29327;mode=record
CSeq: 3
User-Agent: Lavf59.26.100
Session: BnMb7rU90LPW
 





RTSP/1.0 200 OK
CSeq: 3
Date: Fri, Mar 24 2023 02:57:49 GMT
Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08)
Session: BnMb7rU90LPW
Transport: RTP/AVP/UDP;unicast;client_port=29326-29327;mode=record;server_port=30054-30055;ssrc=00000000
 



4.RECORD:


RECORD rtsp://172.168.1.38:554/test/live4 RTSP/1.0
Range: npt=0.000-
CSeq: 4
User-Agent: Lavf59.26.100
Session: BnMb7rU90LPW
 





RTSP/1.0 200 OK
CSeq: 4
Date: Fri, Mar 24 2023 02:57:49 GMT
RTP-Info: url=rtsp://172.168.1.38:554/test/live4/streamid=0
Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08)
Session: BnMb7rU90LPW
 



5.TEARDOWN:


TEARDOWN rtsp://172.168.1.38:554/test/live4 RTSP/1.0
CSeq: 5
User-Agent: Lavf59.26.100
Session: BnMb7rU90LPW
 





RTSP/1.0 200 OK
CSeq: 5
Date: Fri, Mar 24 2023 02:57:52 GMT
Server: ZLMediaKit(git hash:00c9749,branch:master,build time:Sep 5 2022 09:20:08)
Session: BnMb7rU90LPW


 

 

 

标签:10.0,RTSP,1.0,554,报文,rtsp,全记录,CSeq
From: https://www.cnblogs.com/feixiang-energy/p/17534818.html

相关文章

  • 万字好文:大报文问题实战
    导读大报文问题,在京东物流内较少出现,但每次出现往往是大事故,甚至导致上下游多个系统故障。大报文的背后,是不同商家业务体量不同,特别是B端业务的采购及销售出库单,一些头部商家对京东系统支持业务复杂度及容量能力的要求越来越高。因此我们有必要把这个问题重视起来,从组织上根本上......
  • web js 播放rtsp视频流方案
    场景需要在web端预览海康无线摄像头视频流,所以采用海康自身提供的websdk无法使用方案1rtsp流推送到应用服务器,应用服务器再通过ffmpeg推送到nginx,js再去拉流缺点:多了一层转发,造成了一定的延迟方案2通过webRTC方案,使用现有开源插件webrtc-streamerhttps://github......
  • Labview 与汇川AM400 AM600 AM800 AC800 PLC 通讯 官方协议,报文读取,安全稳定
    Labview与汇川AM400AM600AM800AC800PLC通讯官方协议,报文读取,安全稳定。程序代开发,代写程序。通讯配置,辅助测试。无程序网络通讯实现。常用功能一网打尽。1.命令帧读写。2.支持I16I32Float批量读写。3.支持字符串读写。4.支持Bool批量读写。5.支持Q单点读写。......
  • ZLMediaKit 服务器源码解读,RTSP推流拉流
    RTSP推流1、数据解析过程数据都会通过回调的方式到达RtspSession类(会话)的onRecv函数先给出类的继承关系:classRtspSession:publicTcpSession,publicRtspSplitter,publicRtpReceiver,publicMediaSourceEvent{}classRtspSplitter:publicHttpRequestSplitter{}数据回......
  • ffmpeg播放RTSP的一点优化
    简单记录一下最近使用ffmpeg播放RTSP做的一点参数优化。先做如下定义:AVDictionary*options=NULL;1.画质优化原生的ffmpeg参数在对1920x1080的RTSP流进行播放时,花屏现象很严重,根据网上查的资料,可以通过增大“buffer_size”参数来提高画质,减少花屏现象如:av_dict_set(&op......
  • IPv4数据报文
    一、介绍     ......
  • 使用ffmpeg将rtsp流转流实现h5端播放
    主要实现rtsp转tcp协议视频流播放ffmpeg下载安装(公认业界视频处理大佬)a、官网地址:www.ffmpeg.org/b、gitHub:github.com/FFmpeg/FFmp…c、推荐下载地址:ffmpeg.zeranoe.com/builds/(选择如下图)2.配置ffmpeg环境变量:a、解压缩上一步的ffmpeg文件b、配置环境变量,把ffmpeg下的bin配置......
  • RTSP/Onvif协议安防平台EasyNVR调用接口录像会被自动删除的原因排查与解决
    EasyNVR安防视频云服务是基于RTSP/Onvif协议接入的视频平台,可支持将接入的视频流进行全平台、全终端的分发,分发的视频流包括RTSP、RTMP、HTTP-FLV、WS-FLV、HLS、WebRTC等。平台丰富灵活的视频能力,可应用在智慧校园、智慧工厂、智慧水利等场景中。有用户反馈,在使用EasyNVR接入设备......
  • 如何求解网络报文中的checksum?
    最近在学习计算机网络,在运输层和网络层部分存在各种协议TCP、UDP、IP、ICMP等等,而在这些报文中都存在一个公共的字段——检验和(checksum)。接下来,我将从什么是检验和、检验和怎么算、检验和计算示例、python代码计算检验和这几个部分详细介绍。什么是检验和?检验和是存在于各种报文......
  • windows环境下,搭建RTSP视频推流服务器
    1.环境与配置1.1系统环境我这里使用的Windows1064位1.2下载RTSP服务器下载页面:https://github.com/aler9/rtsp-simple-server/releases这里,我们下载rtsp-simple-server_v0.19.1_windows_amd64.zip在百度网盘上下载也可以链接:https://pan.baidu.com/s/1FqMnAJWPo......