请求视频流:
INVITE sip:00000000001310018021@192.168.40.66:7100 SIP/2.0 Via: SIP/2.0/UDP 192.168.40.55:7100;rport;branch=z9hG4bK178329191 From: <sip:120105110228023020@192.168.40.55:7100>;tag=2091251200 To: <sip:00000000001310018021@192.168.40.66:7100> Call-ID: 4130842379 CSeq: 20 INVITE Contact: <sip:120105110228023020@192.168.40.55:7100> Content-Type: Application/DDCP Max-Forwards: 70 User-Agent: NCG V2.6.0.299938 Subject: 00000000001310018021:0,120105110228023020:0 Content-Length: 297 <?xml version="1.0"?> <Action> <Variable>RealMedia</Variable> <Privilege/> <Format>1080 720 D1 HALFD1 CIF 2CIF 4CIF QCIF</Format> //码流格式 <Video>MPEG-2 MPEG-4 M-JPEG H.264</Video> //视频编码类型 <Audio>G.711A G.711U G.722</Audio> //音频编码类型 <MaxBitrate>20480</MaxBitrate> //传输码率 <Socket>192.168.40.55 UDP 5560</Socket> //表示使用设备192.168.40.55的UDP端口5560接收视频流 </Action> SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.40.55:7100;rport=7100;branch=z9hG4bK178329191 From: <sip:120105110228023020@192.168.40.55:7100>;tag=2091251200 To: <sip:00000000001310018021@192.168.40.66:7100> Call-ID: 4130842379 CSeq: 20 INVITE User-Agent: NCG V2.6.0.299938 Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.40.55:7100;rport=7100;branch=z9hG4bK178329191 From: <sip:120105110228023020@192.168.40.55:7100>;tag=2091251200 To: <sip:00000000001310018021@192.168.40.66:7100>;tag=2781666162 Call-ID: 4130842379 CSeq: 20 INVITE Contact: <sip:161128022553273720@192.168.40.66:7100> Content-Type: Application/DDCP User-Agent: NCG V2.6.0.299938 Content-Length: 247 <?xml version="1.0"?> <Response> <Variable>RealMedia</Variable> <Format>CIF</Format> <Video>H.264</Video> <Audio>G.711U</Audio> <Bitrate>512</Bitrate> //传输码率 <Socket>192.168.40.66 UDP 5272</Socket> //表示使用设备192.168.40.66的UDP端口5272发送视频流 <DecoderTag>hikvision</DecoderTag> </Response>
断开视频流:
BYE sip:161128022553273720@192.168.40.66:7100 SIP/2.0 Via: SIP/2.0/UDP 192.168.40.55:7100;rport;branch=z9hG4bK2697700230 From: <sip:120105110228023020@192.168.40.55:7100>;tag=2091251200 To: <sip:00000000001310018021@192.168.40.66:7100>;tag=2781666162 Call-ID: 4130842379 CSeq: 21 BYE Contact: <sip:120105110228023020@192.168.40.55:7100> Max-Forwards: 70 User-Agent: NCG V2.6.0.299938 Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.40.55:7100;rport=7100;branch=z9hG4bK2697700230 From: <sip:120105110228023020@192.168.40.55:7100>;tag=2091251200 To: <sip:00000000001310018021@192.168.40.66:7100>;tag=2781666162 Call-ID: 4130842379 CSeq: 21 BYE User-Agent: NCG V2.6.0.299938 Content-Length: 0
历史图像获取示意图:
获取视频流:
DO sip:00000000001310018021@192.168.40.66:7100 SIP/2.0 Via: SIP/2.0/UDP 192.168.40.55:7100;rport;branch=z9hG4bK2258689616 From: <sip:120105110228023020@192.168.40.55:7100>;tag=382563044 To: <sip:00000000001310018021@192.168.40.66:7100> Call-ID: 2435803271 CSeq: 20 DO Content-Type: Application/DDCP Max-Forwards: 70 User-Agent: NCG V2.6.0.299938 Content-Length: 295 <?xml version="1.0"?> <Action> <Query> <Variable>FileList</Variable> <Privilege></Privilege> <FileType>23</FileType> <FromIndex>1</FromIndex> <ToIndex>2</ToIndex> <BeginTime>20170621T000000Z</BeginTime> <EndTime>20170621T235959Z</EndTime> <RecordPos>1</RecordPos> </Query> </Action> SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.40.55:7100;rport=7100;branch=z9hG4bK2258689616 From: <sip:120105110228023020@192.168.40.55:7100>;tag=382563044 To: <sip:00000000001310018021@192.168.40.66:7100>;tag=762901480 Call-ID: 2435803271 CSeq: 20 DO Content-Type: Application/DDCP User-Agent: NCG V2.6.0.299938 Content-Length: 875 <?xml version="1.0"?> <Response> <QueryResponse> <Variable>FileList</Variable> <Result>0</Result> <RealFileNum>2</RealFileNum> <FromIndex>1</FromIndex> <ToIndex>2</ToIndex> <FileInfolist> <Item> <Name>0_1_1497973658_0.h264</Name> <BeginTime>20170621T000000Z</BeginTime> <EndTime>20170621T022702Z</EndTime> <FileSize>4439165188</FileSize> <RecordType>1</RecordType> <VodUrl>rtsp://192.168.40.66:6304/file/vag_plug://192.168.40.66:6300/0/sessions/28e8deaef7a64db88010fee38da0ba31</VodUrl> </Item> <Item> <Name>0_1_1497983224_0.h264</Name> <BeginTime>20170621T022704Z</BeginTime> <EndTime>20170621T155926Z</EndTime> <FileSize>24528928360</FileSize> <RecordType>1</RecordType> <VodUrl>rtsp://192.168.40.66:6304/file/vag_plug://192.168.40.66:6300/0/sessions/28e8deaef7a64db88010fee38da0ba31</VodUrl> </Item> </FileInfolist> </QueryResponse> </Response> DO sip:00000000001310018021@192.168.40.66:7100 SIP/2.0 Via: SIP/2.0/UDP 192.168.40.55:7100;rport;branch=z9hG4bK929522417 From: <sip:120105110228023020@192.168.40.55:7100>;tag=3721737815 To: <sip:00000000001310018021@192.168.40.66:7100> Call-ID: 55014328 CSeq: 20 DO Content-Type: Application/DDCP Max-Forwards: 70 User-Agent: NCG V2.6.0.299938 Content-Length: 308 <?xml version="1.0"?> <Action> <Variable>VODByRTSP</Variable> <Privilege></Privilege> <FileType>23</FileType> <Name>0_1_1497973658_0.h264</Name> <BeginTime>20170621T000000Z</BeginTime> <EndTime>20170621T155926Z</EndTime> <MaxBitrate>1024</MaxBitrate> <RecordPos>1</RecordPos> <TV>2</TV> </Action> SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.40.55:7100;rport=7100;branch=z9hG4bK929522417 From: <sip:120105110228023020@192.168.40.55:7100>;tag=3721737815 To: <sip:00000000001310018021@192.168.40.66:7100>;tag=3556564953 Call-ID: 55014328 CSeq: 20 DO Content-Type: Application/DDCP User-Agent: NCG V2.6.0.299938 Content-Length: 494 <?xml version="1.0"?> <Response> <Variable>VODByRTSP</Variable> <Result>0</Result> <Bitrate>0</Bitrate> <Playurl>rtsp://192.168.40.66:7087/ncg00/rtsp://192.168.40.66:6304/file/vag_plug://192.168.40.66:6300/0/sessions/28e8deaef7a64db88010fee38da0ba31?ncgMode=1&devType=10001&ks=1497974400&js=1498031966&usrName=admin&passWord=jdwa2003</Playurl> <UsrName>admin</UsrName> <PassWord>password</PassWord> <TV>2</TV> <CamIndex>00000000001310018021</CamIndex> </Response>