Disclosure of Invention
In view of the foregoing problems in the prior art, embodiments of the present invention provide a video image plug flow system and device.
In a first aspect, an embodiment of the present invention provides a video image plug flow system, including: the video coding module is used for compressing the acquired real-time image; the video stream transmission module is used for transmitting the real-time image compressed by the video coding module; and the video decoding module is used for decoding the real-time image which is transmitted by the video streaming transmission module and compressed by the video coding module.
On the basis of the content of the above system embodiment, the video image plug flow system provided in the embodiment of the present invention compresses the acquired real-time image, and includes: and compressing the acquired real-time image into a standard h264 code stream.
On the basis of the content of the above system embodiment, the video image plug flow system provided in the embodiment of the present invention compresses the acquired real-time image, and includes: compressing each image into zip code stream, adding packet header and control protocol.
On the basis of the content of the above system embodiment, the video image stream pushing system provided in the embodiment of the present invention, where the real-time image compressed by the video encoding module is transmitted, includes: and transmitting the standard h264 code stream by adopting an rtsp protocol.
On the basis of the content of the above system embodiment, the video image stream pushing system provided in the embodiment of the present invention, where the real-time image compressed by the video encoding module is transmitted, includes: and transmitting the zip-format code stream by adopting a 3-time packet loss retransmission mechanism in the udp mode.
On the basis of the content of the above system embodiment, the video image stream pushing system provided in the embodiment of the present invention, decoding the real-time image transmitted by the video stream transmission module and compressed by the video encoding module, includes: and decoding the standard h264 code stream by adopting an h264 decoder.
On the basis of the content of the above system embodiment, the video image stream pushing system provided in the embodiment of the present invention, decoding the real-time image transmitted by the video stream transmission module and compressed by the video encoding module, includes: and decoding the zip-format code stream by adopting a zip decompression mode.
In a second aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the video image plug flow system provided by any of the various implementations of the first aspect.
In a third aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to implement the video image plug flow system provided in any one of the various implementations of the first aspect.
According to the video image stream pushing system and the video image stream pushing equipment, the video coding module, the video stream transmission module and the video decoding module are integrated, so that multiple image transmission modes can be supported simultaneously, most video transmission application scenes are met, the integrity of information is effectively guaranteed, and the transmission quantity of data is remarkably reduced.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. In addition, technical features of various embodiments or individual embodiments provided by the present invention may be arbitrarily combined with each other to form a feasible technical solution, and such combination is not limited by the sequence of steps and/or the structural composition mode, but must be realized by a person skilled in the art, and when the technical solution combination is contradictory or cannot be realized, such a technical solution combination should not be considered to exist and is not within the protection scope of the present invention.
To obtain a video compression, transmission, decoding technique. While ensuring high image quality, reducing data storage and transmission capacity, and using advanced hardware functions as much as possible to accelerate video encoding/decoding speed, an embodiment of the present invention provides a video image stream pushing system, see fig. 1, which includes: the video coding module is used for compressing the acquired real-time image; the video stream transmission module is used for transmitting the real-time image compressed by the video coding module; and the video decoding module is used for decoding the real-time image which is transmitted by the video streaming transmission module and compressed by the video coding module.
Based on the content of the foregoing system embodiment, as an optional embodiment, the video image plug flow system provided in the embodiment of the present invention compresses the acquired real-time image, including: and compressing the acquired real-time image into a standard h264 code stream.
Based on the content of the foregoing system embodiment, as an optional embodiment, the video image plug flow system provided in the embodiment of the present invention compresses the acquired real-time image, including: compressing each image into zip code stream, adding packet header and control protocol.
Based on the content of the foregoing system embodiment, as an optional embodiment, the video image stream pushing system provided in the embodiment of the present invention, where the transmitting of the real-time image compressed by the video encoding module includes: and transmitting the standard h264 code stream by adopting an rtsp protocol.
Based on the content of the foregoing system embodiment, as an optional embodiment, the video image stream pushing system provided in the embodiment of the present invention, where the transmitting of the real-time image compressed by the video encoding module includes: and transmitting the zip-format code stream by adopting a 3-time packet loss retransmission mechanism in the udp mode.
Based on the content of the foregoing system embodiment, as an optional embodiment, the video image stream pushing system provided in the embodiment of the present invention, where decoding a real-time image transmitted by a video stream transmission module and compressed by a video encoding module includes: and decoding the standard h264 code stream by adopting an h264 decoder.
Based on the content of the foregoing system embodiment, as an optional embodiment, the video image stream pushing system provided in the embodiment of the present invention, where decoding a real-time image transmitted by a video stream transmission module and compressed by a video encoding module includes: and decoding the zip-format code stream by adopting a zip decompression mode.
Based on the content of the above system embodiment, as an optional embodiment, reference may be made to fig. 3 for a process related to h264 code stream transmission in the video image stream pushing system provided in the embodiment of the present invention. In fig. 3, the video encoding module is configured to compress the acquired real-time image (RGBA image data) into a standard h264 code stream. The h264 code stream is used for common video monitoring and video analysis scenes; the video stream transmission module is used for transmitting the h264 code stream (h264 compressed data) by adopting an rtsp protocol (rtsp code stream); and the video decoding module is used for decoding the h264 code stream by adopting an h264 decoder to obtain RGBA image data and realize image decoding.
Based on the content of the foregoing system embodiment, as an alternative embodiment, the transmission process of the lossless compressed image data in the video image plug flow system provided in the embodiment of the present invention may be referred to fig. 4. In fig. 4, the video encoding module is configured to compress the acquired real-time images (X16/Y16 image data) into a self-defined lossless compression format (mainly a zip encoding format), where the self-defined lossless compression format employs a zip compression (zip encoding) mode to compress each image to obtain zip compressed data, and add a packet header and a control protocol, and the video encoding module is mainly used for scenes with high requirements on image quality, such as scenes with infrared temperature measurement, where information loss cannot occur; the video stream transmission module adopts a udp data stream mode to carry out video transmission and uses a 3-time packet loss retransmission mechanism; the video decoding module decodes the image by means of zip decompression (zip decoding) to obtain X16/Y16 image data.
The operation flow of the video image plug flow system provided by the embodiment of the invention is as follows: acquiring a real-time image through an SDK provided by acquisition equipment; and selecting the h264 video code stream or the self-defined lossless compression code stream according to the actual application condition. When the h264 video code stream is selected, an h264 encoder is adopted to encode the acquired RGBA image data, then video transmission is carried out through an rtsp protocol, and after the h264 code stream is received by a receiving end, an h264 decoder is adopted to decompress the code stream into RGBA image data. The implementation scheme is implemented by adopting optimized and tailored ffmpeg + live555, and both ffmpeg and live555 are open source video processing items. When a user-defined lossless compression code stream is selected, a zip compression mode is adopted to compress single-frame image data, then the compressed data is transmitted in a udp data stream mode, a receiving end receives the block compressed data, then the compressed image is formed again, and lossless original image data is obtained in a zip decompression mode. And a user-defined control protocol is adopted in the Udp data stream transmission process, and the whole compressed image is discarded after 3 times of retransmission failures. In a local area network, a communication link is generally excellent, and a 3-time retransmission mechanism can acquire complete lossless compression image data at a large rate.
The video image stream pushing system provided by the embodiment of the invention can simultaneously support multiple image transmission modes by integrating the video coding module, the video stream transmission module and the video decoding module, meets most video transmission application scenes, effectively ensures the integrity of information and obviously reduces the transmission quantity of data.
The video image plug flow system provided by the embodiment of the invention simultaneously supports a standard h264+ rtsp image transmission mode, and conforms to most video transmission application scenes; the integrity of information can be effectively ensured by self-defining a lossless compression image transmission technology; compared with the traditional uncompressed data transmission, the data volume is greatly reduced.
The system of the embodiment of the invention is realized by depending on the electronic equipment, so that the related electronic equipment is necessarily introduced. To this end, an embodiment of the present invention provides an electronic apparatus, as shown in fig. 2, including: at least one processor (processor)201, a communication Interface (communication Interface)204, at least one memory (memory)202 and a communication bus 203, wherein the at least one processor 201, the communication Interface 204 and the at least one memory 202 are configured to communicate with each other via the communication bus 203. The at least one processor 201 may invoke logic instructions in the at least one memory 202 to implement the various systems provided in the system embodiments.
Furthermore, the logic instructions in the at least one memory 202 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be substantially implemented or contributed to by the prior art, or the technical solution may be implemented in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the system according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to implement the methods or systems of the various embodiments or some parts of the embodiments.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. Based on this recognition, each block in the flowchart or block diagrams may represent a module, a program segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In this patent, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.