Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method and a system for transmitting RTSP video in a unidirectional gateway environment, which can realize the RTSP video transmission in the unidirectional gateway environment, ensure the reliable transmission and playing of video data without a reverse link in the unidirectional gateway environment, avoid the data dependence in the bidirectional interaction process, and ensure the stability and low delay of video transmission under the strictly limited network condition.
In order to solve the technical problems, the invention adopts the following technical scheme:
The RTSP video transmission method in the unidirectional gateway environment comprises the steps of transmitting RTSP video in the unidirectional gateway environment through camera head end service comprising a client module, a data redundancy coding module, a strategy management module and a video stream packaging and transmitting module:
An RTSP client is constructed through a client module, a request is actively sent to a camera serving as an RTSP server, and data stream transmission is started through an instruction, so that a real-time compression-encoded audio and video stream is obtained;
The data redundancy coding module performs redundancy coding on video stream data and adds error correction information, so that the receiving end service can automatically repair lost data packets through the redundancy information even if feedback cannot be performed, and the integrity of the video stream is ensured;
The method comprises the steps that a link relation between a camera and a receiving end service is managed through a strategy management module, and associated receiving end service information is attached to a redundant coded audio and video stream so that a single camera end service can be abutted to one or more receiving end services;
And packaging the video data after the received associated receiving end service information by a video stream packaging and sending module, packaging according to a data packet transmission format constrained by the unidirectional gateway, carrying out appointed coding processing on header information, check information and a fragment sequence of the data packet, and transmitting the finally generated data packet to the unidirectional gateway to be sent to the receiving end service.
Optionally, the video data after receiving the relevant receiving end service information is packed by the video stream packing and sending module, the packing processing is carried out according to the data packet transmission format constrained by the unidirectional gateway, the appointed coding processing is carried out on the header information, the check information and the slice sequence of the data packet, the finally generated data packet is transmitted to the unidirectional gateway to be sent to the receiving end service, the video data after receiving the relevant receiving end service information is sliced according to the fixed size, the data with the fixed length is complemented by 0, the slice sequence number and the total slice number are added to each slice of data, so that the original data can be recombined at the receiving end, the slice sequence number is carried out in each frame, the partial picture can be restored at the frame level even if part of the slice is lost, the influence on the fluency is reduced, the data packet after the slice is sliced, the header information containing the time stamp, the frame number, the stream ID and the packet ID is added, the receiving end can play according to the original time sequence, the disorder or network delay influence on the fluency is prevented, the data packet can be completely-matched with the data packet according to the original time sequence, the check information can be completely-matched with the receiving end, the data packet can be completely-matched with the data transmission protocol, the data packet can be prevented from being completely-matched with the data transmission path after the receiving end, the data packet can be completely-matched with the data packet, and the data can be completely-transmitted to the data packet by the data transmission channel 32, and the data can be completely-matched with the data packet, and the data packet has the data transmission format.
The method comprises the steps of firstly carrying out optimization processing on a data packet after unidirectional transmission, which is adaptive to a video frame, based on an optimal transmission strategy, and then sending the data packet after the optimization processing to a receiving end service, wherein the optimization processing on the data packet after the unidirectional transmission, which is adaptive to the video frame, comprises the steps of inquiring the upper limit of the real-time available bandwidth of the link between the API interface camera end service and the receiving end service by the camera end service, inquiring the preset optimal transmission strategy to determine a current optimal transmission mode if the upper limit of the real-time available bandwidth of the link is smaller than a preset value, wherein the optimal transmission mode is one of the optimal transmission modes, namely mode 1, carrying out appropriate discarding or degrading transmission on a non-key video frame by preferentially transmitting the key video frame, and setting a key video frame and the non-key video frame for the video frame when the data packet is packaged, mode 2, carrying out the optimization processing on the data packet after the unidirectional transmission, which is adaptive to the associated with the video frame, and the bit rate of the associated receiving end service is adaptive to the video frame, and the bit rate of the associated data stream is larger than the upper limit of the real-time available bandwidth of the link is smaller than the upper limit of the real-time available bandwidth of the link, and the bit rate of the associated data is smaller than the upper limit of the real-time available data is adjusted, and the data is smaller than the real-time associated with the upper limit of the data.
The method comprises the steps of firstly carrying out optimization processing on the data packet after unidirectional transmission, which is based on an optimal transmission strategy, and then sending the data packet after unidirectional transmission to the receiving end service, wherein the optimization processing on the data packet after unidirectional transmission, which is based on the optimal transmission strategy, comprises the steps of inquiring the link delay between the API interface camera head end service and the receiving end service by the camera head end service, inquiring the preset optimal transmission strategy to determine a current optimization transmission mode if the link delay is larger than a preset value, wherein the optimization transmission mode is one of a mode 1, wherein key video frames are preferentially transmitted, non-key video frames are appropriately discarded or degraded for transmission, and the frame-level packaging comprises setting key video frames and non-key video frames for the video frames, a mode 2, and adaptively adjusting the bit rate of the received video data stream data, which is associated with the receiving end service information, so that the bit rate of the received data stream is associated with the bit rate of the video frames, and the bit rate of the data stream, and a mode 3, wherein the bit rate of the data stream is associated with the bit rate of the video frames, and the bit rate of the data stream after the data stream is associated with the bit rate, or the bit rate of the data stream is adjusted to be associated with the bit rate of the data stream, and the data of the data with the bit rate, or the data of the data stream, which is associated with the bit rate, or the bit rate is adjusted.
Optionally, the method further comprises detecting link jitter between the camera end service and the receiving end service in real time and providing a query API interface for the camera end service to call, wherein the link jitter refers to time difference between multiple transmissions; the method comprises the steps of firstly carrying out optimization processing on the data packet after the unidirectional transmission is adapted based on an optimal transmission strategy and then sending the data packet after the optimization processing to the receiving end service, wherein the optimization processing on the data packet after the unidirectional transmission is adapted based on the optimal transmission strategy comprises the steps of obtaining link jitter of a unidirectional gateway, inquiring the preset optimal transmission strategy to determine a current optimal transmission mode if the link jitter of the unidirectional gateway is larger than a preset value, wherein the optimal transmission mode is one of the following optimal transmission modes, namely, mode 1, preferentially transmitting key video frames and carrying out proper discarding or degrading transmission on non-key video frames, wherein the use of frame-level encapsulation comprises setting key video frames and non-key video frames for the video frames, mode 2, self-adaptively adjusting the bit rate of video data stream data after the received associated receiving end service information so that the bit rate is inversely related to the link jitter of the unidirectional gateway, and mode 3, self-adaptively adjusting the frame or resolution of the video data stream data after the associated receiving end service information so that the frame or resolution is inversely related to the link jitter of the unidirectional gateway.
Optionally, the method further comprises the step of performing RTSP video reception in a unidirectional gateway environment through a receiving end service comprising a video receiving and decoding module, a packet loss repairing module and a video reconstructing and playing module:
monitoring data flow from unidirectional gateway in real time and continuously through video receiving and decoding module, after receiving data, carrying out integrity check on the data, de-packaging according to the engineering label of unidirectional gateway protocol, and reorganizing the data according to fragment sequence information;
the packet loss repairing module is used for repairing and reconstructing data by using redundant coded error correction information so as to fill transmission gaps caused by unstable network, ensure that packet loss caused by network fluctuation in the unidirectional transmission process can be effectively repaired, and ensure the integrity of video and the stability of video during playing;
And processing the reconstructed video stream through a video reconstruction and play module, synchronously processing and formatting the decoded audio and video data, and flowing to a designated output path according to a preset configuration.
Optionally, the repairing and reconstructing the data by using the redundancy-encoded error correction information through the packet loss repairing module includes detecting a packet loss rate of the data by using the redundancy-encoded error correction information through the packet loss repairing module, repairing the lost data packet by directly using the redundancy-encoded error correction information if the packet loss rate is smaller than a preset threshold, otherwise, repairing the data packet corresponding to the key video frame by preferentially using the redundancy-encoded error correction information for the key video frame and the non-key video frame in the data packet, processing the reconstructed video stream through the video reconstruction and playing module, synchronizing and formatting the decoded audio and video data, performing at least one of image enhancement and noise reduction on the video data in the decoded audio and video data according to a preset configuration flow, wherein the image enhancement includes adjusting the color and saturation of the video image, the noise reduction includes identifying a dynamic region and a static region of the video image frame according to the adjacent video image frame, wherein the dynamic region refers to a region where a change occurs in the adjacent video image frame, the static region refers to a region where the adjacent video frame remains, and the noise reduction region is more stable than the dynamic region and the dynamic region has a higher noise reduction degree.
In addition, the invention also provides an RTSP video transmission system in the unidirectional gateway environment, which comprises a microprocessor and a memory which are connected with each other, wherein the microprocessor is programmed or configured to execute the RTSP video transmission method in the unidirectional gateway environment.
Furthermore, the present invention also provides a computer readable storage medium having stored therein a computer program or instructions programmed or configured to execute the RTSP video transmission method in the unidirectional gateway environment by a processor.
Furthermore, the present invention provides a computer program product comprising a computer program or instructions programmed or configured to execute the RTSP video transmission method in a unidirectional gateway environment by a processor.
Compared with the prior art, the invention has the following advantages:
1. The method of the invention prevents various reverse attacks and information leakage of the internal and external networks by the physical unidirectional gateway and the encryption transmission method on the link, and has high security.
2. According to the method, the receiving end can automatically repair packet loss under network oscillation in a scene of a unidirectional gateway link through a forward error correction technology, so that the integrity of a data video is ensured, and the high fault tolerance is realized.
3. The method of the invention improves the efficiency of audio and video data transmission and reduces the transmission delay by the high-efficiency video compression technology and the detection control of the data flow in the link.
4. The system is suitable for various monitoring scenes needing high safety, such as environments of military, government facilities, nuclear power stations, airport monitoring and the like, and has wide adaptability.
Detailed Description
In the following, taking a certain monitoring scenario shown in fig. 1, a camera is deployed in a high security area, and camera data is transmitted from an external network to an internal network through a unidirectional gateway for playing, for example, a further detailed description is made on an RTSP video transmission system in the unidirectional gateway environment of the present invention. The basis of this embodiment is a physical machine running the Linux system.
As shown in fig. 2 and fig. 3, the present embodiment provides an RTSP video transmission method in a unidirectional gateway environment, which includes performing RTSP video transmission in the unidirectional gateway environment through a camera head end service including a client module, a data redundancy encoding module, a policy management module, and a video stream packaging and transmitting module:
An RTSP client is constructed through a client module, a request is actively sent to a camera serving as an RTSP server, and data stream transmission is started through an instruction, so that a real-time compression-encoded audio and video stream is obtained;
The data redundancy coding module performs redundancy coding on the video stream data and adds error correction information (specifically, in the embodiment, forward error correction (FFC) coding is adopted to add error correction information, namely redundancy information, and other redundancy coding modes can be adopted according to requirements), so that the receiving end service can automatically repair lost data packets through the redundancy information to ensure the integrity of the video stream even if feedback cannot be performed;
The method comprises the steps that a link relation between a camera and a receiving end service is managed through a strategy management module, and associated receiving end service information is attached to a redundant coded audio and video stream so that a single camera end service can be abutted to one or more receiving end services;
And packaging the video data after the received associated receiving end service information by a video stream packaging and sending module, packaging according to a data packet transmission format constrained by the unidirectional gateway, carrying out appointed coding processing on header information, check information and a fragment sequence of the data packet, and transmitting the finally generated data packet to the unidirectional gateway to be sent to the receiving end service.
As shown in fig. 2, in this embodiment 1) a camera end service is deployed on a front end sending device host a of an external network in advance, a receiving end service is deployed on a rear end receiving device host B of the internal network, where the camera end service is configured to receive data sent by an external network camera application, process the data and transmit the processed data to a unidirectional gateway, the receiving end service is configured to receive the data of the unidirectional gateway and transmit the processed data to a video player or a rear end storage service, and the front end sending device host a and the rear end receiving device host B create a sending and receiving directory of the camera and the video player through a directory creation API interface provided by a policy management module, and create an interworking relationship between the camera and the video player through the policy creation API interface, where the camera end service includes a client module, a data redundancy encoding module, a policy management module, a video stream packaging and sending module, and the receiving end service includes a video receiving and decoding module, a packet loss repairing module, a video rebuilding and playing module, and the like.
In this embodiment, after a client module of the camera end service monitors that an interworking relationship creation action including a camera directory and a response exists, an RTSP server IP and a port of the camera are confirmed through the camera directory, an RTSP client is created, a request is initiated to the RTSP server of the camera, and after a streaming media resource description of the camera is acquired, a data stream is started by using an instruction. The corresponding data of the RTSP server (camera) comprises the description and transmission information of real-time data stream data, and the real-time compression encoded audio and video stream is obtained from the data stream, and the obtained audio and video stream data is sent to the data redundancy encoding module.
In this embodiment, after the data redundancy encoding module receives the audio and video data transmitted by the previous module, forward error correction processing is performed on the audio and video data, and redundant information is generated to correspond to the packet loss condition, so that the receiving end service can automatically repair the lost data packet through the redundant information even if feedback cannot be performed, and the integrity of the video stream is ensured. The module adopts a standard Reed-Solomon algorithm to balance bandwidth consumption and redundancy and adapt to network fluctuation in unidirectional transmission. The final module sends the data after the redundant coding to the video stream packaging and sending module;
In the embodiment, the video data after the received associated receiving end service information is packed by a video stream packing and sending module, the packing processing is carried out according to the data packet transmission format constrained by the unidirectional gateway, appointed coding processing is carried out on header information, check information and a slice sequence of the data packet, the finally generated data packet is transmitted to the unidirectional gateway to be sent to the receiving end service, the video data after the received associated receiving end service information is sliced by fixed size, the data with the fixed length is not completed by 0, the slice sequence number and the total slice number are added to each slice data, so that the original data can be recombined at the receiving end, the slice sequence is carried out in each frame, partial pictures can be restored at the frame level even if partial slices are lost, the influence on fluency is reduced, the data packet after the slicing is added, the header information containing time stamp, the frame number, the stream ID and the packet ID is assisted by the time stamp information, the receiving end can play according to the original time sequence, thereby preventing the influence of the data packet from being disordered or network delay, the data with 0 complement, the data packet can be completely received by the receiving end, the data packet can be completely received by the unidirectional gateway, the check data packet can be completely received by the feedback protocol, the data packet can be completely received by the receiving end, the data packet can be completely received by the data, and the data has the data packet, and the data has the full data. Through the specific coding processing, the integrity and the reconfigurability of the data can be guaranteed even if no feedback link exists in the network in time.
In the embodiment, when the data packet after the adaptive unidirectional transmission is sent to the receiving end service, the method comprises the steps of firstly carrying out optimization processing on the data packet after the adaptive unidirectional transmission based on an optimal transmission strategy, and then sending the data packet after the optimization processing to the receiving end service, wherein a video stream packaging and sending module inquires a strategy rule designed in the audio and video data transmission process by calling a strategy inquiry API interface, and the strategy rule comprises gateway path information, maximum allowable delay, jitter threshold and the like which are passed by the camera data to an intranet player. And confirming the real-time available bandwidth upper limit of the link by calculating and processing the historical bandwidth data of the path designated in the policy rule and the real-time network information. Based on the value of the upper limit of the real-time available bandwidth of the link, under the condition that the available bandwidth of the link is 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 degraded for transmission, or video coding bit rate is adaptively adjusted, the frame rate or resolution is reduced to adapt to the current bandwidth state, dynamic adjustment is performed based on real-time traffic feedback, and the continuity of the basic video stream is ensured. Meanwhile, the system can detect the delay condition of a real-time link, set a maximum allowable delay and a jitter threshold, timely search the link delay which affects the fluency and the real-time performance of the video stream in the link, preferentially transmit key frames in the link with higher delay or frequent jitter, and adopt degradation or frame skipping treatment on other frames to ensure the decodability and definition of video content. And ensuring that the video data transmission accords with the optimal transmission strategy of the current link based on the strategy, bandwidth, delay, flow delay and other information, and finally transmitting the processed data to the unidirectional gateway.
The method further comprises the steps of detecting the real-time available bandwidth upper limit of a link between the camera head end service and the receiving end service in real time and providing an inquiry API interface for the camera head end service to call, wherein the optimized processing of the data packet after the unidirectional transmission is carried out based on an optimal transmission strategy, the method comprises the steps of inquiring the real-time available bandwidth upper limit of the link between the camera head end service and the receiving end service by the API interface, inquiring the preset optimal transmission strategy to determine a current optimized transmission mode if the real-time available bandwidth upper limit of the link is smaller than a preset value, the optimized transmission mode is one of the optimized transmission modes, namely, 1, preferentially transmitting key video frames and carrying out proper discarding or degrading transmission on non-key video frames, and when frame-level encapsulation is used, setting key video frames and non-key video frames for the video frames, 2, adaptively adjusting the bit rate of received video data stream data after associated receiving end service information so that the bit rate is positively correlated with the real-time available bandwidth upper limit of the link, and 3, adaptively adjusting the frame resolution or the available bandwidth upper limit of the video stream data after the associated receiving end service information is positively correlated with the real-time resolution.
The method further comprises the steps of detecting link delay between camera head end service and receiving end service in real time and providing an inquiry API interface for the camera head end service to call, wherein the step of optimizing the data packet after the unidirectional transmission is adapted based on the optimal transmission strategy comprises the steps of inquiring the link delay between the camera head end service and the receiving end service by the API interface, inquiring the preset optimal transmission strategy to determine a current optimal transmission mode if the link delay is larger than a preset value, wherein the optimal transmission mode is one of the optimal transmission modes that key video frames are transmitted preferentially and non-key video frames are properly discarded or degraded, setting key video frames and non-key video frames for the video frames when frame-level encapsulation is used, the mode 2 is used for adaptively adjusting the bit rate of video data stream data after the received associated receiving end service information so that the bit rate is inversely related to the link delay of a unidirectional gateway, and the mode 3 is used for adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving end service information so that the frame rate or resolution is inversely related to the link delay of the unidirectional gateway.
The method further comprises the steps of detecting link jitter between the camera-end service and the receiving end service in real time, providing an inquiry API interface for the camera-end service to call, wherein the link jitter refers to time difference between multiple transmissions, performing optimization processing on the data packet after the unidirectional transmission is adapted based on an optimal transmission strategy, wherein the step of acquiring the link jitter of the unidirectional gateway, and if the link jitter of the unidirectional gateway is larger than a preset value, inquiring the preset optimal transmission strategy to determine a current optimal transmission mode, wherein the optimal transmission mode is one of a mode 1, preferentially transmitting a key video frame and performing appropriate discarding or degrading transmission on a non-key video frame, and the step of using frame-level encapsulation comprises setting the key video frame and the non-key video frame for the video frame, the step of adaptively adjusting the bit rate of video data stream data after the associated receiving end service information is received, so that the bit rate is inversely related to the link jitter of the unidirectional gateway, and the step of a mode 3, and the step of adaptively adjusting the frame rate or resolution of the video data stream data after the associated receiving end service information so that the frame rate is inversely related to the bit rate of the link jitter of the unidirectional gateway.
As shown in fig. 2 and fig. 4, the embodiment further 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 playing module:
monitoring data flow from unidirectional gateway in real time and continuously through video receiving and decoding module, after receiving data, carrying out integrity check on the data, de-packaging according to the engineering label of unidirectional gateway protocol, and reorganizing the data according to fragment sequence information;
the packet loss repairing module is used for repairing and reconstructing data by using redundant coded error correction information so as to fill transmission gaps caused by unstable network, ensure that packet loss caused by network fluctuation in the unidirectional transmission process can be effectively repaired, and ensure the integrity of video and the stability of video during playing;
And processing the reconstructed video stream through a video reconstruction and play module, synchronously processing and formatting the decoded audio and video data, and flowing to a designated output path according to a preset configuration.
The video receiving and decoding module of the receiving end service captures the data packet through a special interface, so that the receiving end can acquire the data stream stably and efficiently in a feedback-free network environment. After receiving the data packets of the unidirectional gateway, the video receiving and decoding module performs integrity check on each data packet so as to ensure that the data is not damaged or lost in the transmission process. And the module de-encapsulates the content of the data packet according to the requirements of the unidirectional gateway protocol engineering standard, reorganizes the data according to the information such as the fragment sequence and the like, and then transmits the data to the packet loss repair module.
After receiving the data transmitted by the video receiving and decoding module, the packet loss repairing module monitors and repairs the packet loss phenomenon caused by network fluctuation in real time by using redundant information generated by Forward Error Correction (FEC) coding, thereby effectively improving the integrity of the audio and video stream. Under the condition of no feedback mechanism, redundant data provided by the FEC coding can reconstruct lost data packets at a receiving end, so that the data transmission is more reliable. The packet loss repairing module is used for accurately reorganizing the serial numbers and the redundant information in the packet headers of the data packets after the packet packing is carried out for each frame of video packet in the video packing and transmitting module, meanwhile, a plurality of preset packet loss repairing strategies can be adopted, the lost data packets are repaired directly by using the redundant data under the condition of reduced packet loss rate, when serious packet loss is caused by network fluctuation, the packet loss repairing module skips part of redundant or secondary frames to recover key frames preferentially, so that resource consumption is reduced, transmission gaps caused by unstable network are filled, and continuity of video data is ensured. In addition, the module can still ensure the complete presentation of the video content under the condition of higher network jitter, so that the video is prevented from being blocked or lost during playing, and the stability of the whole transmission system and the smoothness of playing are further improved. And finally, the packet loss repair module transmits the recombined and repaired data packet to the video reconstruction and play module. In the embodiment, the repairing and reconstructing of the data by using the redundancy-coded error correction information through the packet loss repairing module comprises the steps of detecting the packet loss rate of the data by using the redundancy-coded error correction information through the packet loss repairing module, repairing the lost data packet by directly adopting the redundancy-coded error correction information if the packet loss rate is smaller than a preset threshold value, and repairing the data packet corresponding to the redundancy-coded error correction information by preferentially adopting the redundancy-coded error correction information if the packet loss rate is smaller than the preset threshold value, otherwise, repairing the data packet corresponding to the key video frame by aiming at the key video frame and the non-key video frame in the data packet.
In this embodiment, the video reconstruction and playing module processes the video stream after the reconstruction, performs synchronization processing and formatting on the decoded audio and video data, performs at least one of image enhancement and noise reduction on the video data in the decoded audio and video data when the decoded audio and video data flows to a designated output path according to a preset configuration, wherein the image enhancement includes adjusting the color and saturation of a video image, the noise reduction includes identifying a dynamic region and a static region of the video image frame according to adjacent video image frames, the dynamic region refers to a region where a change occurs in the adjacent video image frames, the static region refers to a region where a change remains in the adjacent video image frames, and different noise reduction filter parameters are adopted for the dynamic region and the static region, so that the noise reduction strength of the dynamic region is smaller, the noise reduction strength of the static region is larger to enhance the stability of the video image frames, and the quality and the definition of the video stream are ensured. 7) After the video reconstruction and playing module finishes decoding the received video stream, the video reconstruction and playing module synchronously processes and formats the decoded audio and video data, and reconstructs the video stream into a standard format meeting the requirements of playing equipment or storage equipment. The module not only executes basic video decoding, but also comprises post-processing functions such as image enhancement, noise reduction and the like, wherein color information is adaptively adjusted by using color and saturation adjusting functions according to video content, so that the color expression of the video is more vivid, filter parameters are dynamically adjusted based on video frame content, different noise environments are adapted, if a high motion area is detected, noise reduction intensity is reduced, so that blurring of pictures is prevented, noise reduction intensity is increased in a static area, image stability is enhanced, and the quality and definition of a video stream are ensured to meet user requirements. The reconstructed video data flows to different output paths according to preset configuration, such as real-time playing equipment, a network live broadcast platform or a local/cloud storage device, so as to support video use requirements in different scenes. For a real-time playing scene, the module can automatically optimize playing parameters according to the refresh rate and the resolution of the equipment, so that smooth and no jamming of pictures is ensured. For storage requirements, the module adjusts the video data according to the compression ratio and the resolution ratio, and ensures the quality of the video while maximizing the utilization of the storage space. The module finally realizes stable output of video data, so that a user can obtain high-quality viewing experience under various playing environments.
In summary, the RTSP video transmission method in the unidirectional gateway environment of the present embodiment includes a camera end service and a receiving end service. The method comprises the steps of deploying camera end service on a front-end sending host server in advance, deploying receiving end service on a back-end receiving host device, wherein the camera end service comprises a client module, a data redundancy coding module, a strategy management module, a video stream packaging and sending module and the like, and the receiving end service comprises a video receiving and decoding module, a packet loss repairing module, a video reconstruction and playing module and the like. The camera head end service firstly builds an RTSP client through a client module to actively initiate a transmission request to an RTSP server of a camera, transmits acquired audio and video data to a data redundancy coding module to carry out redundancy coding, repairs data lost in a network oscillation process through redundancy information under the condition that a link is not fed back by adding error correction information and other modes, confirms a data transmission link through a strategy management module, and finally encapsulates and fragments the data through a video stream packaging and transmitting module and transmits the data to a unidirectional gateway according to a designated protocol label. The receiving end module receives the encapsulated data through the video receiving and decoding module, then de-encapsulates and reassembles the data, repairs and rebuilds the damaged data through the packet loss repairing module by utilizing the redundant data, and finally, the video rebuilding and playing module processes the decoded data and then flows to different output paths according to preset configuration. The method of the embodiment solves the problems that under the condition that a unidirectional network environment has no reverse link, reliable transmission and playing of video data are guaranteed, meanwhile fault tolerance is carried out on the unstable condition of the network through an error correction technology, the integrity of the data is guaranteed, and through a video compression technology and data flow detection control, the stability of the link is guaranteed, meanwhile, the video transmission efficiency is improved, and the transmission delay is reduced. The system is suitable for various monitoring factories needing high security, and has wide applicability. According to the RTSP video transmission system in the unidirectional gateway environment, a physical machine running a Linux system is used as a basis, camera head end and receiving end services are deployed on the physical machine, various reverse attacks and information leakage of an internal network and an external network are prevented through the physical unidirectional gateway, the safety of a network is enhanced, automatic restoration and recombination are carried out according to the conditions of packet loss and the like under the condition of network oscillation through a forward error correction technology, the continuity and reliability of video data are improved, and the high fault tolerance of the system is guaranteed. By means of efficient video compression technology and detection control of data flow of a link, data transmission efficiency is improved, stability is guaranteed, and data transmission time delay is reduced.
In addition, the embodiment also provides an RTSP video transmission system in a unidirectional gateway environment, which comprises a microprocessor and a memory which are connected with each other, wherein the microprocessor is programmed or configured to execute the RTSP video transmission method in the unidirectional gateway environment.
Furthermore, the present embodiment also provides a computer-readable storage medium having stored therein a computer program or instructions programmed or configured to execute the RTSP video transmission method in the unidirectional gateway environment by a processor.
Furthermore, the present embodiment provides a computer program product comprising a computer program or instructions programmed or configured to execute the RTSP video transmission method in the unidirectional gateway environment by a processor.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided in the form of a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present 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, and the like) having computer-usable program code embodied therein. The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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 means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks. 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 such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above examples, and all technical solutions belonging to the concept of the present invention belong to the protection scope of the present invention. It should be noted that modifications and adaptations to the present invention may occur to one skilled in the art without departing from the principles of the present invention and are intended to be within the scope of the present invention.