欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Rtsp支持Scale的抓包

程序员文章站 2022-03-04 23:41:53
...

rtsp客户度采用live555的openRTSP,命令行为:./openRTSP -z 4 “rtspurl”

live555 关于openRTSP介绍
关于rtsp官方介绍

'Trick play' options
RTSP servers may optionally support 'trick play' operations on a stream - specifically, the ability to seek to a specific time within the stream, and/or the ability to play the stream in fast-forward, slow, or reverse play.

Use the "-s <initial-seek-time>" option to request that the stream be started at the <initial-seek-time> second mark (default: 0.0). Use the "-z <scale>" option to request fast-forward play (<scale> > 1.0), slow play (0 < <scale> < 1.0), or reverse play (<scale> < 0.0). (The default value is 1.0: normal play.)

It's important to note that many, if not most RTSP servers will not support 'trick play' operations, or may support them for some media types only. The actual <initial-seek-time> and <scale> chosen by the server will be shown in the server's response to the RTSP "PLAY" command. 

下面是抓包结果:

Sending request: 
OPTIONS rtsp://172.0.22.9:554/01243760000000000101?DstCode6c&UserId=3& RTSP/1.0
CSeq: 2
User-Agent: ./openRTSP (LIVE555 Streaming Media v2019.07.27)


PTIONS response:
RTSP/1.0 200 OK
CSeq: 2
Date: Fri Nov 05 06:26:50 2021 GMT
Server: HUAWEI MDU/R002C02
Range: npt=now-
Public: HEARTBEAT, OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, ANNOUNCE
Content-Length: 0
Content-Type: text/parameters


Sending request: 
DESCRIBE rrtsp://172.0.22.9:554/01243760000000000101?DstCode6c&UserId=3& RTSP/1.0
CSeq: 3
User-Agent: ./openRTSP (LIVE555 Streaming Media v2019.07.27)
Accept: application/sdp


DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Session: 5bfb89883e0111ec80009c52f860d8fd
Date: Fri Nov 05 06:26:50 2021 GMT
Server: HUAWEI MDU/R002C02
Content-Length: 262
Content-Type: application/sdp

v=0
o=Unnamed 1532 1 IN IP4 172.0.22.9
s=mu HUAWEI
i=Unnamed to pu
u=rtsp://172.0.22.9:554/hw.sdp
c=IN IP4 172.0.22.9
t=0 0
m=video 0 RTP/AVP 99
a=rtpmap:99 H264/90000
a=control:trackID=1
m=audio 0 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=control:trackID=2

setBackgroundHandlingPoll, sockNum:5
Created receiver for "video/H264" subsession (client ports 38292-38293)
setBackgroundHandlingPoll, sockNum:7
Created receiver for "audio/PCMA" subsession (client ports 60746-60747)

Sending request: 
SETUP rtsp://172.0.22.9:554/01243760000000000101?DstCode6c&UserId=3&/trackID=1 RTSP/1.0
CSeq: 4
User-Agent: ./openRTSP (LIVE555 Streaming Media v2019.07.27)
Transport: RTP/AVP;unicast;client_port=38292-38293


SETUP response:
RTSP/1.0 200 OK
CSeq: 4
Session: 5bfb89883e0111ec80009c52f860d8fd
Date: Fri Nov 05 06:26:50 2021 GMT
Server: HUAWEI MDU/R002C02
Transport: RTP/AVP;unicast;destination=0.0.0.0;client_port=38292-38293;source=255.255.255.255;server_port=0-1


Setup "video/H264" subsession (client ports 38292-38293)
Sending request: 
SETUP rtsp://172.0.22.9:554/01243760000000000101?DstCode6c&UserId=3&/trackID=2 RTSP/1.0
CSeq: 5
User-Agent: ./openRTSP (LIVE555 Streaming Media v2019.07.27)
Transport: RTP/AVP;unicast;client_port=60746-60747
Session: 5bfb89883e0111ec80009c52f860d8fd


SETUP response:
RTSP/1.0 200 OK
CSeq: 5
Session: 5bfb89883e0111ec80009c52f860d8fd
Date: Fri Nov 05 06:26:50 2021 GMT
Server: HUAWEI MDU/R002C02
Transport: RTP/AVP;unicast;destination=0.0.0.0;client_port=60746-60747;source=255.255.255.255;server_port=0-1


Setup "audio/PCMA" subsession (client ports 60746-60747)
Created output file: "video-H264-1"
setBackgroundHandlingPoll, sockNum:4
Created output file: "audio-PCMA-2"
setBackgroundHandlingPoll, sockNum:6

Sending request: 
PLAY rtsp://172.0.22.9:554/01243760000000000101?DstCode6c&UserId=3& RTSP/1.0
CSeq: 6
User-Agent: ./openRTSP (LIVE555 Streaming Media v2019.07.27)
Session: 5bfb89883e0111ec80009c52f860d8fd
Scale: 4.000000
Range: npt=0.000-


PLAY response:
RTSP/1.0 200 OK
CSeq: 6
Session: 5bfb89883e0111ec80009c52f860d8fd