A cross-domain RTSP streaming media transmission method
By determining the port mapping relationship between the media source agent and the client during RTSP streaming media transmission, direct cross-domain access in the RTSP protocol is realized, which solves the problem of difficulty in cross-domain forwarding in the existing technology and reduces the cost of the proxy server. Deployment difficulty and bandwidth usage.
Patent Information
- Application Number
- CN202111304071.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-11-05
AI Technical Summary
In the multi-network domain environment of industrial enterprises, the existing RTSP streaming media forwarding method cannot achieve cross-network forwarding, or requires setting up multi-level proxies, resulting in high bandwidth usage and difficult deployment.
By obtaining the client's RTSP request, determining the port mapping relationship between the media source agent and the client, and replacing the port in the RTSP protocol, direct cross-domain access between the media source and the client is achieved, avoiding the use of multi-level agents.
It realizes cross-domain direct access between media sources and clients in the RTSP protocol, reduces the difficulty of deploying proxy servers, improves access convenience, and avoids bandwidth occupation caused by multi-level proxies.
Smart Images

Figure CN114244908B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of streaming media transmission, and in particular relates to a cross-domain RTSP streaming media transmission method. Background Art
[0002] With the development of society and the further improvement of industrial intelligence, more and more attention is paid to the intelligent analysis and mining of various streaming media data, most of which come from physical devices such as cameras and microphones. In order to transmit streaming media data more efficiently and timely for later intelligent analysis, real-time streaming protocols are usually used to transmit streaming media data.
[0003] Real Time Streaming Protocol (RTSP) is an application layer protocol in the TCP / IP protocol system. This protocol defines how one-to-many applications can effectively transmit multimedia data over IP networks. RTSP is located above RTP and RTCP in terms of architecture and uses UDP or TCP to complete data transmission.
[0004] However, there are drawbacks in the multi-domain environment of industrial enterprises. Since the media sources and clients of industrial enterprises are mostly in different domains, servers in different domains cannot directly transmit streaming media information based on the RTSP protocol. Therefore, most existing RTSP streaming media forwarding methods cannot achieve cross-domain forwarding, or when cross-domain forwarding is required, multi-level proxies need to be set up, and multi-level proxy forwarding will occupy more bandwidth, and multi-level proxy deployment is difficult and inconvenient to expand. Summary of the invention
[0005] In order to solve the shortcomings and deficiencies in the prior art, the present invention proposes a cross-domain RTSP streaming media transmission method, comprising:
[0006] Get the RTSP request from the client and forward it to the media source proxy through the command transfer server;
[0007] Determine a first mapping relationship between a port of a media source agent and a port of a client, replace the port of the client in an RTSP protocol with the port of the media source agent based on the first mapping relationship, and send an RTSP request to the media source through the replaced RTSP protocol;
[0008] Get the media source's response to the RTSP request. When the response is sent to the media source proxy, get the streaming media information in the RTSP protocol at this time.
[0009] Determine a second mapping relationship between the port of the media source and the port of the client proxy, replace the port of the media source in the RTSP protocol with the port of the client proxy based on the second mapping relationship, and restore the port of the media source proxy in the RTSP protocol to the port of the client based on the first mapping relationship;
[0010] The streaming media information is sent to the client via the client proxy through the replaced RTSP protocol.
[0011] Optionally, determining a first mapping relationship between a port of the media source agent and a port of the client includes:
[0012] When the media source agent receives the RTSP request, it determines the RTP / RTCP port pair opened by the client in the current RTSP protocol, opens the first local UDP port pair of the media source agent, and establishes a first mapping relationship between the RTP / RTCP port pair and the first local UDP port pair.
[0013] Optionally, when determining the first mapping relationship between the port of the media source agent and the port of the client, the media source agent starts a p2p session of ice, and forwards the address information of the p2p session to the client agent via the command transfer server.
[0014] Optionally, replacing the port of the client in the RTSP protocol with the port of the media source agent based on the first mapping relationship, and sending the RTSP request to the media source through the replaced RTSP protocol includes:
[0015] Based on the first mapping relationship, the RTP / RTCP port pair opened by the client in the RTSP protocol is replaced with a first local UDP port pair for transmitting streaming media data;
[0016] Parse the RTSP request based on the address list pre-stored in the media source proxy;
[0017] Based on the replaced RTSP protocol, the parsing result of the RTSP request is sent to the media source.
[0018] Optionally, the process of generating the address list includes:
[0019] The media source agent obtains the RTSP address list of the media source in the local network domain, wherein the RTSP address list includes the RTSP url of the media source;
[0020] Encode each media source to generate a local unique identifier;
[0021] The corresponding relationship between the local unique identifier of the same media source and the RTSP URL is saved in an address list, and the address list is uploaded to the command forwarding server through the TCP protocol between the media source agent and the command forwarding server.
[0022] Optionally, parsing the RTSP request based on an address list pre-stored in the media source agent includes:
[0023] The media source proxy parses the original URL of the RTSP request to obtain a local unique identifier, finds the RTSP URL corresponding to the local unique identifier in a pre-stored address list, and uses the RTSP URL as the parsing result.
[0024] Optionally, determining a second mapping relationship between a port of the media source and a port of the client proxy includes:
[0025] When the client agent receives the return of the RTSP request, it determines the RTP / RTCP port pair opened by the media source in the current RTSP protocol, opens the second local UDP port pair of the client agent, and establishes a second mapping relationship between the RTP / RTCP port pair and the second local UDP port pair.
[0026] Optionally, when determining the second mapping relationship between the port of the media source and the port of the client agent, the client agent starts a p2p session of ice and forwards the address information of the p2p session to the media source agent via the command transfer server.
[0027] Optionally, replacing the port of the media source in the RTSP protocol with the port of the client proxy based on the second mapping relationship includes:
[0028] Based on the second mapping relationship, the RTP / RTCP port pair opened by the media source in the RTSP protocol is replaced with a second local UDP port pair used to transmit streaming media data.
[0029] Optionally, restoring the port of the media source agent in the RTSP protocol to the port of the client based on the first mapping relationship includes:
[0030] Based on the first mapping relationship, the first local UDP port pair in the RTSP protocol is restored to the RTP / RTCP port pair opened by the client.
[0031] The beneficial effects brought by the technical solution provided by the present invention are:
[0032] (1) The present invention provides a method for direct cross-domain access for media sources and clients in the RTSP protocol, so that the RTSP transmission between the media source and the client does not need to do any streaming media protocol conversion work. It only needs to replace the ports between the client and the media source agent, and the ports between the media source and the client agent, respectively, to achieve a transmission effect equivalent to that of local direct current. As long as the media source and client comply with the standard RTSP protocol, they can be accessed according to the method proposed by the present invention, which greatly improves the convenience of access.
[0033] (2) The client proxy and media source proxy are used as intermediate nodes. Even if the media sources of the streaming media are scattered in multiple private networks, they can be managed uniformly through the client proxy, media source proxy and command relay server. There is no need to set up multi-level proxy services and occupy too much bandwidth, which reduces the difficulty of deploying the proxy server. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0035] Figure 1 A schematic diagram of a flow chart of a cross-domain RTSP streaming media transmission method proposed by an embodiment of the present invention;
[0036] Figure 2 This is an architecture diagram of a cross-domain RTSP transmission system proposed in Embodiment 1;
[0037] Figure 3 Schematic diagram of URL replacement for RTSP request. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.
[0040] It should be understood that in various embodiments of the present invention, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0041] It should be understood that in the present invention, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0042] It should be understood that in the present invention, "plurality" refers to two or more than two. "And / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "Contains A, B and C", "Contains A, B, C" means that A, B, and C are all included, "Contains A, B or C" means that one of A, B, and C is included, and "Contains A, B and / or C" means that any one, any two, or any three of A, B, and C are included.
[0043] It should be understood that in the present invention, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A and B can be determined based on A. Determining B based on A does not mean determining B based only on A, but B can also be determined based on A and / or other information. A and B match when the similarity between A and B is greater than or equal to a preset threshold.
[0044] Depending on the context, "if" as used herein may be interpreted as "when" or "when" or "in response to determining" or "in response to detecting."
[0045] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0046] Embodiment 1
[0047] like Figure 1 As shown, this embodiment proposes a cross-domain RTSP streaming media transmission method, the RTSP streaming media transmission method involves a client and a client agent in a first domain, and a media source and a media source agent in a second domain, including:
[0048] S1: Get the RTSP request from the client and forward it to the media source proxy through the command transfer server;
[0049] S2: determining a first mapping relationship between a port of a media source proxy and a port of a client, replacing the port of the client in the RTSP protocol with the port of the media source proxy based on the first mapping relationship, and sending an RTSP request to the media source through the replaced RTSP protocol;
[0050] S3: Get the response of the media source to the RTSP request. When the response is sent to the media source agent, get the streaming media information in the RTSP protocol at this time.
[0051] S4: determining a second mapping relationship between the port of the media source and the port of the client proxy, replacing the port of the media source in the RTSP protocol with the port of the client proxy based on the second mapping relationship, and restoring the port of the media source proxy in the RTSP protocol to the port of the client based on the first mapping relationship;
[0052] S5: The streaming media information is sent to the client via the client proxy through the replaced RTSP protocol.
[0053] This embodiment provides a method for direct cross-domain access for the media source and client in the RTSP protocol, so that the RTSP transmission between the media source and the client does not need to do any streaming media protocol conversion, and achieves a transmission effect equivalent to local direct current. As long as the media source and client comply with the standard RTSP protocol, they can be accessed according to the method proposed by the present invention, which greatly improves the convenience of access.
[0054] In this embodiment, the client and the media source are in different network domains. The specific cross-domain RTSP transmission system is as follows: Figure 2 As shown, it includes the following modules:
[0055] a. Client (RTSP Client, RC), in this embodiment, a client that supports the RTSP protocol developed by itself or from a third party, is in an independent network domain Network C;
[0056] b. Media source (RTSP Server, RS), any hardware device or server that can provide RTSP protocol access, in another independent network domain Network B different from RC;
[0057] c. The client agent (RTSP Client Agent, RCA) is deployed in the network domain Network C where RC is located, simulating the RTSP media source server function. RC can directly access RCA through the RTSP protocol, that is, the transmission of RTP / RTCP protocol is realized through their respective local UDP ports;
[0058] d. The media source agent (RTSP Server Agent, RSA) is deployed in the network domain Network B where RS is located, simulating the RTSP client function. RSA can directly access the RTSP service of RS through the RTSP protocol, that is, realize the transmission of RTP / RTCP protocol through their respective local UDP ports;
[0059] e. Command Transfer Service (CTS), which can be deployed in any network domain different from RC and RS. In this embodiment, it is deployed in Network A, but it must be ensured that RCA and RSA can connect to the TCP service of CTS. Command data is transmitted between RCA and RSA through CTS.
[0060] The above is only a description of the functional modules and does not involve specific implementation methods. For example, RSA and RS can be different sub-modules in the same process, or different processes in the same physical device, or run on different physical devices.
[0061] In this embodiment, RCA and RSA respectively establish a command channel of TCP long connection with CTS, and the command protocol can use any protocol, such as HTTP protocol or protobuf private protocol. CTS uniquely identifies each connected RCA and RSA, that is, generates RCAID for RCA and RSAID for RSAS. RCA, RSA and CTS need to send heartbeat commands regularly to maintain the entire login cycle. At the same time, p2p communication is established between RCA and RSA through the ice framework to realize the transmission of streaming media information. RC starts the playback process according to the standard RTSP protocol, and the request address is the local service address of RCA. All RTSP protocol packets are encapsulated by the RCA command protocol and forwarded to CTS, and then forwarded to RSA by CTS. Finally, RSA parses the command protocol to obtain the real RTSP protocol and initiates an RTSP request to the real media source. The RTSP protocol returned by the media source is also reversely transmitted RSA->CTS->RCA->RC in the same way.
[0062] During the process of RCA and RSA maintaining the login cycle with CTS, RSA obtains the RTSP address of the media source in the local network through onvif search or manual configuration, that is, the RTSP url of the media source. Then encode each RS to generate a unique local unique identifier (Local Stream ID, LSID). RSA saves the correspondence between the RS's local unique identifier and the RTSP url in the address list. On the one hand, the address list is stored in RSA. The address list pre-stored in RSA is as follows:
[0063] {
[0064] "LSID1":"rtsp: / / 192.168.1.1:554 / stream1",
[0065] "LSID1":"rtsp: / / 192.168.1.1:554 / stream2",
[0066] "LSID1":"rtsp: / / 192.168.1.1:554 / stream3",
[0067] …
[0068] };
[0069] On the other hand, the address list is uploaded to the command transfer server synchronously through the TCP protocol between RSA and CTS. In the future, RC can query all global media sources through CTS. The global media source address list saved by CTS is as follows:
[0070]
[0071]
[0072] Among them, "RSAID1", "RSAID2" and "RSAID3" represent the IDs of different RSAs respectively, followed by the LSIDs of the media sources managed under each RSA.
[0073] When RC needs to obtain streaming media information of a media source, RC starts the playback process according to the standard RTSP protocol, thereby generating an RTSP request. In this embodiment, the format of the url of the RTSP request is "rtsp: / / [RCAIP]:[RCA local port] / [RSAID] / [LSID]". The RCA corresponding to the RCAIP parses the RSAID and LSID through the url and creates a context for the session.
[0074] In this embodiment, RS returns a REDIRECT message, and RSA needs to analyze the new URL, automatically create a new LSID for it, upload CTS, and update the path in the REDIRECT message URL to [RSAID] / [LSID]. When RCA receives the REDIRECT message, it needs to replace the IP and port of the URL in the message with the local address, and finally RC ends the old session TEARDOWN and connects to the new URL.
[0075] In this embodiment, the RTSP request of the client is obtained, and the command transfer server forwards the RTSP request to the media source agent. Specifically, the RTSP request is sent by the RC, sent to the RCA through the local network, and then sent to the RSA corresponding to the RSAID through the TCP protocol via CTS.
[0076] At this time, determine the first mapping relationship between the port of the media source agent and the port of the client, determine the RTP / RTCP port pair opened by the client in the current RTSP protocol, open the first local UDP port pair of the media source agent, and establish the first mapping relationship between the RTP / RTCP port pair and the first local UDP port pair. The purpose of determining the first mapping relationship is to enable the RS in Network B to communicate with the RTP / RTCP port pair of the RC in Network C in the future and transmit media data, and finally save the first mapping relationship locally on the media source agent.
[0077] In this embodiment, when determining the first mapping relationship between the port of the media source agent and the port of the client, the media source agent starts the p2p session of ice, and forwards the address information of the p2p session to the client agent via the command transfer server. The description format of the ice protocol usually adopts the standard Session Description Protocol (SDP), which is a description standard of the information format. Both the client agent and the media source agent need to inform the other party of their local address, external address and other information. The local address is obtained through the network card information, and the external address needs to be obtained through the STUN server or TURN server. Those skilled in the art should know how to implement p2p communication based on the ice protocol, which will not be repeated here.
[0078] This embodiment uses the first mapping relationship to replace the client-opened RTP / RTCP port pair involved in the RTSP protocol with the first local UDP port pair, so that the RTSP request of the RC can be received by the RS in different network domains, specifically:
[0079] Based on the first mapping relationship, the RTP / RTCP port pair opened by the client in the RTSP protocol is replaced with the first local UDP port pair. In the RTSP protocol, the SETUP request needs to be used to indicate how the streaming media is transmitted. The SETUP operation must be performed before each streaming media is played. When sending the SETUP request, the client will specify two ports, one port for transmitting RTP data and one port for transmitting RTCP data. In this embodiment, after the SETUP request of the RTSP request reaches RSA, RSA parses the client_port=port1-port2 of the Transport in the RTSP protocol header, port1-port2 represents a pair of RTP-RTCP ports of the client, and client_port represents the port pair opened by RC before initiating the SETUP request for receiving streaming media data in the future. At this time, RSA opens two local UDP ports, namely the first local UDP port to replace port1 and port2. Because the RS in the same Network B can recognize the UDP port of RSA, the RS can recognize the replaced RTSP protocol, and then forward the replaced RTSP request to the media source corresponding to the RTSP url based on the replaced RTSP protocol.
[0080] The RTSP request is parsed based on the address list pre-stored in the media source proxy, and the parsed result of the RTSP request is sent to the media source based on the replaced RTSP protocol. For example, RSA finds the RTSP url of RS based on the address list stored locally, and replaces the original url of the RTSP request with the RTSP url, for example Figure 3 As shown in the figure, the original URL of the RTSP request sent by RCA is "rtsp: / / 172.16.1.0:554 / RSAID / LSID1", where "172.16.1.0" is the local IP of RCA, "554" is the local port of RCA, RSAID is the ID assigned by CTS to RSA, and LSID1 is the ID assigned by RSA to RS in the local network. By searching the address list, we can know that RSAID corresponds to Figure 3 The several LSIDs shown replace the original url of the RTSP request with the specific url of LSID1. It can be seen that the url of the RTSP request after replacement is "rtsp: / / 192.168.1.1:554 / Channels / 101?transportmode=unicast".
[0081] Then, based on the replaced RTSP protocol, the parsed result of the RTSP request is sent to the media source via the local network, and the RTSP request is sent to the RS corresponding to "rtsp: / / 192.168.1.1:554 / Channels / 101?transportmode=unicast", and the streaming media information of the RS is obtained. Since RS and RSA are in the same Network B, the streaming media information can be directly sent to RSA via the local network, and the SETUP return process is entered at this time.
[0082] When SETUP returns, the second mapping relationship between the ports of the media source and the client agent is first determined, in the same way as the determination of the first mapping relationship, specifically: when the client agent receives the return of the RTSP request, that is, the SETUP returns, the RTP / RTCP port pair opened by the media source in the current RTSP protocol is determined, the second local UDP port pair of the client agent is opened, and the second mapping relationship between the RTP / RTCP port pair and the second local UDP port pair is established; the second mapping relationship is locally saved on the client agent.
[0083] Similar to the SETUP request, when determining the second mapping relationship between the media source port and the client proxy port, the client proxy opens the ice p2p session and forwards the address information of the p2p session to the media source proxy via the command transfer server. Thus, a p2p session is established between RSA and RCA for transmitting streaming media information.
[0084] Since in the SETUP request phase, the RTP / RTCP port pair client_port of RC in the RTSP protocol has been replaced with the first local UDP port pair in order for RS to transmit media data with RSA in the future, the replaced client_port needs to be restored when SETUP returns, that is, based on the first mapping relationship, the first local UDP port pair in the RTSP protocol is restored to the RTP / RTCP port pair opened by the client, so that the first local UDP port pair in the RTSP protocol is restored to client_port at this time, so that RC can receive it. Subsequently, in order for RCA to transmit media data with RC in the future, based on the second mapping relationship, the RTP / RTCP port pair opened by the media source in the RTSP protocol is replaced with the second local UDP port pair. For example, when the SETUP of the RTSP request returns, RCA parses the server_port of Transport in the RTSP protocol header = port3-port4, port3-port4 represents a pair of RTP-RTCP ports representing the media source, and server_port represents the port pair opened by RS for transmitting streaming media data in the future. At this time, RCA opens two more local UDP ports, namely the second local UDP port to replace port3 and port4. Because the RC in the same Network C can identify the UDP port of RCA, the RC can identify the replaced RTSP protocol, and then based on the replaced RTSP protocol, send the streaming media information of the media source's response to the RTSP request to the client via the media source proxy and the client proxy in sequence.
[0085] It can be seen that, on the one hand, this embodiment unifies the addresses of multiple media sources through a pre-established address list, that is, generates a unique LSID, so that the RC can obtain streaming media information of different media sources across network domains. On the other hand, the RTSP protocol is processed through the first mapping relationship and the second mapping relationship, so that the RC and RS between multiple different network domains can perform streaming media transmission based on the RTSP protocol.
[0086] In this embodiment, for the security of RTSP transmission, when the client agent obtains the RTSP request of the client, it is also necessary to authenticate the RTSP request according to the Authorization header information in the Header of the RTSP request. When the Authorization header information defines the authentication method as Basic authentication, the authentication is completed by Base64 encoding the username field and password field in the RTSP request. When the Authorization header information defines the authentication method as Digest authentication, the username field and the response header field are reset according to the preset authentication rules of RTSP to complete the authentication.
[0087] At the same time, each time the RTSP protocol returns, it is necessary to record the CSeq and Session in the Header for use in subsequent sessions. For example, when RCA is abnormally disconnected, RSA can attach CSeq and Session and send TearDown to close the session.
[0088] The serial numbers in the above embodiments are for description only and do not represent the sequence of the components during assembly or use.
[0089] The above descriptions are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A cross-domain RTSP streaming media transmission method, characterized in that: The RTSP streaming media transmission method comprises: Get the RTSP request from the client and forward it to the media source proxy through the command transfer server; Determine a first mapping relationship between a port of a media source agent and a port of a client, replace the port of the client in the RTSP protocol with the port of the media source agent based on the first mapping relationship, and send an RTSP request to the media source through the replaced RTSP protocol; Get the media source's response to the RTSP request. When the response is sent to the media source proxy, get the streaming media information in the RTSP protocol at this time. Determine a second mapping relationship between the port of the media source and the port of the client proxy, replace the port of the media source in the RTSP protocol with the port of the client proxy based on the second mapping relationship, and restore the port of the media source proxy in the RTSP protocol to the port of the client based on the first mapping relationship; The streaming media information is sent to the client via the client proxy through the replaced RTSP protocol; The determining of a first mapping relationship between a port of a media source agent and a port of a client includes: When the media source agent receives the RTSP request, determining the RTP / RTCP port pair opened by the client in the current RTSP protocol, opening a first local UDP port pair of the media source agent, and establishing a first mapping relationship between the RTP / RTCP port pair and the first local UDP port pair; The determining of a second mapping relationship between a port of a media source and a port of a client proxy includes: When the client agent receives a response to the RTSP request, determining the RTP / RTCP port pair opened by the media source in the current RTSP protocol, opening a second local UDP port pair of the client agent, and establishing a second mapping relationship between the RTP / RTCP port pair and the second local UDP port pair; When determining the first mapping relationship between the port of the media source agent and the port of the client, the media source agent starts a p2p session of ice, and forwards the address information of the p2p session to the client agent via the command transfer server; Performing request authentication on the RTSP request obtained by the client agent based on the information definition authentication method; While the client agent and the media source agent maintain a login cycle with the command forwarding service, the media source agent obtains the RTSP address of the local media source, encodes it to generate a unique identifier of the media source, and saves the correspondence between the unique identifier of the media source and the RTSP address of the media source to the address list of the media source agent. Synchronously, based on the TCP protocol between the media source agent and the command forwarding service, the address list is uploaded to the command forwarding server in real time.
2. A cross-domain RTSP streaming media transmission method according to claim 1, characterized in that: The method of replacing the port of the client in the RTSP protocol with the port of the media source agent based on the first mapping relationship, and sending the RTSP request to the media source through the replaced RTSP protocol, includes: Based on the first mapping relationship, the RTP / RTCP port pair opened by the client in the RTSP protocol is replaced with a first local UDP port pair for transmitting streaming media data; Parse the RTSP request based on the address list pre-stored in the media source proxy; Based on the replaced RTSP protocol, the parsing result of the RTSP request is sent to the media source.
3. A cross-domain RTSP streaming media transmission method according to claim 2, characterized in that: The parsing of the RTSP request based on the address list pre-stored in the media source agent includes: The media source proxy parses the original URL of the RTSP request to obtain a local unique identifier, finds the RTSP URL corresponding to the local unique identifier in a pre-stored address list, and uses the RTSP URL as the parsing result.
4. A cross-domain RTSP streaming media transmission method according to claim 1, characterized in that: When determining the second mapping relationship between the port of the media source and the port of the client agent, the client agent starts the p2p session of ice and forwards the address information of the p2p session to the media source agent via the command transfer service end.
