RTSP video transmission method and system in one-way gateway environment
By using the RTSP video transmission method of redundant encoding and policy management modules in a one-way gateway environment, the stability and reliability of video transmission in a one-way gateway environment are solved, and the video transmission effect with high security and low latency is achieved.
Patent Information
- Application Number
- CN202411811688.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-10
AI Technical Summary
In a one-way gateway environment, it is difficult for existing RTSP video transmission systems to achieve stable and smooth video transmission, especially in the absence of a reverse link, how to ensure the reliable transmission and playback of video data has become a challenge.
The camera service is adopted that includes client module, data redundant encoding module, policy management module and video stream packaging and sending module. The error correction information is added through redundant encoding to ensure the integrity of the video stream, and the link relationship is managed through the policy management module. The video stream packaging and sending module is encapsulated according to the one-way gateway packet format.
Reliable transmission and playback of video data is realized in a one-way gateway environment, avoiding data dependence in the two-way interaction process, ensuring the stability and low latency of video transmission, and having high security and high fault tolerance.
Smart Images

Figure CN119814973A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to network video transmission technology, and in particular relates to an RTSP video transmission method and system in a unidirectional gateway environment. Background Art
[0002] In some high-security network environments or restricted networks, bidirectional data transmission may pose a security risk, or the system architecture determines that only one-way data flow can be supported. For example, in application scenarios such as government agencies, military communications, and monitoring centers, data is often required to be transmitted in one direction only to ensure that the receiving end does not leak sensitive information or suffer network attacks. In this one-way gateway environment, data is usually only allowed to flow from the source end (sender) to the target end (receiver), and no feedback information is allowed to be returned in any form. Most existing streaming media transmission systems rely on two-way communication for data confirmation and error correction. The RTSP protocol usually requires two-way transmission for the exchange of control commands and reliable transmission of streaming media data. How to achieve stable and smooth RTSP video transmission under the conditions of a one-way gateway has become a technical challenge. Summary of the invention
[0003] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a method and system for RTSP video transmission in a unidirectional gateway environment are provided. The present invention actually realizes RTSP video transmission in a unidirectional gateway environment, ensures reliable transmission and playback of video data in the absence of a reverse link in the unidirectional gateway environment, and avoids data dependence in the two-way interaction process, thereby ensuring the stability and low latency of video transmission under strictly restricted network conditions.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: A RTSP video transmission method in a unidirectional gateway environment includes sending RTSP video in a unidirectional gateway environment through a camera end service including a client module, a data redundancy encoding module, a policy management module and a video stream packaging and sending module: The RTSP client is constructed through the client module, actively initiates a request to the camera as the RTSP server, and starts the transmission of the data stream through instructions, so as to obtain the real-time compressed and encoded audio and video stream; the camera acts as an RTSP server to provide the compressed and encoded video stream; The data redundancy coding module is used to redundancy encode the video stream data and add error correction information, so that the receiving end service can automatically repair the lost data packets through the redundant information to ensure the integrity of the video stream even when feedback is not possible; The link relationship between the camera and the receiving end service is managed through the policy management module, and the redundantly encoded audio and video streams are attached with the associated receiving end service information so that a single camera end service can be connected to one or more receiving end services; The video stream packaging and sending module packages the video data after receiving the associated receiving end service information, encapsulates it according to the data packet transmission format constrained by the unidirectional gateway, performs specified encoding processing on the header information, check information and fragmentation sequence of the data packet, and transmits the final generated data packet to the unidirectional gateway to send it to the receiving end service.
[0005] Optionally, the video data after the associated receiving end service information is packaged by the video stream packaging and sending module, encapsulated according to the data packet transmission format constrained by the unidirectional gateway, the header information, check information and fragmentation sequence of the data packet are encoded as specified, and the finally generated data packet is transmitted to the unidirectional gateway to be sent to the receiving end service, including: the video data stream data after the associated receiving end service information is fragmented into fixed size, the data that does not reach the fixed length is filled with 0, each piece of data is added with a fragmentation sequence number and a total number of fragments to ensure that the original data can be reassembled at the receiving end, and by using frame-level encapsulation, fragmentation and serialization are performed in each frame to ensure that even if part of the fragment is lost, part of the picture can be restored at the frame level, thereby reducing the impact on the fluency; and the fragmented data packet is added with a timestamp, frame number, stream ID, and packet ID. The timestamp information helps the receiving end to play according to the original time sequence, preventing the fluency from being affected by disorder or network delay, so that the order and integrity can be confirmed at the receiving end; CRC32 is used to check the integrity of the data packet data and generate a check code so that the receiving end service can detect and remove damaged data packets without feedback, thereby ensuring the integrity of the received data; for the generated data packet, the format of the data packet is adjusted to adapt to one-way transmission according to the protocol standard of the one-way gateway to avoid feedback path dependence, and the data packet adapted for one-way transmission is sent to the receiving end service.
[0006] Optionally, it also includes real-time detection of the real-time available bandwidth upper limit of the link between the camera-side service and the receiving-side service and providing a query API interface for the camera-side service to call; when the data packet adapted for one-way transmission is sent to the receiving-side service, it includes first optimizing the data packet adapted for one-way transmission based on the optimal transmission strategy, and then sending the optimized data packet to the receiving-side service; the optimizing the data packet adapted for one-way transmission based on the optimal transmission strategy includes: the camera-side service query API The upper limit of the real-time available bandwidth of the link between the interface camera end service and the receiving end service, if the upper limit of the real-time available bandwidth of the link is less than the preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission mode, and the optimized transmission mode is one of the following optimized transmission modes: Mode 1, prioritizes the transmission of key video frames and appropriately discards or downgrades the transmission of non-key video frames, and the use of frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusts the bit rate of the video data stream data after the associated receiving end service information is received, so that the size of the bit rate is positively correlated with the upper limit of the real-time available bandwidth of the link; Mode 3, adaptively adjusts the frame rate or resolution of the video data stream data after the associated receiving end service information is received, so that the size of the frame rate or resolution is positively correlated with the upper limit of the real-time available bandwidth of the link.
[0007] Optionally, it also includes real-time detection of the link delay between the camera-side service and the receiving-side service and providing a query API interface for the camera-side service to call; when the data packet adapted for one-way transmission is sent to the receiving-side service, it includes first optimizing the data packet adapted for one-way transmission based on the optimal transmission strategy, and then sending the optimized data packet to the receiving-side service; the optimizing the data packet adapted for one-way transmission based on the optimal transmission strategy includes: the camera-side service query API The link delay between the interface camera end service and the receiving end service, if the link delay is greater than the preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission mode, and the optimized transmission mode is one of the following optimized transmission modes: Mode 1, prioritizes the transmission of key video frames and appropriately discards or downgrades the transmission of non-key video frames, and the use of frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusts the bit rate of the video data stream data after the associated receiving end service information is received, so that the bit rate is negatively correlated with the link delay of the unidirectional gateway; Mode 3, adaptively adjusts the frame rate or resolution of the video data stream data after the associated receiving end service information is received, so that the frame rate or resolution is negatively correlated with the link delay of the unidirectional gateway.
[0008] Optionally, it also includes real-time detection of link jitter between the camera service and the receiving service and provides a query API The interface is provided for the camera end service to call, the link jitter refers to the time difference between multiple transmissions; when the data packet adapted for unidirectional transmission is sent to the receiving end service, it includes first optimizing the data packet adapted for unidirectional transmission based on the optimal transmission strategy, and then sending the optimized data packet to the receiving end service; the optimizing the data packet adapted for unidirectional transmission based on the optimal transmission strategy includes: obtaining the link jitter of the unidirectional gateway, if the link jitter of the unidirectional gateway is greater than the preset value, querying the preset optimal transmission strategy to determine the current optimized transmission mode, the optimized transmission mode is one of the following optimized transmission modes: mode 1, giving priority to transmitting key video frames and appropriately discarding or downgrading the transmission of non-key video frames, when using frame-level encapsulation, it includes setting key video frames and non-key video frames for video frames; mode 2, adaptively adjusting the bit rate of the video data stream data after the associated receiving end service information is received, so that the size of the bit rate is negatively correlated with the link jitter of the unidirectional gateway; mode 3, adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving end service information is received, so that the size of the frame rate or resolution is negatively correlated with the link jitter of the unidirectional gateway.
[0009] Optionally, it also includes receiving RTSP video in a one-way gateway environment through a receiving end service including a video receiving and decoding module, a packet loss repair module, and a video reconstruction and playback module: The video receiving and decoding module monitors the data stream from the unidirectional gateway in real time and continuously. After receiving the data, it verifies the integrity of the data, decapsulates it according to the industrial standard of the unidirectional gateway protocol, and reassembles the data according to the fragment sequence information. The packet loss repair module uses redundantly coded error correction information to repair and reconstruct data to fill transmission gaps caused by network instability, ensure that packet loss caused by network fluctuations during one-way transmission can be effectively repaired, and ensure the integrity of the video and the stability of video playback; The reconstructed video stream is processed through the video reconstruction and playback module, the decoded audio and video data is synchronously processed and formatted, and the stream is directed to the specified output path according to the preset configuration.
[0010] Optionally, the method of repairing and reconstructing data using redundantly coded error correction information through a packet loss repair module includes: performing packet loss rate detection on the data using redundantly coded error correction information through a packet loss repair module; if the packet loss rate is less than a preset threshold, directly using the redundantly coded error correction information to repair the lost data packets; otherwise, for key video frames and non-key video frames in the data packets, preferentially using the redundantly coded error correction information to repair the data packets corresponding to the key video frames; processing the reconstructed video stream through a video reconstruction and playback module, synchronously processing and formatting the decoded audio and video data, and streaming to a specified output path according to a preset configuration. , and also includes post-processing the video data in the decoded audio and video data with at least one of image enhancement and noise reduction, wherein the image enhancement includes adjusting the color and saturation of the video image, and the noise reduction includes identifying the dynamic area and the static area of the video image frame according to adjacent video image frames, wherein the dynamic area refers to the area that changes in the adjacent video image frames, and the static area refers to the area that remains unchanged in the adjacent video image frames, and different noise reduction filter parameters are used for the dynamic area and the static area to perform noise reduction, so that the noise reduction strength in the dynamic area is smaller and the noise reduction strength in the static area is larger, so as to enhance the stability of the video image frame and ensure the quality and clarity of the video stream.
[0011] In addition, the present invention also provides an RTSP video transmission system under a unidirectional gateway environment, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the RTSP video transmission method under the unidirectional gateway environment.
[0012] In addition, the present invention also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment through a processor.
[0013] In addition, the present invention also provides a computer program product, including a computer program or an instruction, wherein the computer program or the instruction is programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment through a processor.
[0014] Compared with the prior art, the present invention mainly has the following advantages: 1. The method of the present invention prevents various reverse attacks and information leakage of internal and external networks through a physical unidirectional gateway and an encrypted transmission method on a link, and has high security.
[0015] 2. The method of the present invention uses forward error correction technology, and the receiving end can automatically repair packet loss under network oscillation in the scenario of a unidirectional gateway link, thereby ensuring the integrity of data and video and having high fault tolerance.
[0016] 3. The method of the present invention improves the efficiency of audio and video data transmission and reduces transmission delay through efficient video compression technology and detection and control of data flow in the link.
[0017] 4. The system of the present invention is suitable for various monitoring scenarios that require high security, such as military, government facilities, nuclear power plants, airport monitoring and other environments, and has wide adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The figure is a schematic diagram of the deployment topology of the method according to the embodiment of the present invention.
[0019] Figure 2 The figure is a schematic diagram of the working principle of the method according to the embodiment of the present invention.
[0020] Figure 3 Schematic diagram of camera-side service processing in an embodiment of the present invention.
[0021] Figure 4 The figure is a schematic diagram of the receiving end service processing in the embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be Figure 1 In a monitoring scenario shown, the camera is deployed in a high-security area, and the camera data is transmitted from the external network to the internal network through a one-way gateway for playback. The RTSP video transmission system under the one-way gateway environment of the present invention is further described in detail. The basis of this implementation example is a physical machine running the Linux system.
[0023] like Figure 2 and Figure 3 As shown, this embodiment provides an RTSP video transmission method in a unidirectional gateway environment, including sending RTSP video in a unidirectional gateway environment through a camera end service including a client module, a data redundancy encoding module, a policy management module and a video stream packaging and sending module: The RTSP client is constructed through the client module, actively initiates a request to the camera as the RTSP server, and starts the transmission of the data stream through instructions, so as to obtain the real-time compressed and encoded audio and video stream; the camera acts as an RTSP server to provide the compressed and encoded video stream; The video stream data is redundantly encoded and error correction information is added through the data redundancy encoding module (in this embodiment, the forward error correction FFC encoding is specifically used to add error correction information, that is, redundant information, and other redundant encoding methods can also be used as needed), so that the receiving end service can automatically repair the lost data packets through the redundant information to ensure the integrity of the video stream even if feedback cannot be provided; The link relationship between the camera and the receiving end service is managed through the policy management module, and the redundantly encoded audio and video streams are attached with the associated receiving end service information so that a single camera end service can be connected to one or more receiving end services; The video stream packaging and sending module packages the video data after receiving the associated receiving end service information, encapsulates it according to the data packet transmission format constrained by the unidirectional gateway, performs specified encoding processing on the header information, check information and fragmentation sequence of the data packet, and transmits the final generated data packet to the unidirectional gateway to send it to the receiving end service.
[0024] like Figure 2 As shown, in this embodiment 1) a camera-side service is pre-deployed on the front-end sending device host A of the external network, and a receiving-side service is deployed on the back-end receiving device host B of the internal network, wherein the camera-side service is used to receive data sent from the external network camera application, and transmit it to the unidirectional gateway after processing; the receiving-side service is used to receive data from the unidirectional gateway, and transmit it to the video player or the back-end storage service after processing; on the front-end sending device host A and the back-end receiving device host B, a sending and receiving directory of the camera and the video player is created through the directory creation API interface provided by the policy management module, and an intercommunication relationship between the camera and the video player is created through the policy creation API interface; wherein the camera-side service includes a client module, a data redundancy encoding module, a policy management module, and a video stream packaging and sending module, etc., and the receiving-side service includes a video receiving and decoding module, a packet loss repair module, and a video reconstruction and playback module, etc.
[0025] In this embodiment, after the client module of the camera service monitors the existence of the camera list and the response of the intercommunication relationship creation action, it confirms the RTSP server IP and port of the camera through the camera list, creates an RTSP client, and initiates a request to the RTSP server of the camera. After obtaining the streaming media resource description of the camera, it uses instructions to start the transmission of the data stream. The corresponding data of the RTSP server (camera) contains the description and transmission information of the real-time data stream data, and obtains the real-time compressed and encoded audio and video stream from the data stream, and sends the obtained audio and video stream data to the data redundancy encoding module.
[0026] In this embodiment, after receiving the audio and video data transmitted by the previous module, the data redundancy coding module performs forward error correction processing on it and generates redundant information to correspond to the packet loss situation, so that even if the receiving end service cannot provide feedback, it can automatically repair the lost data packets through redundant information to ensure the integrity of the video stream. This module uses the standard Reed-Solomon algorithm to balance bandwidth consumption and redundancy and adapt to network fluctuations in unidirectional transmission. The final module sends the data after completing the redundant coding to the video stream packaging and sending module; In this embodiment, the video data after the associated receiving end service information is packaged by the video stream packaging and sending module, encapsulated according to the data packet transmission format constrained by the unidirectional gateway, the header information, check information and fragment sequence of the data packet are encoded as specified, and the finally generated data packet is transmitted to the unidirectional gateway to be sent to the receiving end service, including: the video data stream data after the associated receiving end service information is fragmented with a fixed size, the data that does not reach the fixed length is filled with 0, each piece of data is added with a fragment sequence number and a total number of fragments to ensure that the original data can be reassembled at the receiving end, and by using frame-level encapsulation, fragmentation and serialization are performed in each frame to ensure that even if some fragments are lost, they can still be reassembled. Restore some images at the frame level to reduce the impact on smoothness; add header information including timestamp, frame number, stream ID, and packet ID to the fragmented data packets, and use the timestamp information to help the receiving end play according to the original time sequence to prevent the smoothness from being affected by disorder or network delay, so that the order and integrity can be confirmed at the receiving end; use CRC32 to check the integrity of the data packet data and generate a checksum so that the receiving end service can detect and remove damaged data packets without feedback to ensure the integrity of the received data; for the generated data packets, adjust the format of the data packets to adapt to unidirectional transmission according to the protocol standard of the unidirectional gateway to avoid feedback path dependence, and send the data packets adapted to unidirectional transmission to the receiving end service. Through the above-mentioned specific encoding processing, it is ensured that the integrity and reconfigurability of the data can be guaranteed even if there is no feedback link in the network.
[0027] In this embodiment, when sending the data packet adapted for unidirectional transmission to the receiving end service, it includes first optimizing the data packet adapted for unidirectional transmission based on the optimal transmission strategy, and then sending the optimized data packet to the receiving end service; the video stream packaging and sending module queries the policy rules designed in the audio and video data transmission process by calling the policy query API interface, including the gateway path information, maximum allowable delay and jitter threshold information from the camera data to the intranet player. The real-time available bandwidth upper limit of the link is confirmed by calculating and processing the historical bandwidth data and real-time network information of the path specified in the policy rules. Based on the value of the real-time available bandwidth upper limit of the link, when the available bandwidth of the link is very low, key video frames (such as I frames) are preferentially transmitted, and non-key frames (such as P frames and B frames) are appropriately discarded or downgraded for transmission, or the video encoding bit rate is adaptively adjusted, the frame rate or resolution is reduced to adapt to the current bandwidth status, and dynamic adjustments are made based on real-time traffic feedback to ensure the continuity of the basic video stream. At the same time, the system will detect the delay of the real-time link, set the maximum allowable delay and jitter threshold, and promptly detect the link delay that affects the smoothness and real-time performance of the video stream. For links with high delay or frequent jitter, key frames are transmitted first, and other frames are downgraded or skipped to ensure the decodability and clarity of the video content. Based on strategies and information such as bandwidth, delay, and traffic delay, the video data transmission is guaranteed to meet the optimal transmission strategy of the current link, and the processed data is finally transmitted to the unidirectional gateway.
[0028] As an optional implementation, the present embodiment also includes real-time detection of the upper limit of the real-time available bandwidth of the link between the camera-side service and the receiving-end service and providing a query API interface for the camera-side service to call; the optimization processing of the data packet after the adaptation of the unidirectional transmission based on the optimal transmission strategy includes: the camera-side service queries the API interface camera-side service and the upper limit of the real-time available bandwidth of the link between the receiving-end service, if the upper limit of the real-time available bandwidth of the link is less than the preset value, then the preset optimal transmission strategy is queried to determine the current optimized transmission mode, and the optimized transmission mode is one of the following optimized transmission modes: Mode 1, priority transmission of key video frames and appropriate discarding or downgrading transmission of non-key video frames, the use of frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusting the bit rate of the video data stream data after the associated receiving-end service information is received, so that the size of the bit rate is positively correlated with the upper limit of the real-time available bandwidth of the link; Mode 3, adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving-end service information is received, so that the size of the frame rate or resolution is positively correlated with the upper limit of the real-time available bandwidth of the link.
[0029] As an optional implementation, the present embodiment also includes real-time detection of the link delay between the camera-side service and the receiving-end service and providing a query API interface for the camera-side service to call; the optimization processing of the data packet after the adaptation of the unidirectional transmission based on the optimal transmission strategy includes: the camera-side service queries the link delay between the camera-side service and the receiving-end service through the API interface; if the link delay is greater than a preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission mode, and the optimized transmission mode is one of the following optimized transmission modes: Mode 1, priority transmission of key video frames and appropriate discarding or downgrading transmission of non-key video frames, and the use of frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusting the bit rate of the video data stream data after the associated receiving-end service information is received, so that the size of the bit rate is negatively correlated with the link delay of the unidirectional gateway; Mode 3, adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving-end service information is received, so that the size of the frame rate or resolution is negatively correlated with the link delay of the unidirectional gateway.
[0030] As an optional implementation, the present embodiment also includes real-time detection of link jitter between the camera-side service and the receiving-end service and providing a query API interface for the camera-side service to call, wherein the link jitter refers to the time difference between multiple transmissions; the optimization processing of the data packet adapted for unidirectional transmission based on the optimal transmission strategy includes: obtaining the link jitter of the unidirectional gateway, if the link jitter of the unidirectional gateway is greater than a preset value, querying the preset optimal transmission strategy to determine the current optimized transmission mode, wherein the optimized transmission mode is one of the following optimized transmission modes: Mode 1, prioritizing transmission of key video frames and appropriately discarding or downgrading transmission of non-key video frames, wherein the use of frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusting the bit rate of the video data stream data after the associated receiving-end service information is received, so that the size of the bit rate is negatively correlated with the link jitter of the unidirectional gateway; Mode 3, adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving-end service information is received, so that the size of the frame rate or resolution is negatively correlated with the link jitter of the unidirectional gateway.
[0031] like Figure 2 and Figure 4 As shown, this embodiment also includes receiving RTSP video in a unidirectional gateway environment through a receiving end service including a video receiving and decoding module, a packet loss repair module, and a video reconstruction and playback module: The video receiving and decoding module monitors the data stream from the unidirectional gateway in real time and continuously. After receiving the data, it verifies the integrity of the data, decapsulates it according to the industrial standard of the unidirectional gateway protocol, and reassembles the data according to the fragment sequence information. The packet loss repair module uses redundantly coded error correction information to repair and reconstruct data to fill transmission gaps caused by network instability, ensure that packet loss caused by network fluctuations during one-way transmission can be effectively repaired, and ensure the integrity of the video and the stability of video playback; The reconstructed video stream is processed through the video reconstruction and playback module, the decoded audio and video data is synchronously processed and formatted, and the stream is directed to the specified output path according to the preset configuration.
[0032] The video receiving and decoding module of the receiving end service captures data packets through a dedicated interface to ensure that the receiving end can stably and efficiently obtain data streams in a non-feedback network environment. After receiving the data packet from the unidirectional gateway, the video receiving and decoding module performs integrity check on each data packet to ensure that the data is not damaged or lost during transmission. After that, the module decapsulates the content of the data packet according to the requirements of the unidirectional gateway protocol standard, reassembles the data according to the fragment sequence and other information, and transmits the data to the packet loss repair module.
[0033] After receiving the data transmitted by the video receiving and decoding module, the packet loss repair module uses the redundant information generated by the forward error correction (FEC) coding to monitor and repair the packet loss caused by network fluctuations in real time, thereby effectively improving the integrity of the audio and video streams. In the absence of a feedback mechanism, the redundant data provided by the FEC coding can reconstruct the lost data packets at the receiving end, making data transmission more reliable. The packet loss repair module accurately reorganizes the sequence number and redundant information in the data packet header after the video packet is subpacked and packaged for each frame of the video packet in the video packaging and sending module. At the same time, a variety of preset packet loss repair strategies can be adopted. For the case where the packet loss rate is reduced, the redundant data is directly used to repair the lost data packets; when serious packet loss occurs due to network fluctuations, the packet loss repair module will skip some redundant or secondary frames to give priority to restoring key frames, thereby reducing resource consumption, filling the transmission gaps caused by network instability, and ensuring the continuity of video data. In addition, the module can still ensure the complete presentation of video content under high network jitter conditions, so that the video can avoid freezes or picture loss during playback, thereby improving the stability of the overall transmission system and the smoothness of playback. Finally, the packet loss repair module transmits the reassembled and repaired data packets to the video reconstruction and playback module. In this embodiment, repairing and reconstructing the data using the redundantly coded error correction information by the packet loss repair module includes: using the redundantly coded error correction information to detect the packet loss rate of the data by the packet loss repair module, if the packet loss rate is less than a preset threshold, directly using the redundantly coded error correction information to repair the lost data packets; otherwise, for the key video frames and non-key video frames in the data packets, the redundantly coded error correction information is preferentially used to repair the data packets corresponding to the key video frames.
[0034] In this embodiment, the video stream after reconstruction is processed by the video reconstruction and playback module, and the decoded audio and video data are synchronously processed and formatted. When the video data in the decoded audio and video data is directed to the specified output path according to the preset configuration, at least one of image enhancement and noise reduction is performed on the video data in the decoded audio and video data. The image enhancement includes adjusting the color and saturation of the video image, and the noise reduction includes identifying the dynamic area and static area of the video image frame according to adjacent video image frames, wherein the dynamic area refers to the area that changes in the adjacent video image frames, and the static area refers to the area that remains unchanged in the adjacent video image frames, and different noise reduction filter parameters are used for the dynamic area and the static area to perform noise reduction, so that the noise reduction strength of the dynamic area is smaller and the noise reduction strength of the static area is greater to enhance the stability of the video image frame and ensure the quality and clarity of the video stream. 7) After completing the decoding of the received video stream, the video reconstruction and playback module synchronously processes and formats the decoded audio and video data, and reconstructs the video stream into a standard format that meets the requirements of the playback device or storage device. This module not only performs basic video decoding, but also includes post-processing functions such as image enhancement and noise reduction. The color information is adaptively adjusted according to the video content using the color and saturation adjustment function to make the color performance of the video more vivid. The filter parameters are dynamically adjusted based on the video frame content to adapt to different noise environments. For example, when a high-motion area is detected, the noise reduction intensity is reduced to prevent the picture from being blurred. In static areas, the noise reduction intensity is increased to enhance image stability and ensure that the quality and clarity of the video stream meet user needs. After reconstruction, the video data will flow to different output paths according to the preset configuration, such as real-time playback devices, online live broadcast platforms, or local / cloud storage devices to support video usage requirements in different scenarios. For real-time playback scenarios, the module will automatically optimize the playback parameters according to the device refresh rate and resolution to ensure smooth and unstuck images. For storage requirements, the module adjusts the video data according to the compression ratio and resolution to maximize the use of storage space while ensuring the quality of the video. The module ultimately achieves stable output of video data, allowing users to obtain high-quality viewing experience in various playback environments.
[0035] In summary, the RTSP video transmission method under the unidirectional gateway environment of this embodiment includes a camera-side service and a receiving-side service. The camera-side service is deployed in advance on the front-end sending host server, and the receiving-side service is deployed on the back-end receiving host device, wherein the camera-side service includes a client module, a data redundancy coding module, a policy management module, and a video stream packaging and sending module, etc., and the receiving-side service includes a video receiving and decoding module, a packet loss repair module, and a video reconstruction and playback module, etc. The camera-side service first constructs an RTSP client through the client module to actively initiate a transmission request to the RTSP server of the camera, and transmits the acquired audio and video data to the data redundancy coding module for redundant coding. By adding error correction information and other methods, in the case of no feedback on the link, the data lost during the network oscillation process can be repaired through redundant information, and the data transmission link is confirmed through the policy management module. Finally, the data is encapsulated and fragmented through the video stream packaging and sending module, and the data is sent to the unidirectional gateway according to the specified protocol standard. After the receiving end module receives the encapsulated data through the video receiving and decoding module, it decapsulates and reorganizes the data, and then uses the redundant data to repair and reconstruct the damaged data through the packet loss repair module. Finally, the decoded data is processed by the video reconstruction and playback module and flows to different output paths according to the preset configuration. The method of this embodiment solves the problem of ensuring the reliable transmission and playback of video data in a unidirectional network environment without a reverse link. At the same time, the error correction technology is used to tolerate the unstable network situation and ensure the integrity of the data. Through video compression technology and data flow detection and control, while ensuring the stability of the link, the video transmission efficiency is improved and the transmission delay is reduced. This system is suitable for various monitoring manufacturers that require high security and has a wide range of applicability. The RTSP video transmission system under the unidirectional gateway environment of this embodiment uses a physical machine running the Linux system as the basis, deploys the camera end and the receiving end service on the physical machine, and prevents various reverse attacks and information leakage of the internal and external networks through a physical unidirectional gateway to enhance the security of the network; through the forward error correction technology, the packet loss and other situations under the network shock are automatically repaired and reorganized to improve the continuity and reliability of the video data and ensure the high fault tolerance of the system. Through efficient video compression technology and detection and control of link data traffic, the efficiency of data transmission is improved, and data transmission delay is reduced while ensuring stability.
[0036] In addition, this embodiment also provides an RTSP video transmission system under a unidirectional gateway environment, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the RTSP video transmission method under the unidirectional gateway environment.
[0037] In addition, this embodiment further provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment through a processor.
[0038] In addition, this embodiment also provides a computer program product, including a computer program or an instruction, wherein the computer program or the instruction is programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment through a processor.
[0039] Those skilled in the art should understand that the technical solutions provided by the embodiments of the present application may be in the form of methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0040] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A RTSP video transmission method in a unidirectional gateway environment, characterized in that: It includes RTSP video transmission in a one-way gateway environment through the camera end service including the client module, data redundancy encoding module, policy management module and video stream packaging and sending module: The RTSP client is constructed through the client module, actively initiates a request to the camera as the RTSP server, and starts the transmission of the data stream through instructions, so as to obtain the real-time compressed and encoded audio and video stream; the camera acts as an RTSP server to provide the compressed and encoded video stream; The data redundancy coding module is used to redundancy encode the video stream data and add error correction information, so that the receiving end service can automatically repair the lost data packets through the redundant information to ensure the integrity of the video stream even when feedback is not possible; The link relationship between the camera and the receiving end service is managed through the policy management module, and the redundantly encoded audio and video streams are attached with the associated receiving end service information so that a single camera end service can be connected to one or more receiving end services; The video stream packaging and sending module packages the video data after receiving the associated receiving end service information, encapsulates it according to the data packet transmission format constrained by the unidirectional gateway, performs specified encoding processing on the header information, check information and fragmentation sequence of the data packet, and transmits the final generated data packet to the unidirectional gateway to send it to the receiving end service.
2. The RTSP video transmission method under a one-way gateway environment according to claim 1, characterized in that: The video data after the associated receiving end service information is packaged by the video stream packaging and sending module, encapsulated according to the data packet transmission format constrained by the unidirectional gateway, the header information, check information and fragment sequence of the data packet are encoded as specified, and the finally generated data packet is transmitted to the unidirectional gateway to be sent to the receiving end service, including: the video data stream data after the associated receiving end service information is fragmented with a fixed size, the data that does not reach the fixed length is filled with 0, each piece of data is added with a fragment sequence number and a total number of slices to ensure that the original data can be reassembled at the receiving end, and by using frame-level encapsulation, fragmentation and serialization are performed in each frame to ensure that even if part of the fragment is lost, part of the picture can still be restored at the frame level, thereby reducing the impact on the fluency; and the fragmented data packet is added with a timestamp, frame number, stream ID, and packet ID. The timestamp information helps the receiving end to play according to the original time sequence, preventing the fluency from being affected by disorder or network delay, so that the order and integrity can be confirmed at the receiving end; CRC32 is used to check the integrity of the data packet data and generate a check code so that the receiving end service can detect and remove damaged data packets without feedback, thereby ensuring the integrity of the received data; for the generated data packet, the format of the data packet is adjusted to adapt to one-way transmission according to the protocol standard of the one-way gateway to avoid feedback path dependence, and the data packet adapted for one-way transmission is sent to the receiving end service.
3. The RTSP video transmission method under a one-way gateway environment according to claim 2, characterized in that: It also includes real-time detection of the real-time available bandwidth upper limit of the link between the camera-side service and the receiving-side service and providing a query API interface for the camera-side service to call; when sending the data packet adapted for unidirectional transmission to the receiving-side service, it includes first optimizing the data packet adapted for unidirectional transmission based on the optimal transmission strategy, and then sending the optimized data packet to the receiving-side service; The optimization processing of the data packets adapted for unidirectional transmission based on the optimal transmission strategy includes: the camera-side service queries the API interface camera-side service and the link between the receiving-side service to obtain the upper limit of the real-time available bandwidth; if the upper limit of the real-time available bandwidth of the link is less than the preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission mode, and the optimized transmission mode is one of the following optimized transmission modes: Mode 1, priority is given to transmitting key video frames and appropriate discarding or downgrading transmission of non-key video frames, and the use of frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusting the bit rate of the video data stream data after the associated receiving-side service information is received, so that the size of the bit rate is positively correlated with the upper limit of the real-time available bandwidth of the link; Mode 3, adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving-side service information is received, so that the size of the frame rate or resolution is positively correlated with the upper limit of the real-time available bandwidth of the link.
4. The RTSP video transmission method under a one-way gateway environment according to claim 2, characterized in that: It also includes real-time detection of link delays between the camera-side service and the receiving-side service and providing a query API interface for the camera-side service to call; when sending the data packet adapted for unidirectional transmission to the receiving-side service, it includes first optimizing the data packet adapted for unidirectional transmission based on the optimal transmission strategy, and then sending the optimized data packet to the receiving-side service; The optimization processing of the data packets adapted for unidirectional transmission based on the optimal transmission strategy includes: the camera-side service queries the link delay between the API interface camera-side service and the receiving-side service; if the link delay is greater than a preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission mode, and the optimized transmission mode is one of the following optimized transmission modes: Mode 1, priority is given to transmitting key video frames and appropriate discarding or downgrading transmission of non-key video frames, and the use of frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusting the bit rate of the video data stream data after the associated receiving-side service information is received, so that the bit rate is negatively correlated with the link delay of the unidirectional gateway; Mode 3, adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving-side service information is received, so that the frame rate or resolution is negatively correlated with the link delay of the unidirectional gateway.
5. The RTSP video transmission method under a one-way gateway environment according to claim 2, characterized in that: It also includes real-time detection of link jitter between the camera-side service and the receiving-side service and providing a query API interface for the camera-side service to call, wherein the link jitter refers to the time difference between multiple transmissions; when sending the data packet adapted for unidirectional transmission to the receiving-side service, it includes first optimizing the data packet adapted for unidirectional transmission based on the optimal transmission strategy, and then sending the optimized data packet to the receiving-side service; The optimization processing of the data packets after adaptation to unidirectional transmission based on the optimal transmission strategy includes: obtaining the link jitter of the unidirectional gateway, if the link jitter of the unidirectional gateway is greater than a preset value, querying the preset optimal transmission strategy to determine the current optimized transmission mode, and the optimized transmission mode is one of the following optimized transmission modes: Mode 1, giving priority to transmitting key video frames and appropriately discarding or downgrading the transmission of non-key video frames, and using frame-level encapsulation includes setting key video frames and non-key video frames for video frames; Mode 2, adaptively adjusting the bit rate of the video data stream data after the associated receiving end service information is received, so that the size of the bit rate is negatively correlated with the link jitter of the unidirectional gateway; Mode 3, adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving end service information is received, so that the size of the frame rate or resolution is negatively correlated with the link jitter of the unidirectional gateway.
6. The RTSP video transmission method under a one-way gateway environment according to claim 1, characterized in that: It also includes RTSP video reception in a one-way gateway environment through a receiving end service including a video receiving and decoding module, a packet loss repair module, and a video reconstruction and playback module: The video receiving and decoding module monitors the data stream from the unidirectional gateway in real time and continuously. After receiving the data, it verifies the integrity of the data, decapsulates it according to the industrial standard of the unidirectional gateway protocol, and reassembles the data according to the fragment sequence information. The packet loss repair module uses redundantly coded error correction information to repair and reconstruct data to fill transmission gaps caused by network instability, ensure that packet loss caused by network fluctuations during one-way transmission can be effectively repaired, and ensure the integrity of the video and the stability of video playback; The reconstructed video stream is processed through the video reconstruction and playback module, the decoded audio and video data is synchronously processed and formatted, and the stream is directed to the specified output path according to the preset configuration.
7. The RTSP video transmission method under a unidirectional gateway environment according to claim 6, characterized in that: The method of repairing and reconstructing data by using redundantly coded error correction information through the packet loss repair module includes: using redundantly coded error correction information to detect the packet loss rate of data through the packet loss repair module, and if the packet loss rate is less than a preset threshold, directly using the redundantly coded error correction information to repair the lost data packet; otherwise, for key video frames and non-key video frames in the data packet, the redundantly coded error correction information is preferentially used to repair the data packet corresponding to the key video frame; the method of processing the reconstructed video stream through the video reconstruction and playback module, synchronously processing and formatting the decoded audio and video data, and when the data stream flows to the specified output path according to the preset configuration, The method includes performing at least one of image enhancement and noise reduction on the video data in the decoded audio and video data, wherein the image enhancement includes adjusting the color and saturation of the video image, and the noise reduction includes identifying the dynamic area and the static area of the video image frame according to adjacent video image frames, wherein the dynamic area refers to the area that changes in the adjacent video image frames, and the static area refers to the area that remains unchanged in the adjacent video image frames, and different noise reduction filter parameters are used for the dynamic area and the static area to perform noise reduction, so that the noise reduction strength in the dynamic area is smaller and the noise reduction strength in the static area is larger, so as to enhance the stability of the video image frame and ensure the quality and clarity of the video stream.
8. An RTSP video transmission system in a unidirectional gateway environment, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment described in any one of claims 1 to 7 through a processor.
10. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction is programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment described in any one of claims 1 to 7 through a processor.
Citation Information
Patent Citations
3G video transmission method and system based on compression sensing
CN103957389A
Data transmission method and device, electronic equipment and storage medium
CN117768669A
Fault-tolerant video streaming in one-way transfer systems
US20240406514A1
Video quality problem determination method and apparatus, storage medium, and program product
WO2023024469A1
Cited By
Image processing transmission method suitable for display control tracking and related product
CN120856841A