1024programmer News rtsp protocol interaction process

rtsp protocol interaction process

This article mainly introduces the knowledge points about it. Friends who are interested in [RTSP main process] and [rtsp protocol interaction process] can read the technical article contributed by [huabiaochen]. I hope this technology and experience can help you solve it. The technical issues related to [protocol] you encountered.

RTSP protocol interaction process

Streaming media push process

option -> Announce -> Setup -> Record

Streaming media streaming process

option -> Describe -> Setup -> Play

?

1. OPTIONS
OPTIONSrtsp://10.137.10.103/test.mpg RTSP/1.0

CSeq: 1

User-Agent:LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)

/**********************Comment********************** //

OPTIONS request

This method is used to detect the methods supported by the server; this method can be sent to the server at any time.

[OPTIONS]: Method.

[rtsp://10.137.10.103/test.mpg]: URL of the requested media stream.

[RTSP/1.0]: RTSP version.

[CSeq]: serial number, every time a separate request is sent, the serial number will be incremented by one. If a request is resent due to lack of acknowledgment, the request MUST carry the original sequence number.

/********************************************** */

RTSP/1.0 200 OK

CSeq: 1

Date: Fri, May 082015 06:19:14 GMT

Public: OPTIONS,DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER

/**********************Comment********************** //

OPTIONS response

[RTSP/1.0] RTSP version.

[200 OK]: status code and reason explanation.

【CSeq】: Serial number, corresponding to the request serial number.

【Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER】: All methods supported by the server.

/********************************************** */

2. DESCRIBE
DESCRIBErtsp://10.137.10.103/test.mpg RTSP/1.0

CSeq: 2

User-Agent:LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)

Accept:application/sdp

/**********************Comment********************** //

DESCRIBE request

Get the representation or description of the media object identified by the request URL from the server. It may use Acceptheader to indicate the media description format that the client can understand. The server responds with a description of the requested resource. The RTSP client can receive media description information through the following methods:

l??by DESCRIBE method

l?? Some other protocols (HTTP, email attachments, etc.)

l?? via command line or standard input

[Accept: application/sdp]: Specifies the media description format that the client can understand.

/********************************************** */

RTSP/1.0 200 OK

CSeq: 2

Date: Fri, May 082015 06:19:14 GMT

Content-Base:rtsp://10.137.10.103/test.mpg/

Content-Type: application/sdp

Content-Length: 480

v=0

o=- 14310658681918091 IN IP4 10.137.10.103

s=MPEG-1 or 2 ProgramStream, streamed by the LIVE555 Media Server

i=test.mpg

t=0 0

a=tool:LIVE555Streaming Media v2014.03.16

a=type:broadcast

a=control:*

a=range:npt=0-1510.048

a=x-qt-text-nam:MPEG-1or 2 Program Stream, streamed by the LIVE555 Media Server

a=x-qt-text-inf:test.mpg

m=video 0 RTP/AVP 32

c=IN IP4 0.0.0.0

b=AS:500

a=control:track1

m=audio 0 RTP/AVP 14

c=IN IP4 0.0.0.0

b=AS:128

a=control:track2

/**********************Comment********************** //

DESCRIBE response

Content content is SDP information.

/********************************************** */

3. SETUP
SETUPrtsp://10.137.10.103/test.mpg/track1 RTSP/1.0

CSeq: 3

User-Agent:LibVLC/2.1.5 (LIVE555 Streaming Media v2014.05.27)

Transport:RTP/AVP;unicast;client_port=61948-61949

/**********************Comment********************** //

SETUP request

Defines the transmission method of the real-time stream between the server and the client. The Transport header lists in detail the data transmission parameters acceptable to the client?; the response will contain the transmission parameters selected by the server. ? The server generates a session identifier when responding to a SETUP request; if the SETUP request sent to the server contains a session identifier, the server must bind the SETUP request to an existing session.

【Transport】: Lists the data transmission parameters that the client can accept. The Transport request header indicates which transport protocol to use, and configures parameters such as destination address, compression, time-to-live (time-to-live) for multicast, and destination port number for each flow. Transfer parameters are comma-separated and ordered by priority.

/********************************************** */

RTSP/1.0 200 OK

CSeq: 3

Date: Fri, May 082015 06:19:14 GMT

Transport:RTP/AVP;unicast;destination=10.137.10.107;source=10.137.10.103;client_port=61948-61949;server_port=6970-6971

Session: 1072919DContains the mandatory header address, instructing the client to issue the URL request; it may also include parameter ranges to indicate when the redirection will take effect. If the client wants to continue sending or receiving URL media, the client must send a TEARDOWN request for the current connection, and send a SETUP request for a new connection to the specified host. SETUPC->SS requires that the SETUP request for the URL specify the transport mechanism for streaming media. The client issues a SETUP request to the stream being played to change the transmission parameters allowed by the server. If this is not allowed, the response error is “455 Method Not Valid In This State”. In order to penetrate the firewall, the client must specify the transmission parameters, even if there is no effect on these parameters SET_PARAMETERC->S S->CP,S optional request to set the parameter value of the presentation or URL specified stream. Requests should contain only a single parameter, allowing the client to determine why a particular request failed. If the request contains multiple parameters, all parameters can be successfully set, and the server must only act on the request. Servers MUST allow parameters to be set to the same value repeatedly, but not change parameter values. Note: The media streaming parameters must be set with the SETUP command. Restricting SETUP transfer parameters to SETUP is beneficial for firewalls. Divide the parameters into a regular arrangement, resulting in more meaningful error indications TEARDOWNC->SP,S requires TEARDOWN requests to stop sending of the given URL stream and release related resources. If the URL is this demo URL, any RTSP connection flags are no longer valid. Unless all transfer parameters are defined by the connection description, a SETUP request must be issued before the connection can be played again

================================================== ===

1. RTSP

The RTSP[3] protocol works in a client-server manner. It is a multimedia playback control protocol used to enable users to control when playing real-time data downloaded from the Internet, such as: pause/continue, rewind, forward, etc. Therefore, RTSP is also called “Internet Video Recorder Remote Control Protocol”.

1.1. RTSPProtocol Introduction

To realize the control function of RTSP, not only the protocol, but also a dedicated media player and media server are required. The relationship between a media server and a media player is that of a server and a client.

The biggest difference between a media server and an ordinary web server is that the media server supports the transmission of streaming audio and video, so the media player on the client side can play while downloading (the program needs to be cached for a short period of time). But when downloading a multimedia program from a common WWW server, the whole file is downloaded first, and then played.

??????????????????

?

Figure 1 Relationship between RTSP, RTP and RTCP

RTSP Just enables media players to control the delivery of multimedia streams. Hence, RTSP is also known as an out-of-band protocol, while multimedia streams are delivered in-band using RTP.

The copyright of “RTSP Main Process” in this article is owned by huabiaochen, and the reference to the RTSP main process must follow the CC 4.0 BY-SA copyright agreement.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/rtsp-protocol-interaction-process/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索