安防監控視頻流媒體平臺EasyGBS可以經過簡單的網絡攝像機通道配置,將傳統監控行業裏面的高清網絡攝像機IP Camera、NVR等GB28181國標協議輸出的設備、平臺接入到EasyGBS,EasyGBS可以將這些視頻源的音視頻數據進行拉取,轉換爲RTMP/HLS/FLV/RTSP,進行全平臺終端H5直播(Web、Android、iOS),而且EasyGBS可以將視頻源的直播數據對接到第三方CDN網絡,實現互聯網級別的直播分發。服務器
在GB28181裏面,視頻請求是最重要的環節,GB28181 2016版本最主要的新增內容 估計就是請求視頻的時候支持tcp active和tcp passive, 其實早在GB28181 2014版本的時候都已經定義了tcp傳輸碼流,tcp最大的好處就是對下載的時候能保證不丟包,下面簡要說一下INVITE請求視頻的流程:網絡
下面簡要粘貼一下抓包信息:架構
INVITE sip:64000000001310000001@6400000000 SIP/2.0 Call-ID: b8055bc7a97eec69318e6a38a9532cbb@0.0.0.0 CSeq: 1 INVITE From: <sip:34020000002000000001@3402000000>;tag=35565509_53173353_01b54c44-9ff9-49bf-b63a-58e0c1064b22 To: <sip:64000000001310000001@6400000000> Max-Forwards: 70 Contact: "34020000002000000001" <sip:192.168.1.81:5060> Subject: 64000000001310000001:0-4-0,34020000002000000001:1 Content-Type: application/sdp Route: <sip:64000000001310000001@192.168.1.93:5060;lr> Via: SIP/2.0/UDP 192.168.1.81:5060;branch=z9hG4bK01b54c44-9ff9-49bf-b63a-58e0c1064b22_53173353_34843235799148 Content-Length: 221 v=0 o=34020000002020000001 0 0 IN IP4 192.168.1.81 s=Play c=IN IP4 192.168.1.81 t=0 0 m=video 6000 RTP/AVP 96 98 97 a=recvonly a=rtpmap:96 PS/90000 a=rtpmap:97 MPEG4/90000 a=rtpmap:98 H264/90000 f=v/2/4///a/// SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.1.81:5060;branch=z9hG4bK01b54c44-9ff9-49bf-b63a-58e0c1064b22_53173353_34843235799148 From: <sip:34020000002000000001@3402000000>;tag=35565509_53173353_01b54c44-9ff9-49bf-b63a-58e0c1064b22 To: <sip:64000000001310000001@6400000000> Call-ID: b8055bc7a97eec69318e6a38a9532cbb@0.0.0.0 CSeq: 1 INVITE Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.1.81:5060;branch=z9hG4bK01b54c44-9ff9-49bf-b63a-58e0c1064b22_53173353_34843235799148 Record-Route: <sip:64000000002000000001@192.168.1.93:5060;lr> From: <sip:34020000002000000001@3402000000>;tag=35565509_53173353_01b54c44-9ff9-49bf-b63a-58e0c1064b22 To: <sip:64000000001310000001@6400000000>;tag=j3cF7SuJ Call-ID: b8055bc7a97eec69318e6a38a9532cbb@0.0.0.0 CSeq: 1 INVITE Contact: <sip:64000000001310000001@192.168.1.93:5060> Content-Type: application/sdp Content-Length: 220 v=0 o=64000000001310000001 0 0 IN IP4 192.168.1.93 s=Play c=IN IP4 192.168.1.93 t=0 0 m=video 20120 RTP/AVP 96 98 97 a=sendonly a=rtpmap:96 PS/90000 a=rtpmap:98 H264/90000 a=rtpmap:97 MPEG4/90000 y=0000000003 ACK sip:64000000001310000001@192.168.1.93:5060 SIP/2.0 Call-ID: b8055bc7a97eec69318e6a38a9532cbb@0.0.0.0 CSeq: 1 ACK From: <sip:34020000002000000001@3402000000>;tag=35565509_53173353_01b54c44-9ff9-49bf-b63a-58e0c1064b22 To: <sip:64000000001310000001@6400000000>;tag=j3cF7SuJ Max-Forwards: 70 Route: <sip:64000000002000000001@192.168.1.93:5060;lr> Via: SIP/2.0/UDP 192.168.1.81:5060;branch=z9hG4bK01b54c44-9ff9-49bf-b63a-58e0c1064b22_53173353_34843344467988 Content-Length: 0
INVITE sip:34020000001310000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.93:5060;rport;branch=z9hG4bK-3d09000-2b0348fd-yeqPDaq1 From: <sip:64000000002000000001@192.168.1.93:5060>;tag=98EB157C7A7D4152B78D2B9E097AF8C9 To: <sip:34020000001310000001@3402000000> Call-ID: 98EB157C7A7D4152B78D2B9E097AF8C9 CSeq: 12 INVITE Contact: <sip:64000000002000000001@192.168.1.93:5060> Content-Type: application/sdp Max-Forwards: 70 Subject: 34020000001310000001:1,64000000002000000001:1 Content-Length: 258 v=0 o=64000000002000000001 0 0 IN IP4 192.168.1.93 s=Play c=IN IP4 192.168.1.93 t=0 0 m=video 20108 TCP/RTP/AVP 96 98 97 a=recvonly a=rtpmap:96 PS/90000 a=rtpmap:98 H264/90000 a=rtpmap:97 MPEG4/90000 a=setup:active a=connection:new y=0000000002 SIP/2.0 200 OK To: <sip:34020000001310000001@3402000000>;tag=70848741_53173353_6a72b837-2678-46e9-9320-8db5a86f208c Via: SIP/2.0/UDP 192.168.1.93:5060;rport=5060;branch=z9hG4bK-3d09000-2b0348fd-yeqPDaq1;received=192.168.1.93 CSeq: 12 INVITE Call-ID: 98EB157C7A7D4152B78D2B9E097AF8C9 From: <sip:64000000002000000001@192.168.1.93:5060>;tag=98EB157C7A7D4152B78D2B9E097AF8C9 Contact: <sip:192.168.1.81:5060> Content-Type: application/sdp Content-Length: 245 v=0 o=64010000002020000001 0 0 IN IP4 192.168.1.81 s=Play c=IN IP4 192.168.1.81 t=0 0 m=video 5000 TCP/RTP/AVP 96 97 98 a=sendonly a=rtpmap:96 PS/90000 a=rtpmap:97 MPEG4/90000 a=rtpmap:98 H264/90000 a=setup:passive a=connection:new y=0200000025 ACK sip:34020000001310000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.93:5060;rport=5060;branch=z9hG4bK-3d09000-2b0348fd-yeqPDaq1;received=192.168.1.93 From: <sip:64000000002000000001@192.168.1.93:5060>;tag=98EB157C7A7D4152B78D2B9E097AF8C9 To: <sip:34020000001310000001@3402000000>;tag=70848741_53173353_6a72b837-2678-46e9-9320-8db5a86f208c Call-ID: 98EB157C7A7D4152B78D2B9E097AF8C9 CSeq: 12 ACK Max-Forwards: 70 Content-Length: 0
INVITE sip:34020000001310000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.93:5060;rport;branch=z9hG4bK-3d09000-16938bd4-JmZPS4tF From: <sip:64000000002000000001@192.168.1.93:5060>;tag=DAD260A2BECC485BAFDDA3736EC724D9 To: <sip:34020000001310000001@3402000000> Call-ID: DAD260A2BECC485BAFDDA3736EC724D9 CSeq: 190 INVITE Contact: <sip:64000000002000000001@192.168.1.93:5060> Content-Type: application/sdp Max-Forwards: 70 Subject: 34020000001310000001:1,64000000002000000001:1 Content-Length: 326 v=0 o=64000000002000000001 0 0 IN IP4 192.168.1.93 s=Download u=34020000001310000001:3 c=IN IP4 192.168.1.93 t=1495173756 1495174056 m=video 20372 TCP/RTP/AVP 96 98 97 a=recvonly a=rtpmap:96 PS/90000 a=rtpmap:98 H264/90000 a=rtpmap:97 MPEG4/90000 a=setup:passive a=connection:new a=downloadspeed:8 y=1000000025 SIP/2.0 200 OK To: <sip:34020000001310000001@3402000000>;tag=01493985_53173353_fb041e78-db58-4fec-9660-625f28bd5e9a Via: SIP/2.0/UDP 192.168.1.93:5060;rport=5060;branch=z9hG4bK-3d09000-16938bd4-JmZPS4tF;received=192.168.1.93 CSeq: 190 INVITE Call-ID: DAD260A2BECC485BAFDDA3736EC724D9 From: <sip:64000000002000000001@192.168.1.93:5060>;tag=DAD260A2BECC485BAFDDA3736EC724D9 Contact: <sip:192.168.1.81:5060> Content-Type: application/sdp Content-Length: 268 v=0 o=64010000002020000001 0 0 IN IP4 192.168.1.81 s=Download c=IN IP4 192.168.1.81 t=0 0 m=video 5000 TCP/RTP/AVP 96 97 98 a=sendonly a=rtpmap:96 PS/90000 a=rtpmap:97 MPEG4/90000 a=rtpmap:98 H264/90000 a=setup:active a=connection:new a=filesize:59770877 y=1200000016 ACK sip:34020000001310000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.93:5060;rport=5060;branch=z9hG4bK-3d09000-16938bd4-JmZPS4tF;received=192.168.1.93 From: <sip:64000000002000000001@192.168.1.93:5060>;tag=DAD260A2BECC485BAFDDA3736EC724D9 To: <sip:34020000001310000001@3402000000>;tag=01493985_53173353_fb041e78-db58-4fec-9660-625f28bd5e9a Call-ID: DAD260A2BECC485BAFDDA3736EC724D9 CSeq: 190 ACK Max-Forwards: 70 Content-Length: 0
流媒體這塊就須要本身作處理了,通常檢測的時候須要等待幾秒鐘,檢測軟件SPVMN不是那麼快速,還有就是tcp active的時候,spvmn的端口不是協議中的端口,因此也不須要針對tcp端口進行篩選。app