Video hardware coding and decoding and video forwarding method based on local deploymentTechnical Field
The invention relates to the technical field of data processing, in particular to a video hardware coding and decoding and video forwarding method based on local deployment.
Background
The existing mainstream cloud technology for the video of the camera (such as a monitoring camera) is mainly characterized in that the camera is connected with a video cloud platform. The cloud technology has the following disadvantages due to technical limitations: (1): the cameras are connected with the video cloud platform and need to be registered, corresponding parameters are configured for each camera, professional personnel are needed to operate the cameras, and the cameras cannot be used after being unpacked. (2): the camera on the cloud end needs to access the external network and keeps long connection with the cloud platform all the time. (3) When the client plays the video, the number of people watching the video on line is limited. (4): the locally deployed hardware only provides a video forwarding function and cannot operate the camera in the local area network. (5): the video playing format has certain limitation; the mainstream playback format is not covered. (6): the existing cloud service on the video cannot provide a visual interface.
Disclosure of Invention
In order to overcome the defects of the prior art of the cloud end on the camera video, such as background defects, the invention provides a local deployment-based video hardware encoding and decoding and video forwarding method which adopts a local hardware deployment mode under the combined action of corresponding module units, provides a video intranet penetration technology, breaks the limitation of a closed local area network, can realize the characteristic of using after opening a box only by accessing a power supply and a network, can concurrently push at least 15 paths of local area network video streams, and can achieve the purposes of realizing compatible mainstream video playing formats, video history playback, automatic cut-off, memory management, image quality switching, product visual management interfaces and convenient user interaction and has powerful technical support.
The technical scheme adopted by the invention for solving the technical problems is as follows:
the video hardware coding and decoding and video forwarding method based on local deployment is characterized in that a video access unit, a hard decoding unit, an FFMPEG stream pushing unit, a video forwarding unit, a video playing unit and a main control unit are used as video decoding and forwarding tools; the video access unit, the hard decoding unit, the FFMPEG stream pushing unit, the video forwarding unit, the video playing unit and the main control unit are application software installed in an ARM processor platform; the video hardware coding and decoding and video forwarding method comprises the following steps: a user initiates a video playing request through a video access unit; step two: after the video access unit is connected with the video equipment, the main control unit calls a hard decoding unit to perform hardware decoding and encoding operations on data transmitted by the camera; step three: after the FFMPEG stream pushing unit transmits the obtained data stream from the hard decoding unit, setting stream pushing timeout time, memory cache size, decoding parameters and the like, and finally performing stream pushing operation in an RTMP mode; step four: the video forwarding unit receives the stream pushing data obtained from the FFMPEG stream pushing unit, encodes the same data to obtain different playing formats, and provides more than 1000 stream pulling services and visual interface management; step five: after the Video playing unit initiates a Video playing request, the main control unit returns a playing link within a specified time interval, and through the link, a user can play in a corresponding Video player or a webpage embedded with a Video tag.
Further, in the first step, after the user initiates a video playing request, the video access unit queries a camera to be played in an RTSP streaming manner, and if the camera is not online, directly returns that the playing is failed, otherwise, directly establishes a local area network connection.
Furthermore, in the second step, on the premise of ensuring the image quality, the decoding and encoding speed of the video can be greatly improved, and the encoding and decoding capability of processing data signals input by at least 15 paths of cameras is realized.
Furthermore, in the third step, the FFMPEG stream pushing list can call multiple processes and multiple threads to push the data, so as to achieve the effect of video stream concurrence.
Further, in the fourth step, the video forwarding unit uses a video server framework developed by pure C + +, which encodes the same data, and the obtained playing format includes WEBRTC, FlV, and HLS.
The invention has the beneficial effects that: the invention adopts a mode of locally deploying hardware, provides a video intranet penetration technology under the combined action of related unit modules, breaks the limitation of a closed local area network, and can realize the characteristic of being used after opening the box only by accessing a power supply and a network. The invention has the following advantages: at least 15 paths of local area network video streams are pushed concurrently, so that better monitoring effects such as cameras can be realized; providing a mainstream video playing format, wherein the delay of the WebRtc format is only 1 second, and the requirement that playing equipment of various systems plays videos can be met; the system can provide functions of history playback, automatic flow cutoff, memory management, image quality switching and the like, can provide a product visual management interface, is convenient for user interaction, and brings more convenience to users. Based on the above, the invention has good application prospect.
Drawings
FIG. 1 is a block diagram illustration of the architecture of the present invention.
Detailed Description
As shown in fig. 1, based on a locally deployed video hardware encoding and decoding and video forwarding method, a video access unit, a hard decoding unit, an FFMPEG stream pushing unit, a video forwarding unit, a video playing unit, and a main control unit are used as video decoding and forwarding tools; the video access unit, the hard decoding unit, the FFMPEG stream pushing unit, the video forwarding unit, the video playing unit and the main control unit are application software installed in an ARM processor platform.
As shown in fig. 1, the video hardware encoding and decoding and video forwarding method includes the following steps: a user initiates a video playing request through terminal equipment (such as a PC), an instruction enters a video access unit first, a camera needing to be played is inquired in an RTSP streaming mode, if the camera is not on line, playing failure is directly returned, and if not, local area network connection is directly established. Step two: after the user terminal equipment is connected with the video access unit, the main control unit calls the hard decoding unit to perform hardware decoding and encoding operations on data transmitted by the camera, and the hard decoding unit can greatly improve the decoding and encoding speed of the video on the premise of ensuring the image quality after processing the data, so that the video coding and decoding capability of processing at least 15 paths of camera videos is realized. Step three: after the hard decoding unit transmits the obtained video data stream, the main control unit calls an FFMPEG stream pushing unit command, sets stream pushing overtime time, memory cache size, decoding parameters and the like, and finally carries out stream pushing operation in an RTMP mode. Step four: the stream pushing data obtained by the FFMPEG unit is received by the video forwarding unit, and a video server framework developed by pure C + + is used in the video forwarding unit, which can encode the same data while receiving a video data stream to obtain different playing formats, for example: WEBRTC, FlV, HLS, etc., while providing at least 1000 pull services and visual interface management. Step five: after the user initiates a request, the main control unit controls the Video playing unit to return a playing link in a specified time interval, and through the link, the user can play in a corresponding Video player or a webpage embedded with a Video tag.
As shown in fig. 1, the present invention provides a video intranet penetration technology under the combined action of related unit modules by adopting a local hardware deployment manner, and breaks the limitation of a closed local area network, and the cameras are connected to a video cloud platform without registration, and each camera does not need to be configured with corresponding parameters, and does not need to be operated by professional personnel, and can realize the characteristics of being used after opening a box only by accessing a power supply and a network. The invention also has the following advantages: the camera on the upper cloud end does not need to access an external network and keep long connection with a cloud platform, and pushes a local area network video stream for at least 15 paths, so that when the client plays a video, the number of people watching the video on line is not limited, and better monitoring effects such as the camera can be realized; the method comprises the steps of providing a mainstream video playing format, wherein the delay of the WebRtc format is only 1 second, so that the requirement that playing equipment of various systems plays videos can be met, and a camera in a local area network can be operated; the system can provide functions of history playback, automatic flow cutoff, memory management, image quality switching and the like, can provide a product visual management interface, is convenient for user interaction, and brings more convenience to users.
While there have been shown and described what are at present considered the fundamental principles and essential features of the invention and its advantages, it will be apparent to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, but is capable of other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.
Furthermore, it should be understood that although the present description refers to embodiments, the embodiments do not include only one independent technical solution, and such description is only for clarity, and those skilled in the art should take the description as a whole, and the technical solutions in the embodiments may be appropriately combined to form other embodiments that can be understood by those skilled in the art.