CN113329040A - Protocol conversion method and device in media stream forwarding process - Google Patents

Protocol conversion method and device in media stream forwarding process Download PDF

Info

Publication number
CN113329040A
CN113329040A CN202110883565.9A CN202110883565A CN113329040A CN 113329040 A CN113329040 A CN 113329040A CN 202110883565 A CN202110883565 A CN 202110883565A CN 113329040 A CN113329040 A CN 113329040A
Authority
CN
China
Prior art keywords
rtsp
session
data packet
timer
media stream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110883565.9A
Other languages
Chinese (zh)
Other versions
CN113329040B (en
Inventor
叶恒
陆晓艳
颜海洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Huaiye Information Technology Co ltd
Original Assignee
Jiangsu Huaiye Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Huaiye Information Technology Co ltd filed Critical Jiangsu Huaiye Information Technology Co ltd
Priority to CN202110883565.9A priority Critical patent/CN113329040B/en
Publication of CN113329040A publication Critical patent/CN113329040A/en
Application granted granted Critical
Publication of CN113329040B publication Critical patent/CN113329040B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1101Session protocols
    • H04L65/1104Session initiation protocol [SIP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a protocol conversion method and a device in a media stream forwarding process, wherein the method comprises the following steps: receiving a data request initiated by an RTSP client, and establishing session mapping; extracting key content in the data request, and initiating SIP session flow to the SIP server according to the key content; receiving a media stream sent by an SIP server, analyzing, framing, unpacking and storing the media stream into a cache queue, wherein the analyzed content comprises a media format of the media stream; and sending the data packet in the buffer queue to the RTSP client according to the RTSP session. The method can convert the GB28181 protocol into the RTSP protocol and can support different media formats, so that the resource access of the RTSP client to any media coding format of the GB28181 protocol is effectively realized, the continuous development and evolution of the media coding format are facilitated, and the universality and the adaptive capacity of media interaction are greatly improved.

Description

Protocol conversion method and device in media stream forwarding process
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a protocol conversion method in a media stream forwarding process, a protocol conversion apparatus in a media stream forwarding process, a non-transitory computer-readable storage medium, and a computer device.
Background
The video monitoring system relates to interconnection among a plurality of devices and platforms, and in the process of interconnection, conversion of a plurality of protocols is involved, and among them, the mode of converting the GB28181 Protocol into the RTSP (Real Time Streaming Protocol) Protocol is the most common. Due to the difference of the specifications of the two protocols, the following defects exist in the protocol conversion layer in the current video security system:
RTSP is based on a server/client architecture, and the RTSP 2.0 version defines a method for RTSP media playing to indicate functions required by the RTSP to control media on-demand, and generally, in a signaling method before media Session establishment, an SDP (Session Description Protocol) Protocol is used to indicate media information, where the media information includes: media type (video, audio, etc.), transport protocol (RTP/UDP/IP, H.320, etc.), media format (H.264 video, H.265 video, MPEG video, etc.), multicast or remote (unicast) address and port.
In GB28181, the media interaction uses the SIP (Session Initiation Protocol), which is the IP (Internet Protocol) telephony signaling Protocol proposed by the network engineering task force. SIP also defines a SIP session method for indicating functions required by SIP to control a session, and in signaling interaction before media session is established, the SDP protocol is also used to indicate media information, but when SIP interaction is used, media data is usually packaged as a PS (Program Stream) packet, i.e., a type of a composite packet, so the actual media type is hidden in SDP information, and is generally embodied in the form of PS/9000.
In the early draft of the GB28181 protocol, there are many devices in domestic that use h.264 as a media format, and when the GB28181 and RTSP protocols are converted, the h.264 format is converted by default, that is, only the protocol signaling layer is converted. However, more and more excellent media formats, such as H265, SVAC, AV1, etc., emerge, so that the media attributes cannot be delivered at the signaling level alone, and the above-mentioned conversion method fails.
In view of this, there are some simple processing methods, such as manually labeling the media format of each accessed video source in the system, or using one encoding format in a set of systems as much as possible, but these methods do not completely solve the problem, so that the whole media system has the disadvantage of interaction.
Disclosure of Invention
The invention provides a protocol conversion method in the media stream forwarding process for solving the technical problems, which can convert the GB28181 protocol into the RTSP protocol and support different types of media formats, thereby effectively realizing the resource access of the RTSP client to any media coding format of the GB28181 protocol, facilitating the continuous development and evolution of the media coding format and greatly improving the universality and the adaptation capability of media interaction.
The invention also provides a protocol conversion device in the media stream forwarding process.
The invention also proposes a non-transitory computer-readable storage medium.
The invention also provides computer equipment.
To achieve the above object, an embodiment of a first aspect of the present invention provides a protocol conversion method in a media stream forwarding process, including the following steps: receiving a data request initiated by an RTSP client, and establishing a session mapping, wherein one end of the session mapping corresponds to an RTSP session, and the other end of the session mapping corresponds to an SIP session; extracting key content in the data request, and initiating an SIP session to an SIP server according to the key content so that the SIP server sends a media stream according to the SIP session, wherein the key content comprises an identifier of the SIP server; receiving the media stream sent by the SIP server, analyzing, splicing and unpacking the media stream, and storing the media stream into a cache queue, wherein the analyzed content comprises a media format of the media stream; and initiating an RTSP session to the RTSP client according to the session mapping, and sending the data packet in the buffer queue to the RTSP client according to the RTSP session so as to convert the GB28181 protocol into an RTSP protocol.
The protocol conversion method in the media stream forwarding process proposed by the present invention can also have the following additional technical features:
according to one embodiment of the present invention, sending the data in the buffer queue to the RTSP client according to an RTSP session includes: setting a time interval of a timer according to a frame interval time of a data packet in the buffer queue, wherein the time interval of the timer is less than the frame interval time; judging whether the time stamp of the data packet in the cache queue meets the current time interval range of a timer or not; if the timestamp of the data packet in the cache queue meets the current time interval range of the timer, sending the data packet meeting the current time interval range of the timer; if the timestamp of the data packet in the cache queue does not meet the current time interval range of the timer, stopping the data packet transmission in the current period; after the next time interval of the timer is reached, returning to the step of judging whether the time stamp of the data packet in the cache queue meets the current time interval range of the timer; and when receiving a data packet receiving stopping instruction sent by the RTSP client, emptying the buffer queue and closing the RTSP session.
According to one embodiment of the invention, the time interval of the timer is set according to the following formula:
Figure 204734DEST_PATH_IMAGE001
wherein, Δ t is the time interval of the timer, t is the frame interval time of the data packet, and n is a positive integer.
In order to achieve the above object, a second embodiment of the present invention provides a protocol conversion apparatus in a media stream forwarding process, including: the receiving module is used for receiving a data request initiated by an RTSP client and establishing a session mapping, wherein one end of the session mapping corresponds to an RTSP session, and the other end of the session mapping corresponds to an SIP session; the SIP session initiating module is used for extracting key content in the data request and initiating an SIP session to the SIP server according to the key content so that the SIP server sends a media stream according to the SIP session, and the key content comprises an identifier of the SIP server; the analysis module is used for receiving the media stream sent by the SIP server, analyzing, splicing, unpacking and storing the media stream into a cache queue, wherein the analysis content comprises a media format of the media stream; the RTSP conversation initiating module is used for initiating an RTSP conversation to the RTSP client according to the conversation mapping and sending the data packet in the cache queue to the RTSP client according to the RTSP conversation so as to convert the GB28181 protocol into an RTSP protocol.
The protocol conversion device in the media stream forwarding process proposed above in the present invention may also have the following additional technical features:
according to an embodiment of the present invention, the RTSP session initiating module is further configured to: setting a time interval of a timer according to a frame interval time of a data packet in the buffer queue, wherein the time interval of the timer is less than the frame interval time; judging whether the time stamp of the data packet in the cache queue meets the current time interval range of a timer or not; if the timestamp of the data packet in the cache queue meets the current time interval range of the timer, sending the data packet meeting the current time interval range of the timer; if the timestamp of the data packet in the cache queue does not meet the current time interval range of the timer, stopping the data packet transmission in the current period; after the time interval of the next timer is reached, returning to the step of judging whether the time stamp of the data packet in the cache queue meets the current time interval range of the timer or not; and when receiving a data packet receiving stopping instruction sent by the RTSP client, emptying the buffer queue and closing the RTSP session.
According to one embodiment of the present invention, the RTSP session initiation module sets the time interval of the timer according to the following formula:
Figure 73464DEST_PATH_IMAGE002
wherein, Δ t is the time interval of the timer, t is the frame interval time of the data packet, and n is a positive integer.
To achieve the above object, a third aspect of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a protocol conversion method in a media stream forwarding process according to the first aspect of the present invention.
To achieve the above object, a fourth aspect of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the protocol conversion method in the media stream forwarding process according to the first aspect of the present invention.
The invention has the beneficial effects that:
(1) the invention can convert the GB28181 protocol into the RTSP protocol and can support different media formats, thereby effectively realizing the resource access of the RTSP client to any media coding format of the GB28181 protocol, facilitating the continuous development and evolution of the media coding format and greatly improving the universality and the adaptive capacity of media interaction.
(2) And in the RTSP signaling interaction process, the data packets in the buffer queue are sent according to the time segments without adopting circular sending, so that the phenomenon that the instantaneous code rate is too high when the RTSP client receives the data can be avoided.
Drawings
Fig. 1 is a flowchart of a protocol conversion method in a media stream forwarding process according to an embodiment of the present invention;
fig. 2 is a process diagram of a protocol conversion method in a media stream forwarding process according to an embodiment of the present invention;
fig. 3 is a flowchart of a protocol conversion method in a media stream forwarding process according to another embodiment of the present invention;
FIG. 4 is a schematic diagram of packet transmission in a buffer queue according to one embodiment of the invention;
fig. 5 is a block diagram illustrating a protocol conversion device in a media stream forwarding process according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
RTSP is an application layer Protocol in TCP/IP (Transmission Control Protocol/Internet Protocol) Protocol system, and is an IETF (Internet Engineering Task Force) RFC (Request For documents, a series of files with a scheduled number) standard submitted by the companies of columbia university, Internet view and RealNetworks. GB28181 "information transmission, exchange and control technical requirements of safety and protection video monitoring networking system" is a national standard proposed by the Ministry of public Security, scientific and informatization Bureau, which is drawn together by multiple units in the Ministry of public Security.
Fig. 1 is a flowchart of a protocol conversion method in a media stream forwarding process according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
and S1, receiving a data request initiated by the RTSP client, and establishing a session mapping, wherein one end of the session mapping corresponds to the RTSP session, and the other end corresponds to the SIP session.
S2, extracting the key content in the data request, and initiating SIP conversation to the SIP server according to the key content, so that the SIP server sends the media stream according to the SIP conversation, wherein the key content includes the identification of the SIP server.
S3, receiving the media stream sent by the SIP server, analyzing, framing, unpacking and storing the media stream into a buffer queue, wherein the analyzed content includes the media format of the media stream.
And S4, initiating an RTSP session to the RTSP client according to the session mapping, and sending the data packet in the buffer queue to the RTSP client according to the RTSP session so as to convert the GB28181 protocol into an RTSP protocol.
Specifically, as shown in fig. 2, the execution main body of the method may be a media server, the RTSP client initiates a data request for one path of media stream, the media server establishes a session map and manages the session map after receiving the data request, one end of the session map corresponds to an RTSP session, and the other end corresponds to an SIP session. Then, the media server can extract key content from the data request of the RTSP, the key content mainly includes an identifier of the SIP server, and initiates an SIP session to the corresponding SIP server after matching the identifier of the SIP server with a pre-stored identifier, and the SIP server replies to the SIP session to perform SIP session interaction.
After the SIP session interaction is completed, the SIP server delivers the media stream, and at this time, the media server parses, splices, and unpacks the media stream, and needs to parse the media format (e.g., h.264 video, h.265 video, MPEG video, etc.) of the media stream and store the media format into the buffer queue. After the media format of the media stream is analyzed, the signaling interaction with the RTSP session at the other end is continuously completed through the corresponding identifier of the previous session, and the resource access of the RTSP client to any media coding format of the GB28181 protocol is effectively realized. After the signaling interaction between the media server and the RTSP session is completed, the data can be taken out from the previous buffer queue and transmitted to the RTSP client, so that the conversion interaction between the GB28181 protocol and the RTSP protocol is completed.
Therefore, the method can convert the GB28181 protocol into the RTSP protocol from a data cladding layer surface rather than a signaling layer surface, and can support different media formats, thereby effectively realizing the resource access of the RTSP client to any media coding format of the GB28181 protocol, facilitating the continuous development and evolution of the media coding format, and greatly improving the universality and the adaptation capability of media interaction.
In step S4, since the data of the media stream already enters the buffer queue during the RTSP signaling interaction process, after the RTSP signaling interaction is completed, if the queue data is simply sent circularly, the instant code rate at the receiver of the RTSP client will be too high, and therefore, the invention sends the data in the buffer queue according to the time slice.
Specifically, according to an embodiment of the present invention, as shown in fig. 3, sending the data packets in the buffer queue to the RTSP client according to the RTSP session includes:
and S10, setting the time interval of the timer according to the frame interval time of the data packets in the buffer queue, wherein the time interval of the timer is smaller than the frame interval time.
Further, the time interval of the timer is set according to the following formula:
Figure 654224DEST_PATH_IMAGE002
wherein, Δ t is the time interval of the timer, t is the frame interval time of the data packet, n is a positive integer, and n can be 3, 4, 5.
And S20, judging whether the time stamp of the data packet in the buffer queue meets the current time interval range of the timer.
And S30, if the timestamp of the data packet in the buffer queue meets the current time interval range of the timer, transmitting the data packet meeting the current time interval range of the timer.
And S40, if the time stamp of the data packet in the buffer queue does not satisfy the current time interval range of the timer, the data packet transmission in the current period is terminated.
S50, when the next time interval of the timer is reached, the process returns to the step S20.
And S60, emptying the buffer queue and closing the RTSP conversation after receiving the instruction for stopping receiving the data packet sent by the RTSP client.
Specifically, if the frame rate of the packet is 25 frames/s, the frame interval time is 1/25 × 1000=40ms, and the time interval t of the timer needs to be set to be less than 40ms and equal to 1 integral multiple of 40ms, for example, equal to one fourth of 40ms, i.e., 10 ms.
As shown in fig. 4, it is determined whether the timestamp of the data packet in the buffer queue satisfies the current time interval range of the timer, where the current time interval range in fig. 4 is 1-10ms as an example, if the timestamp of the data packet in the buffer queue belongs to 1-10ms, the data packet is sent; if the time stamp of the data packet in the buffer queue does not satisfy the current time interval range of the timer, for example, the time stamp of the data packet in the buffer queue is 12ms, the data packet transmission of the current period is terminated, after the next time interval of the timer arrives, that is, after the time of the timer arrives 10ms, that is, after the next time interval of the timer arrives 10-20ms, whether the time stamp of the data packet in the buffer queue belongs to 10-20ms or not is continuously judged, and the data packet whose time stamp belongs to 10-20ms in the buffer queue is transmitted, thus, the cycle of judgment is performed. And sending a data packet receiving stopping instruction after the RTSP client-side data packet is received, and emptying the buffer queue and closing the RTSP session after the media server receives the data packet receiving stopping instruction sent by the RTSP client-side. Therefore, the data packets in the buffer queue are sent according to the time segments in the RTSP signaling interaction process without adopting circular sending, and the phenomenon that the instantaneous code rate is too high when the RTSP client receives data can be avoided.
In summary, according to the protocol conversion method in the media stream forwarding process of the embodiment of the present invention, a data request initiated by an RTSP client is received, a session map is established, one end of the session map corresponds to an RTSP session, and the other end corresponds to an SIP session, then, a key content in the data request is extracted, an SIP session is initiated to an SIP server according to the key content, so that the SIP server sends a media stream according to the SIP session, the key content includes an identifier of the SIP server, the media stream sent by the SIP server is received, the media stream is analyzed, a frame splicing and unpacking are performed on the media stream and then stored in a buffer queue, wherein the analyzed content includes a media format of the media stream, finally, the RTSP session is initiated to the RTSP client according to the session map, and a data packet in the buffer queue is sent to the RTSP client according to the RTSP session, so as to convert the GB28181 protocol into the RTSP protocol. Therefore, the method can convert the GB28181 protocol into the RTSP protocol and can support different media formats, so that the resource access of the RTSP client to any media coding format of the GB28181 protocol is effectively realized, the continuous development and evolution of the media coding format are facilitated, and the universality and the adaptive capacity of media interaction are greatly improved.
Corresponding to the protocol conversion method in the media stream forwarding process, the invention also provides a protocol conversion device in the media stream forwarding process. Since the device embodiment of the present invention corresponds to the method embodiment described above, the details of the device embodiment for disclosure may refer to the method embodiment described above, and are not repeated in the present invention.
Fig. 5 is a block diagram of a protocol conversion device in a media stream forwarding process according to an embodiment of the present invention, as shown in fig. 5, the device includes: the system comprises a receiving module 1, an SIP session initiating module 2, an analyzing module 3 and an RTSP session initiating module 4.
The receiving module 1 is used for receiving a data request initiated by an RTSP client and establishing session mapping, wherein one end of the session mapping corresponds to an RTSP session, and the other end of the session mapping corresponds to an SIP session; the SIP session initiating module 2 is used for extracting key content in the data request and initiating an SIP session to the SIP server according to the key content so that the SIP server sends a media stream according to the SIP session, and the key content comprises an identifier of the SIP server; the analysis module 3 is used for receiving the media stream sent by the SIP server, analyzing, framing, unpacking and storing the media stream into a cache queue, wherein the analysis content comprises the media format of the media stream; the RTSP session initiating module 4 is configured to initiate an RTSP session to the RTSP client according to the session mapping, and send the data packet in the buffer queue to the RTSP client according to the RTSP session, so as to convert the GB28181 protocol into an RTSP protocol.
According to an embodiment of the present invention, the RTSP session initiating module 4 is further configured to: setting the time interval of a timer according to the frame interval time of the data packets in the buffer queue, wherein the time interval of the timer is less than the frame interval time; judging whether the time stamp of the data packet in the buffer queue meets the current time interval range of the timer or not; if the timestamp of the data packet in the cache queue meets the current time interval range of the timer, sending the data packet meeting the current time interval range of the timer; if the time stamp of the data packet in the buffer queue does not satisfy the current time interval range of the timer, the data packet transmission of the current period is terminated; after the time interval of the next timer is reached, returning to the step of judging whether the time stamp of the data packet in the cache queue meets the current time interval range of the timer or not; and when receiving a data packet receiving stopping instruction sent by the RTSP client, emptying the buffer queue and closing the RTSP session.
In accordance with one embodiment of the present invention,the RTSP session initiation module 4 sets the time interval of the timer according to the following formula:
Figure 811143DEST_PATH_IMAGE003
where, Δ t is the time interval of the timer, t is the frame interval time of the data packet, and n is a positive integer.
The protocol conversion device in the media stream forwarding process according to the embodiment of the invention receives the data request initiated by the RTSP client through the receiving module, and establishing session mapping, one end of the session mapping corresponding to RTSP session and the other end corresponding to SIP session, SIP session initiating module extracting key content in data request, initiating SIP conversation to the SIP server according to the key content so that the SIP server sends media stream according to the SIP conversation, the key content comprises the identification of the SIP server, the parsing module receives the media stream sent by the SIP server, parses, frames, unpacks and stores the media stream into a cache queue, wherein, the analysis content comprises the media format of the media stream, the RTSP conversation initiating module initiates an RTSP conversation to the RTSP client according to the conversation mapping, and sending the data packet in the buffer queue to the RTSP client according to the RTSP session so as to convert the GB28181 protocol into the RTSP protocol. Therefore, the device can convert the GB28181 protocol into the RTSP protocol and can support different media formats, so that resource access of the RTSP client to any media coding format of the GB28181 protocol is effectively realized, continuous development and evolution of the media coding format are facilitated, and the universality and the adaptive capacity of media interaction are greatly improved.
Furthermore, the present invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the protocol conversion method in the media stream forwarding process described above.
According to a non-transitory computer-readable storage medium of an embodiment of the present invention, a computer program stored thereon, when executed by a processor, receives an RTSP client-initiated data request, and establishes a session map, one end of the session map corresponds to the RTSP session, the other end corresponds to the SIP session, then, extracting the key content in the data request, initiating SIP conversation to the SIP server according to the key content, so that the SIP server sends the media stream according to the SIP session, the key content comprises the identification of the SIP server, then receives the media stream sent by the SIP server, analyzes, splices, unpacks and stores the media stream into a buffer queue, wherein, the parsing content comprises the media format of the media stream, and finally, the RTSP conversation is initiated to the RTSP client according to the conversation mapping, and sending the data packet in the buffer queue to the RTSP client according to the RTSP session so as to convert the GB28181 protocol into the RTSP protocol. Therefore, the GB28181 protocol can be converted into the RTSP protocol, different media formats can be supported, resource access of the RTSP client to any media coding format of the GB28181 protocol is effectively realized, continuous development and evolution of the media coding format are facilitated, and the universality and the adaptation capability of media interaction are greatly improved.
The invention also provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein when the processor executes the program, the protocol conversion method in the media stream forwarding process is realized.
According to the computer equipment of the embodiment of the invention, when a processor executes a computer program stored on a memory, a data request initiated by an RTSP client is received, a session mapping is established, one end of the session mapping corresponds to an RTSP session, the other end of the session mapping corresponds to an SIP session, then key contents in the data request are extracted, the SIP session is initiated to an SIP server according to the key contents, so that the SIP server sends a media stream according to the SIP session, the key contents comprise an identification of the SIP server, the media stream sent by the SIP server is received, the media stream is analyzed, a spliced frame is unpacked and then stored in a cache queue, wherein the analyzed contents comprise a media format of the media stream, finally, the RTSP session is initiated to the RTSP client according to the session mapping, and a data packet in the cache queue is sent to the client according to the RTSP session, so that a GB28181 protocol is converted into the RTSP protocol. Therefore, the GB28181 protocol can be converted into the RTSP protocol, different media formats can be supported, resource access of the RTSP client to any media coding format of the GB28181 protocol is effectively realized, continuous development and evolution of the media coding format are facilitated, and the universality and the adaptation capability of media interaction are greatly improved.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (8)

1. A protocol conversion method in the media stream forwarding process is characterized by comprising the following steps:
receiving a data request initiated by an RTSP client, and establishing a session mapping, wherein one end of the session mapping corresponds to an RTSP session, and the other end of the session mapping corresponds to an SIP session;
extracting key content in the data request, and initiating an SIP session to an SIP server according to the key content so that the SIP server sends a media stream according to the SIP session, wherein the key content comprises an identifier of the SIP server;
receiving the media stream sent by the SIP server, analyzing, splicing and unpacking the media stream, and storing the media stream into a cache queue, wherein the analyzed content comprises a media format of the media stream;
and initiating an RTSP session to the RTSP client according to the session mapping, and sending the data packet in the buffer queue to the RTSP client according to the RTSP session so as to convert the GB28181 protocol into an RTSP protocol.
2. The method for protocol conversion during media stream forwarding according to claim 1, wherein sending the data packet in the buffer queue to the RTSP client according to RTSP session comprises:
setting a time interval of a timer according to a frame interval time of a data packet in the buffer queue, wherein the time interval of the timer is less than the frame interval time;
judging whether the time stamp of the data packet in the cache queue meets the current time interval range of a timer or not;
if the timestamp of the data packet in the cache queue meets the current time interval range of the timer, sending the data packet meeting the current time interval range of the timer;
if the timestamp of the data packet in the cache queue does not meet the current time interval range of the timer, stopping the data packet transmission in the current period;
after the next time interval of the timer is reached, returning to the step of judging whether the time stamp of the data packet in the cache queue meets the current time interval range of the timer;
and when receiving a data packet receiving stopping instruction sent by the RTSP client, emptying the buffer queue and closing the RTSP session.
3. The method of claim 2, wherein the time interval of the timer is set according to the following formula:
Figure 308207DEST_PATH_IMAGE001
wherein, Δ t is the time interval of the timer, t is the frame interval time of the data packet, and n is a positive integer.
4. A protocol conversion device in a media stream forwarding process, comprising:
the receiving module is used for receiving a data request initiated by an RTSP client and establishing a session mapping, wherein one end of the session mapping corresponds to an RTSP session, and the other end of the session mapping corresponds to an SIP session;
the SIP session initiating module is used for extracting key content in the data request and initiating an SIP session to an SIP server according to the key content so that the SIP server sends a media stream according to the SIP session, and the key content comprises an identifier of the SIP server;
the analysis module is used for receiving the media stream sent by the SIP server, analyzing, splicing, unpacking and storing the media stream into a cache queue, wherein the analysis content comprises the media format of the media stream;
the RTSP conversation initiating module is used for initiating an RTSP conversation to the RTSP client according to the conversation mapping and sending the data packet in the cache queue to the RTSP client according to the RTSP conversation so as to convert the GB28181 protocol into an RTSP protocol.
5. The device for protocol conversion in media stream forwarding process according to claim 4, wherein the RTSP session initiation module is further configured to:
setting a time interval of a timer according to a frame interval time of a data packet in the buffer queue, wherein the time interval of the timer is less than the frame interval time;
judging whether the time stamp of the data packet in the cache queue meets the current time interval range of a timer or not;
if the timestamp of the data packet in the cache queue meets the current time interval range of the timer, sending the data packet meeting the current time interval range of the timer;
if the timestamp of the data packet in the cache queue does not meet the current time interval range of the timer, stopping the data packet transmission in the current period;
after the time interval of the next timer is reached, returning to the step of judging whether the time stamp of the data packet in the cache queue meets the current time interval range of the timer or not;
and when receiving a data packet receiving stopping instruction sent by the RTSP client, emptying the buffer queue and closing the RTSP session.
6. The device of claim 5, wherein the RTSP session initiation module sets the time interval of the timer according to the following formula:
Figure 153714DEST_PATH_IMAGE002
wherein, Δ t is the time interval of the timer, t is the frame interval time of the data packet, and n is a positive integer.
7. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements a protocol conversion method in a media stream forwarding process according to claims 1-3.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the protocol conversion method in the media stream forwarding process according to claims 1-3 when executing the program.
CN202110883565.9A 2021-08-03 2021-08-03 Protocol conversion method and device in media stream forwarding process Active CN113329040B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110883565.9A CN113329040B (en) 2021-08-03 2021-08-03 Protocol conversion method and device in media stream forwarding process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110883565.9A CN113329040B (en) 2021-08-03 2021-08-03 Protocol conversion method and device in media stream forwarding process

Publications (2)

Publication Number Publication Date
CN113329040A true CN113329040A (en) 2021-08-31
CN113329040B CN113329040B (en) 2021-11-02

Family

ID=77426860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110883565.9A Active CN113329040B (en) 2021-08-03 2021-08-03 Protocol conversion method and device in media stream forwarding process

Country Status (1)

Country Link
CN (1) CN113329040B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114466167A (en) * 2022-02-14 2022-05-10 南京甄视智能科技有限公司 Mechanism for realizing quick real-time stream response under GB28181 communication protocol

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1619853A1 (en) * 2004-07-21 2006-01-25 Siemens Mobile Communications S.p.A. RTSP proxy extended to detect streaming session events and report to valued streaming applications the notified ones
US20080151918A1 (en) * 2006-12-22 2008-06-26 Telefonaktiebolaget Lm Ericsson (Publ) Method of correlating a media session to a signaling session
CN101222418A (en) * 2007-01-10 2008-07-16 华为技术有限公司 Method, system and signaling gateway for RTSP client terminal access to SIP media resource
CN101378535A (en) * 2007-08-27 2009-03-04 华为技术有限公司 Method, system and apparatus for controlling message by transmission medium flow
WO2009117919A1 (en) * 2008-03-28 2009-10-01 华为技术有限公司 Establishing method, system and equipment of content on demand cod service
CN101953136A (en) * 2007-12-21 2011-01-19 皇家Kpn公司 Method and system for transmitting a multimedia stream
CN102088447A (en) * 2009-12-08 2011-06-08 中国移动通信集团公司 Media control method and system in IMS (IP multimedia subsystem)
CN103428168A (en) * 2012-05-17 2013-12-04 北京信悦通科技有限公司 Method, system and signaling gateway for SIP client side to visit RTSP media resource
CN104735400A (en) * 2013-12-24 2015-06-24 浙江省公众信息产业有限公司 Method and gateway equipment for SIP client side in video monitoring system to have access to RTSP media equipment
CN104994067A (en) * 2015-05-25 2015-10-21 南京邮电大学 System and method for SIP network to access RTSP monitoring network
CN109327435A (en) * 2018-09-20 2019-02-12 安徽云森物联网科技有限公司 Media resource acquisition methods, device and gateway
WO2019224574A1 (en) * 2018-05-21 2019-11-28 Telefonaktiebolaget Lm Ericsson (Publ) Ims-based streaming framework
CN110943909A (en) * 2019-12-02 2020-03-31 江西雕视信息技术股份有限公司 Audio and video fusion communication server
CN111447463A (en) * 2020-04-02 2020-07-24 上海依图网络科技有限公司 Method, apparatus, medium and system for video stream format conversion and play control
CN111787026A (en) * 2020-07-27 2020-10-16 北京飞讯数码科技有限公司 Method, device and equipment for transmitting media data and storage medium
CN112866199A (en) * 2020-12-31 2021-05-28 北京优锘科技有限公司 Method for viewing device supporting GB/T28181 protocol in main stream browser

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1619853A1 (en) * 2004-07-21 2006-01-25 Siemens Mobile Communications S.p.A. RTSP proxy extended to detect streaming session events and report to valued streaming applications the notified ones
US20080151918A1 (en) * 2006-12-22 2008-06-26 Telefonaktiebolaget Lm Ericsson (Publ) Method of correlating a media session to a signaling session
CN101222418A (en) * 2007-01-10 2008-07-16 华为技术有限公司 Method, system and signaling gateway for RTSP client terminal access to SIP media resource
CN101378535A (en) * 2007-08-27 2009-03-04 华为技术有限公司 Method, system and apparatus for controlling message by transmission medium flow
CN101953136A (en) * 2007-12-21 2011-01-19 皇家Kpn公司 Method and system for transmitting a multimedia stream
WO2009117919A1 (en) * 2008-03-28 2009-10-01 华为技术有限公司 Establishing method, system and equipment of content on demand cod service
CN102088447A (en) * 2009-12-08 2011-06-08 中国移动通信集团公司 Media control method and system in IMS (IP multimedia subsystem)
CN103428168A (en) * 2012-05-17 2013-12-04 北京信悦通科技有限公司 Method, system and signaling gateway for SIP client side to visit RTSP media resource
CN104735400A (en) * 2013-12-24 2015-06-24 浙江省公众信息产业有限公司 Method and gateway equipment for SIP client side in video monitoring system to have access to RTSP media equipment
CN104994067A (en) * 2015-05-25 2015-10-21 南京邮电大学 System and method for SIP network to access RTSP monitoring network
WO2019224574A1 (en) * 2018-05-21 2019-11-28 Telefonaktiebolaget Lm Ericsson (Publ) Ims-based streaming framework
CN109327435A (en) * 2018-09-20 2019-02-12 安徽云森物联网科技有限公司 Media resource acquisition methods, device and gateway
CN110943909A (en) * 2019-12-02 2020-03-31 江西雕视信息技术股份有限公司 Audio and video fusion communication server
CN111447463A (en) * 2020-04-02 2020-07-24 上海依图网络科技有限公司 Method, apparatus, medium and system for video stream format conversion and play control
CN111787026A (en) * 2020-07-27 2020-10-16 北京飞讯数码科技有限公司 Method, device and equipment for transmitting media data and storage medium
CN112866199A (en) * 2020-12-31 2021-05-28 北京优锘科技有限公司 Method for viewing device supporting GB/T28181 protocol in main stream browser

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RESEARCH IN MOTION UK LIMITED: "S4-100435 "CR 26.237-0040 Introduction of Pause and Resume procedures for PSS session (Release 10)"", 《3GPP》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114466167A (en) * 2022-02-14 2022-05-10 南京甄视智能科技有限公司 Mechanism for realizing quick real-time stream response under GB28181 communication protocol

Also Published As

Publication number Publication date
CN113329040B (en) 2021-11-02

Similar Documents

Publication Publication Date Title
US9374263B2 (en) Latency differential mitigation for real time data streams
US10027496B2 (en) Method for distributing identifiers of multicast sources
AU2012207704B2 (en) Apparatus and method for transmitting multimedia data in a broadcast system
US10477282B2 (en) Method and system for monitoring video with single path of video and multiple paths of audio
EP3515083A1 (en) Method and apparatus for performing synchronization operation on contents
CN113766317A (en) Video transmission method, video transmission device, electronic equipment and storage medium
CN114221909B (en) Data transmission method, device, terminal and storage medium
US20150071307A1 (en) Communication interface and method for robust header compression of data flows
CN101179480B (en) Method for forwarding stream media
GB2417639A (en) Assigning participant identifying data to network transmission events.
CN113329040B (en) Protocol conversion method and device in media stream forwarding process
US20240121288A1 (en) Supporting quality of service for media communications
CN103618747A (en) Method and system for realizing session initiation protocol (SIP) information service
CN101094159B (en) Method for penetrating through private network of media stream
EP2589195B1 (en) Method and apparatus for transmitting an application identifier across application elements
EP2034664A1 (en) Method and device of congrolling media resource, method and system of establishing calling
CN104363149A (en) SIP (session initiation protocol)-based system and method for achieving VOIP (voice over Internet protocol) network state monitoring
CN111585962A (en) RTP data packet processing method, system and storage medium
CN113992637B (en) Audio and video data receiving method, device, equipment, system and storage medium
CN101179502A (en) Method and system for forwarding stream media
GB2525441A (en) Data Processing
CN116032628B (en) Data sharing method, system, equipment and readable storage medium
KR101528268B1 (en) System and method for streaming content to remote locations
CN113746755A (en) Data processing method, device, equipment and computer readable storage medium
CN115665444A (en) Media stream single-port multiplexing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant