RTSP video transmission method and system in one-way gateway environment
By employing redundant coding and optimized transmission strategies in a unidirectional gateway environment, the RTSP video transmission method solves the reliability and stability issues of video data transmission in such environments, achieving high-security and low-latency video transmission, which is suitable for high-security monitoring scenarios.
Patent Information
- Application Number
- CN202411811688.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-10
AI Technical Summary
In a one-way gateway environment, existing RTSP video transmission systems cannot guarantee reliable transmission and stability of video data without a reverse link. Especially in high-security network environments, achieving stable and smooth video transmission has become a technical challenge.
It employs a client module, a data redundancy encoding module, a policy management module, and a video stream packaging and sending module. Through redundancy encoding and optimized transmission strategies, it transmits and plays video data in a one-way gateway environment, ensuring data integrity and smoothness.
It enables reliable transmission and playback of video data in a one-way gateway environment, improves the security and stability of the network environment, reduces transmission latency, and is suitable for high-security monitoring scenarios such as military, government facilities, and nuclear power plants.
Smart Images

Figure CN119814973B_ABST
Abstract
Description
Technical Field
[0001] This invention pertains to network video transmission technology, specifically relating to an RTSP video transmission method and system in a one-way gateway environment. Background Technology
[0002] In certain high-security or restricted network environments, bidirectional data transmission may pose security risks, or the system architecture may dictate that only unidirectional data flow is supported. For example, applications in government agencies, military communications, and monitoring centers often require unidirectional data transmission to ensure that the receiving end does not leak sensitive information or suffer network attacks. In such a unidirectional gateway environment, data is typically only allowed to flow from the source (sender) to the destination (receiver), and no feedback information is permitted. Most existing streaming media transmission systems rely on bidirectional communication for data confirmation and error correction. The RTSP protocol typically requires bidirectional transmission for the exchange of control commands and reliable transmission of streaming media data. Achieving stable and smooth RTSP video transmission under unidirectional gateway conditions has become a technical challenge. Summary of the Invention
[0003] The technical problem to be solved by this invention is to provide an RTSP video transmission method and system in a one-way gateway environment, which addresses the above-mentioned problems of the prior art. This invention realizes RTSP video transmission in a one-way gateway environment, ensuring reliable transmission and playback of video data in the absence of a reverse link in the one-way gateway environment, while avoiding data dependence in the bidirectional interaction process, and ensuring the stability and low latency of video transmission under strictly limited network conditions.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0005] A method for RTSP video transmission in a one-way gateway environment includes sending RTSP video in the one-way gateway environment through a camera-end service comprising a client module, a data redundancy encoding module, a policy management module, and a video stream packet sending module.
[0006] An RTSP client is built using a client module. It actively sends requests to the camera, which acts as an RTSP server, and initiates data stream transmission via commands to obtain real-time compressed and encoded audio and video streams. The camera acts as an RTSP server, providing the compressed and encoded video stream.
[0007] By using a data redundancy coding module to add error correction information to the video stream data, the receiving end service can automatically repair lost data packets to ensure the integrity of the video stream even when it is unable to provide feedback.
[0008] The policy management module manages the link relationship between the camera and the receiving service and adds the associated receiving service information to the redundant encoded audio and video streams so that a single camera service can connect to one or more receiving services.
[0009] 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 one-way gateway, performs specified encoding processing on the header information, check information and fragment sequence of the data packet, and transmits the final generated data packet to the one-way gateway to send it to the receiving end service.
[0010] Optionally, 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 one-way gateway, performs specified encoding processing on the header information, check information, and fragment sequence of the data packet, and transmits the final generated data packet to the one-way gateway for sending to the receiving end service. This includes: segmenting the received video data stream after receiving the associated receiving end service information into fixed-size fragments, padding data that does not reach the fixed length with 0s, adding a fragment sequence number and total fragment number to each fragment to ensure that the original data can be reassembled at the receiving end; using frame-level encapsulation, segmenting and serializing within each frame to ensure that even if some segments are lost, some frames can still be recovered at the frame level, reducing the impact on smoothness; and adding timestamps, frame numbers, stream IDs, and packet IDs to the segmented data packets. The header information, including timestamps, helps the receiving end play the data according to the original time sequence, preventing smoothness issues caused by out-of-order playback or network latency. This allows the receiving end to confirm the order and integrity. CRC32 is used to verify the integrity of the data packets, generating a checksum so that the receiving end service can detect and remove corrupted data packets without feedback, ensuring the integrity of the received data. The generated data packets are formatted according to the protocol standards of the one-way gateway to adapt to one-way transmission and avoid feedback path dependence before being sent to the receiving end service.
[0011] Optionally, it also includes real-time detection of the upper limit of the real-time available bandwidth of the link between the camera service and the receiving service, and providing a query API interface for the camera service to call; when sending the data packet adapted for one-way transmission to the receiving 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 service; the optimization of the data packet adapted for one-way transmission based on the optimal transmission strategy includes: querying the camera service API. The upper limit of the real-time available bandwidth of the link between the interface camera service and the receiving service is determined. If the upper limit of the real-time available bandwidth is less than a preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission method. The optimized transmission method is one of the following: Method 1, prioritize the transmission of key video frames and appropriately discard or downgrade 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; Method 2, adaptively adjust the bit rate of the video data stream after receiving the associated receiving service information so that the bit rate is positively correlated with the upper limit of the real-time available bandwidth of the link; Method 3, adaptively adjust the frame rate or resolution of the video data stream after receiving the associated receiving service information so that the frame rate or resolution is positively correlated with the upper limit of the real-time available bandwidth of the link.
[0012] Optionally, it also includes real-time detection of link latency between the camera-end service and the receiving-end service, and providing a query API interface for the camera-end service to call; when sending the adapted one-way transmission data packet to the receiving-end service, it includes first optimizing the adapted one-way transmission data packet based on the optimal transmission strategy, and then sending the optimized data packet to the receiving-end service; the optimization of the adapted one-way transmission data packet based on the optimal transmission strategy includes: camera-end service query API. If the link latency between the interface camera service and the receiving service exceeds a preset value, the current optimized transmission method is determined by querying the preset optimal transmission strategy. The optimized transmission method is one of the following: Method 1: Prioritize the transmission of key video frames while appropriately discarding or downgrading the transmission of non-key video frames. When using frame-level encapsulation, this includes setting key and non-key video frames for the video frames; Method 2: Adaptively adjust the bit rate of the video data stream after receiving associated receiving service information, so that the bit rate is negatively correlated with the link latency of the one-way gateway; Method 3: Adaptively adjust the frame rate or resolution of the video data stream after receiving associated receiving service information, so that the frame rate or resolution is negatively correlated with the link latency of the one-way gateway.
[0013] Optionally, it also includes real-time detection of link jitter between the camera-side service and the receiver-side service, and providing a query API. The interface is provided for camera-side service calls. Link jitter refers to the time difference between multiple transmissions. When sending the data packet adapted for one-way transmission to the receiving service, it includes first optimizing the data packet based on the optimal transmission strategy, and then sending the optimized data packet to the receiving service. Optimizing the data packet based on the optimal transmission strategy includes: obtaining the link jitter of the one-way gateway; if the link jitter of the one-way gateway is greater than a preset value, querying the preset optimal transmission strategy to determine the current optimized transmission method. The optimized transmission method is one of the following: Method 1, prioritizing the transmission of key video frames while appropriately discarding or downgrading non-key video frames; when using frame-level encapsulation, it includes setting key and non-key video frames for the video frames; Method 2, adaptively adjusting the bit rate of the video data stream after receiving associated receiving service information, so that the bit rate is negatively correlated with the link jitter of the one-way gateway; Method 3, adaptively adjusting the frame rate or resolution of the video data stream after receiving associated receiving service information, so that the frame rate or resolution is negatively correlated with the link jitter of the one-way gateway.
[0014] Optionally, it also includes RTSP video reception in a one-way gateway environment through a receiver service that includes a video reception and decoding module, a packet loss repair module, and a video reconstruction and playback module:
[0015] The video receiving and decoding module monitors the data stream from the one-way gateway in real time and continuously. After receiving the data, it performs integrity verification, decapsulates the data according to the one-way gateway protocol, and reassembles the data according to the fragment sequence information.
[0016] The packet loss repair module uses redundant coding error correction information to repair and reconstruct the data, in order to fill the transmission gap 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.
[0017] The video reconstruction and playback module processes the reconstructed video stream, synchronizes and formats the decoded audio and video data, and directs it to the specified output path according to the preset configuration.
[0018] Optionally, the step of repairing and reconstructing data using redundantly encoded error correction information via the packet loss repair module includes: detecting the packet loss rate using redundantly encoded error correction information via the packet loss repair module; if the packet loss rate is less than a preset threshold, the redundantly encoded error correction information is directly used to repair the lost data packets; otherwise, for key video frames and non-key video frames in the data packets, the redundantly encoded error correction information is used first to repair the data packets corresponding to the key video frames; the step of processing the reconstructed video stream via the video reconstruction and playback module, synchronously processing and formatting the decoded audio and video data, and directing it to the specified output path according to the preset configuration. It also includes post-processing of the video data in the decoded audio and video data, including image enhancement and noise reduction. The image enhancement includes adjusting the color and saturation of the video image. The noise reduction includes identifying the dynamic and static regions of the video image frames based on adjacent video image frames. The dynamic region refers to the region that changes in adjacent video image frames, and the static region refers to the region that remains unchanged in adjacent video image frames. Different noise reduction filter parameters are used for the dynamic and static regions to reduce noise, so that the noise reduction of the dynamic region is less and the noise reduction of the static region is more, thereby enhancing the stability of the video image frames and ensuring the quality and clarity of the video stream.
[0019] Furthermore, the present invention also provides an RTSP video transmission system in a one-way gateway environment, including a microprocessor and a memory interconnected thereto, wherein the microprocessor is programmed or configured to execute the RTSP video transmission method in the one-way gateway environment.
[0020] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute the RTSP video transmission method in a one-way gateway environment via a processor.
[0021] In addition, the present invention also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the RTSP video transmission method in the unidirectional gateway environment via a processor.
[0022] Compared with the prior art, the present invention has the following main advantages:
[0023] 1. The method of the present invention prevents various reverse attacks and information leakage between internal and external networks by using a physical one-way gateway and encrypted transmission on the link, thus possessing high security.
[0024] 2. The method of the present invention uses forward error correction technology, which enables the receiving end to automatically repair packet loss caused by network fluctuations in the scenario of a one-way gateway link, ensuring the integrity of data and video, and has high fault tolerance.
[0025] 3. The method of the present invention improves the efficiency of audio and video data transmission and reduces transmission latency by using efficient video compression technology and detecting and controlling data traffic in the link.
[0026] 4. The system of this invention is applicable to various monitoring scenarios that require high security, such as military, government facilities, nuclear power plants, airport monitoring and other environments, and has wide adaptability. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of the deployment topology of the method in an embodiment of the present invention.
[0028] Figure 2 This is a schematic diagram illustrating the working principle of the method in an embodiment of the present invention.
[0029] Figure 3 This is a schematic diagram of camera-side service processing in an embodiment of the present invention.
[0030] Figure 4 This is a schematic diagram of the receiving end service processing in an embodiment of the present invention. Detailed Implementation
[0031] The following text will be based on Figure 1 In a surveillance scenario illustrated, the camera is deployed in a high-security area, and the camera data is transmitted from the external network to the internal network for playback via a one-way gateway. This document provides a further detailed description of the RTSP video transmission system under a one-way gateway environment. This implementation example is based on a physical machine running a Linux system.
[0032] like Figure 2 and Figure 3 As shown, this embodiment provides an RTSP video transmission method in a one-way gateway environment, including RTSP video transmission in a one-way gateway environment through a camera-side service that includes a client module, a data redundancy encoding module, a policy management module, and a video stream packet sending module:
[0033] An RTSP client is built using a client module. It actively sends requests to the camera, which acts as an RTSP server, and initiates data stream transmission via commands to obtain real-time compressed and encoded audio and video streams. The camera acts as an RTSP server, providing the compressed and encoded video stream.
[0034] The video stream data is redundantly encoded by the data redundancy encoding module to add error correction information (in this embodiment, forward error correction FFC encoding is used to add error correction information, i.e., redundant information; other redundancy encoding methods can also be used as needed). This enables the receiving end service to automatically repair lost data packets through redundant information to ensure the integrity of the video stream, even when feedback is not possible.
[0035] The policy management module manages the link relationship between the camera and the receiving service and adds the associated receiving service information to the redundant encoded audio and video streams so that a single camera service can connect to one or more receiving services.
[0036] 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 one-way gateway, performs specified encoding processing on the header information, check information and fragment sequence of the data packet, and transmits the final generated data packet to the one-way gateway to send it to the receiving end service.
[0037] like Figure 2 As shown in this embodiment, 1) a camera service is pre-deployed on the external network front-end sending device host A, and a receiving service is deployed on the internal network back-end receiving device host B. The camera service is used to receive data sent by the external network camera application, process it, and then transmit it to the one-way gateway. The receiving service is used to receive data from the one-way gateway, process it, and then transmit it to the video player or back-end storage service. The sending and receiving directories of the camera and video player are created on the front-end sending device host A and the back-end receiving device host B through the directory creation API interface provided by the policy management module, and the communication relationship between the camera and the video player is created through the policy creation API interface. The camera service includes a client module, a data redundancy encoding module, a policy management module, and a video stream packaging and sending module, etc. The receiving service includes a video receiving and decoding module, a packet loss repair module, and a video reconstruction and playback module, etc.
[0038] In this embodiment, after the client module of the camera service detects the existence of a camera directory and the corresponding interconnection relationship creation action, it confirms the RTSP server IP and port of the camera through the camera directory, creates an RTSP client, and sends a request to the RTSP server of the camera to obtain the streaming media resource description of the camera. Then, it uses instructions to start the transmission of the data stream. The corresponding data of the RTSP server (camera) includes a description of the real-time data stream and transmission information. It obtains the real-time compressed and encoded audio and video streams from the data stream and sends the obtained audio and video stream data to the data redundancy encoding module.
[0039] In this embodiment, after receiving the audio and video data transmitted from the previous module, the data redundancy encoding module performs forward error correction processing to generate redundancy information to address packet loss. This allows the receiving end service to automatically repair lost data packets and ensure the integrity of the video stream even when feedback is unavailable. This module employs the standard Reed-Solomon algorithm to balance bandwidth consumption and redundancy, adapting to network fluctuations in one-way transmission. Finally, the module sends the redundantly encoded data to the video stream packetization and transmission module.
[0040] In this embodiment, the video stream packetization and transmission 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 one-way gateway, and performs specified encoding processing on the header information, check information, and fragment sequence of the data packet. The final generated data packet is then transmitted to the one-way gateway for delivery to the receiving end service. This includes: segmenting the received video data stream after receiving the associated receiving end service information into fixed-size fragments, padding data that does not reach the fixed length with 0s, adding a fragment number and the total number of fragments to each fragment to ensure that the original data can be reassembled at the receiving end; and using frame-level encapsulation, segmentation and serialization are performed within each frame to ensure that even if some segments are lost, the data can still be reassembled. Frame-level recovery of some frames minimizes the impact on smoothness. For fragmented data packets, header information including timestamps, frame numbers, stream IDs, and packet IDs is added. The timestamp information helps the receiver play the data according to the original time sequence, preventing smoothness issues caused by out-of-order playback or network latency, thus allowing the receiver to confirm order and integrity. CRC32 is used to verify the integrity of data packets, generating checksums so that the receiving service can detect and remove corrupted packets without feedback, ensuring the integrity of received data. The generated data packets are formatted according to the protocol standards of a one-way gateway to adapt to one-way transmission and avoid feedback path dependence before being sent to the receiving service. Through these specific encoding processes, data integrity and reconfigurability are guaranteed even in the absence of feedback links in the network.
[0041] In this embodiment, when sending the adapted one-way transmission data packet to the receiving end service, the process includes first optimizing the adapted one-way transmission data packet based on the optimal transmission strategy, and then sending the optimized data packet to the receiving end service. The video stream packet sending module queries the strategy rules designed during the audio and video data transmission process by calling the strategy query API interface, including information such as the gateway path information from the camera data to the intranet player, the maximum allowable latency, and the jitter threshold. By calculating and processing the historical bandwidth data of the path specified in the strategy rules and real-time network information, the upper limit of the real-time available bandwidth of the link is confirmed. Based on the value of the upper limit of the real-time available bandwidth of the link, when the available bandwidth of the link is very low, key video frames (such as I-frames) are prioritized for transmission, while non-key frames (such as P-frames and B-frames) are appropriately dropped or downgraded for transmission, or the video encoding bitrate is adaptively adjusted, and the frame rate or resolution is reduced to adapt to the current bandwidth status. Dynamic adjustments are made based on real-time traffic feedback to ensure the continuity of the basic video stream. Simultaneously, the system detects the latency of the real-time link, sets maximum allowable latency and jitter thresholds, and can promptly detect link latency affecting the smoothness and real-time performance of the video stream. For links with high latency or frequent jitter, key frames are prioritized for transmission, while other frames are downgraded or skipped to ensure the decodeability and clarity of the video content. By using policies and information such as bandwidth, latency, and traffic delay to ensure that video data transmission conforms to the optimal transmission strategy for the current link, the processed data is finally transmitted to the unidirectional gateway.
[0042] As an optional implementation, this embodiment also includes real-time detection of the upper limit of the real-time available bandwidth of the link between the camera service and the receiving service, and providing a query API interface for the camera service to call; the optimization processing of the data packets after adaptation to one-way transmission based on the optimal transmission strategy includes: the camera service queries the upper limit of the real-time available bandwidth of the link between the camera service and the receiving service through the API interface; if the upper limit of the real-time available bandwidth is less than a preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission method. The optimized transmission method is one of the following optimized transmission methods: Method 1, prioritizing the transmission of key video frames while appropriately discarding or downgrading the 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; Method 2, adaptively adjusting the bit rate of the video data stream data after receiving the associated receiving service information, so that the bit rate is positively correlated with the upper limit of the real-time available bandwidth of the link; Method 3, adaptively adjusting the frame rate or resolution of the video data stream data after receiving the associated receiving service information, so that the frame rate or resolution is positively correlated with the upper limit of the real-time available bandwidth of the link.
[0043] As an optional implementation, this embodiment also includes real-time detection of the link latency between the camera-end service and the receiving-end service, and providing a query API interface for the camera-end service to call. The optimization processing of the data packets after adaptation to one-way transmission based on the optimal transmission strategy includes: the camera-end service querying the API interface for the link latency between the camera-end service and the receiving-end service; if the link latency is greater than a preset value, then querying the preset optimal transmission strategy to determine the current optimized transmission method. The optimized transmission method is one of the following: Method 1, prioritizing the transmission of key video frames while appropriately discarding or downgrading the transmission of non-key video frames, wherein the use of frame-level encapsulation includes setting key and non-key video frames for video frames; Method 2, adaptively adjusting the bit rate of the video data stream after receiving associated receiving-end service information, so that the bit rate is negatively correlated with the link latency of the one-way gateway; Method 3, adaptively adjusting the frame rate or resolution of the video data stream after receiving associated receiving-end service information, so that the frame rate or resolution is negatively correlated with the link latency of the one-way gateway.
[0044] As an optional implementation, this embodiment also includes real-time detection of link jitter between the camera-end service and the receiving-end service, and providing a query API interface for the camera-end service to call. The link jitter refers to the time difference between multiple transmissions. The optimization processing of the data packets adapted for one-way transmission based on the optimal transmission strategy includes: obtaining the link jitter of the one-way gateway; if the link jitter of the one-way gateway is greater than a preset value, querying the preset optimal transmission strategy to determine the current optimized transmission method. The optimized transmission method is one of the following optimized transmission methods: Method 1, prioritizing the transmission of key video frames while appropriately discarding or downgrading the 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; Method 2, adaptively adjusting the bit rate of the video data stream after receiving the associated receiving-end service information, so that the bit rate is negatively correlated with the link jitter of the one-way gateway; Method 3, adaptively adjusting the frame rate or resolution of the video data stream after receiving the associated receiving-end service information, so that the frame rate or resolution is negatively correlated with the link jitter of the one-way gateway.
[0045] like Figure 2 and Figure 4 As shown, this embodiment also includes RTSP video reception in a one-way gateway environment through a receiver service comprising a video receiving and decoding module, a packet loss repair module, and a video reconstruction and playback module:
[0046] The video receiving and decoding module monitors the data stream from the one-way gateway in real time and continuously. After receiving the data, it performs integrity verification, decapsulates the data according to the one-way gateway protocol, and reassembles the data according to the fragment sequence information.
[0047] The packet loss repair module uses redundant coding error correction information to repair and reconstruct the data, in order to fill the transmission gap 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.
[0048] The video reconstruction and playback module processes the reconstructed video stream, synchronizes and formats the decoded audio and video data, and directs it to the specified output path according to the preset configuration.
[0049] The video receiving and decoding module of the receiving end service captures data packets through a dedicated interface, ensuring that the receiving end can stably and efficiently acquire data streams in a feedback-free network environment. After receiving data packets from the one-way gateway, the video receiving and decoding module performs integrity verification on each data packet to ensure that the data has not been damaged or lost during transmission. Subsequently, the module decapsulates the content of the data packets according to the requirements of the one-way gateway protocol standard, reassembles the data according to information such as fragmentation sequence, and then transmits the data to the packet loss repair module.
[0050] After receiving data from the video receiving and decoding module, the packet loss repair module uses redundant information generated by forward error correction (FEC) coding to monitor and repair packet loss caused by network fluctuations in real time, effectively improving the integrity of the audio and video streams. In the absence of a feedback mechanism, the redundant data provided by FEC coding can reconstruct lost data packets at the receiving end, making data transmission more reliable. The packet loss repair module precisely reassembles the data packets based on the sequence number and redundant information in the header of the data packets after each frame is packaged and sent by the video packetization module. It can also employ various preset packet loss repair strategies. When the packet loss rate is low, redundant data is directly used to repair lost data packets. When severe packet loss occurs due to network fluctuations, the module skips some redundant or minor frames to prioritize the recovery of key frames, thereby reducing resource consumption, filling transmission gaps caused by network instability, and ensuring the continuity of video data. Furthermore, this module can ensure the complete presentation of video content even under high network jitter, preventing stuttering or image loss during playback, thus improving the overall stability of the transmission system and the smoothness of playback. Finally, the packet loss repair module transmits the reconstructed and repaired data packets to the video reconstruction and playback module. In this embodiment, the data repair and reconstruction using redundantly encoded error correction information by the packet loss repair module includes: detecting the packet loss rate using the redundantly encoded error correction information; if the packet loss rate is less than a preset threshold, the redundantly encoded error correction information is directly used to repair the lost data packets; otherwise, for key video frames and non-key video frames in the data packets, the redundantly encoded error correction information is used first to repair the data packets corresponding to the key video frames.
[0051] In this embodiment, the video reconstruction and playback module processes the reconstructed video stream, synchronously processes and formats the decoded audio and video data, and when the stream flows to the specified output path according to the preset configuration, it also includes at least one post-processing step, namely image enhancement and noise reduction, 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 and static regions of the video image frames based on adjacent video image frames. The dynamic region refers to the region that changes in adjacent video image frames, and the static region refers to the region that remains unchanged in adjacent video image frames. Different noise reduction filter parameters are used for the dynamic and static regions to reduce noise, so that the noise reduction is less severe in the dynamic region and more severe in the static region, thereby enhancing the stability of the video image frames and ensuring 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, reconstructing 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. It adaptively adjusts color information based on video content using color and saturation adjustment functions, resulting in more vivid color reproduction. It dynamically adjusts filter parameters based on video frame content to adapt to different noise environments. For example, it reduces noise reduction intensity when high-motion areas are detected to prevent blurring, while increasing noise reduction in static areas to enhance image stability and ensure the video stream's quality and clarity meet user needs. The reconstructed video data is then routed to different output paths according to preset configurations, such as real-time playback devices, live streaming platforms, or local / cloud storage devices, to support video usage needs in various scenarios. For real-time playback, the module automatically optimizes playback parameters based on the device's refresh rate and resolution to ensure smooth, stutter-free playback. For storage needs, the module adjusts the video data according to compression ratio and resolution, maximizing storage space utilization while maintaining video quality. Ultimately, this module achieves stable video data output, enabling users to enjoy a high-quality viewing experience in various playback environments.
[0052] In summary, the RTSP video transmission method in the unidirectional gateway environment of this embodiment includes a camera-side service and a receiver-side service. The camera-side service is pre-deployed on the front-end sending host server, and the receiver-side service is deployed on the back-end receiving host device. 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. The receiver-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 uses the client module to build an RTSP client to actively initiate a transmission request to the camera's RTSP server, transmitting the acquired audio and video data to the data redundancy encoding module for redundancy encoding. By adding error correction information, the redundancy information can repair data lost during network fluctuations even in the event of no feedback. Simultaneously, the policy management module confirms the data transmission link. Finally, the video stream packaging and sending module encapsulates and fragments the data, sending it to the unidirectional gateway according to the specified protocol standards. After receiving the encapsulated data through the video receiving and decoding module, the receiving module decapsulates and reassembles the data. Then, the packet loss repair module uses redundant data to repair and reconstruct damaged data. Finally, the video reconstruction and playback module processes the decoded data and directs it to different output paths according to preset configurations. This embodiment solves the problem of ensuring reliable transmission and playback of video data in a unidirectional network environment without a reverse link. It also uses error correction technology to tolerate network instability and ensure data integrity. Through video compression technology and data traffic detection and control, it improves video transmission efficiency and reduces transmission latency while ensuring link stability. This system is suitable for various monitoring manufacturers requiring high security and has wide applicability. This embodiment's RTSP video transmission system in a unidirectional gateway environment is based on a physical machine running a Linux system. Camera and receiving services are deployed on the physical machine. The physical unidirectional gateway prevents various reverse attacks and information leakage between internal and external networks, enhancing network security. Forward error correction technology automatically repairs and reassembles packets lost due to network instability, improving the continuity and reliability of video data and ensuring high fault tolerance of the system. By using efficient video compression technology and detecting and controlling the data traffic of the link, the efficiency of data transmission is improved, and the data transmission latency is reduced while ensuring stability.
[0053] Furthermore, this embodiment also provides an RTSP video transmission system in a one-way gateway environment, including a microprocessor and a memory interconnected, wherein the microprocessor is programmed or configured to execute the RTSP video transmission method in the one-way gateway environment.
[0054] In addition, this embodiment also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute the RTSP video transmission method in a one-way gateway environment via a processor.
[0055] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the RTSP video transmission method in the unidirectional gateway environment via a processor.
[0056] Those skilled in the art will understand that the technical solutions provided by the embodiments of this application may be in the form of a method, system, or computer program product. Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create an implementation for the process. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0057] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for RTSP video transmission in a unidirectional gateway environment, characterized in that, This includes RTSP video transmission in a one-way gateway environment via a camera-side service that includes a client module, a data redundancy encoding module, a policy management module, and a video stream packetization and transmission module. An RTSP client is built using a client module. It actively sends requests to the camera, which acts as an RTSP server, and initiates data stream transmission via commands to obtain real-time compressed and encoded audio and video streams. The camera acts as an RTSP server, providing the compressed and encoded video stream. By using a data redundancy coding module to add error correction information to the video stream data, the receiving end service can automatically repair lost data packets to ensure the integrity of the video stream even when it is unable to provide feedback. The policy management module manages the link relationship between the camera and the receiving service and adds the associated receiving service information to the redundant encoded audio and video streams so that a single camera service can connect to one or more receiving 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 one-way gateway, performs specified encoding processing on the header information, check information and fragment sequence of the data packet, and transmits the final generated data packet to the one-way gateway to send it to the receiving end service.
2. The RTSP video transmission method in a unidirectional gateway environment according to claim 1, characterized in that, 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 one-way gateway, and performs specified encoding processing on the header information, check information, and fragment sequence of the data packet. The final generated data packet is then transmitted to the one-way gateway for delivery to the receiving end service. This includes: segmenting the received video data stream after receiving the associated receiving end service information into fixed-size fragments, padding data that does not reach the fixed length with 0s, adding a fragment sequence number and total fragment count to each fragment to ensure that the original data can be reassembled at the receiving end; using frame-level encapsulation, segmenting and serializing within each frame ensures that even if some segments are lost, some parts of the image can still be recovered at the frame level, reducing the impact on smoothness; and adding timestamps, frame numbers, stream IDs, and packet IDs to the segmented data packets. The header information, including timestamps, helps the receiving end play the data according to the original time sequence, preventing smoothness issues caused by out-of-order playback or network latency. This allows the receiving end to confirm the order and integrity. CRC32 is used to verify the integrity of the data packets, generating a checksum so that the receiving end service can detect and remove corrupted data packets without feedback, ensuring the integrity of the received data. The generated data packets are formatted according to the protocol standards of the one-way gateway to adapt to one-way transmission and avoid feedback path dependence before being sent to the receiving end service.
3. The RTSP video transmission method in a unidirectional gateway environment according to claim 2, characterized in that, It also includes real-time detection of the upper limit of available bandwidth of the link between the camera service and the receiving service, and provides a query API interface for the camera service to call; when sending the data packet adapted for one-way transmission to the receiving 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 service. The optimization processing of the data packets after one-way transmission based on the optimal transmission strategy includes: querying the upper limit of the real-time available bandwidth of the link between the camera service and the receiving service via the API interface. If the upper limit of the real-time available bandwidth is less than a preset value, the preset optimal transmission strategy is queried to determine the current optimized transmission method. The optimized transmission method is one of the following: Method 1, prioritizing the transmission of key video frames while appropriately discarding or downgrading the transmission of non-key video frames. When using frame-level encapsulation, this includes setting key and non-key video frames for the video frames; Method 2, adaptively adjusting the bit rate of the video data stream after receiving the associated receiving service information so that the bit rate is positively correlated with the upper limit of the real-time available bandwidth of the link; Method 3, adaptively adjusting the frame rate or resolution of the video data stream after receiving the associated receiving service information so that 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 in a unidirectional gateway environment according to claim 2, characterized in that, It also includes real-time detection of link latency between the camera service and the receiving service and provides a query API interface for the camera service to call; when sending the data packet adapted for one-way transmission to the receiving 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 service. The optimization processing of data packets after one-way transmission based on the optimal transmission strategy includes: querying the link latency between the camera service and the receiving service via the API interface of the camera service; if the link latency is greater than a preset value, querying the preset optimal transmission strategy to determine the current optimized transmission method. The optimized transmission method is one of the following: Method 1, prioritizing the transmission of key video frames while appropriately discarding or downgrading the transmission of non-key video frames, wherein frame-level encapsulation includes setting key and non-key video frames; Method 2, adaptively adjusting the bit rate of the video data stream after receiving associated receiving service information, so that the bit rate is negatively correlated with the link latency of the one-way gateway; Method 3, adaptively adjusting the frame rate or resolution of the video data stream after receiving associated receiving service information, so that the frame rate or resolution is negatively correlated with the link latency of the one-way gateway.
5. The RTSP video transmission method in a unidirectional gateway environment according to claim 2, characterized in that, It also includes real-time detection of link jitter between the camera service and the receiving service and provides a query API interface for the camera service to call. The link jitter refers to the time difference between multiple transmissions. When sending the data packet adapted for one-way transmission to the receiving 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 service. The optimization processing of data packets adapted for one-way transmission based on the optimal transmission strategy includes: obtaining the link jitter of the one-way gateway; if the link jitter of the one-way gateway is greater than a preset value, querying the preset optimal transmission strategy to determine the current optimized transmission method. The optimized transmission method is one of the following: Method 1, prioritizing the transmission of key video frames while appropriately discarding or downgrading the transmission of non-key video frames, wherein the use of frame-level encapsulation includes setting key and non-key video frames for video frames; Method 2, adaptively adjusting the bit rate of the video data stream after receiving associated receiver service information, so that the bit rate is negatively correlated with the link jitter of the one-way gateway; Method 3, adaptively adjusting the frame rate or resolution of the video data stream after receiving associated receiver service information, so that the frame rate or resolution is negatively correlated with the link jitter of the one-way gateway.
6. The RTSP video transmission method in a unidirectional gateway environment according to claim 1, characterized in that, It also includes RTSP video reception in a one-way gateway environment through a receiver service that includes video reception and decoding modules, packet loss repair modules, and video reconstruction and playback modules: The video receiving and decoding module monitors the data stream from the one-way gateway in real time and continuously. After receiving the data, it performs integrity verification, decapsulates the data according to the one-way gateway protocol, and reassembles the data according to the fragment sequence information. The packet loss repair module uses redundant coding error correction information to repair and reconstruct the data, in order to fill the transmission gap 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 video reconstruction and playback module processes the reconstructed video stream, synchronizes and formats the decoded audio and video data, and directs it to the specified output path according to the preset configuration.
7. The RTSP video transmission method in a unidirectional gateway environment according to claim 6, characterized in that, The process of repairing and reconstructing data using redundantly encoded error correction information via the packet loss repair module includes: detecting the packet loss rate using redundantly encoded error correction information; if the packet loss rate is less than a preset threshold, the redundantly encoded error correction information is directly used to repair the lost data packets; otherwise, for key video frames and non-key video frames in the data packets, the redundantly encoded error correction information is used first to repair the data packets corresponding to the key video frames; the process of processing the reconstructed video stream via the video reconstruction and playback module includes synchronous processing and formatting of the decoded audio and video data, and directing it to the specified output path according to the preset configuration. The method includes post-processing of video data in decoded audio and video data, including image enhancement and noise reduction. The image enhancement includes adjusting the color and saturation of the video image. The noise reduction includes identifying dynamic and static regions of video image frames based on adjacent video image frames. The dynamic region refers to the region that changes in adjacent video image frames, and the static region refers to the region that remains unchanged in adjacent video image frames. Different noise reduction filter parameters are used for the dynamic and static regions to reduce noise, so that the noise reduction is less severe in the dynamic region and more severe in the static region, thereby enhancing the stability of the video image frames and ensuring the quality and clarity of the video stream.
8. An RTSP video transmission system in a one-way gateway environment, comprising a microprocessor and a memory interconnected, characterized in that, The microprocessor is programmed or configured to perform 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 storing a computer program or instructions, characterized in that, The computer program or instructions are 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 via a processor.
10. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or instructions are 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 via 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