Video processing method, device, electronic device and storage medium
By matching the corresponding relationship between the decoder and the device identifier, the problem of inconsistent encoding formats of video recording devices in different warehouses is solved, and unified playback and stable monitoring of surveillance videos are realized.
Patent Information
- Application Number
- CN202211139830.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-09-19
AI Technical Summary
The encoding formats of surveillance video recording devices in different warehouses are different, which makes it difficult for the platform to decode video streams of different encoding formats during playback, affecting the unified playback of surveillance videos.
By receiving the playback request from the video recording device, matching the corresponding decoder for decoding, and establishing a correspondence relationship between the decoder and the device identification to ensure that only video data is sent in the future, and if necessary, the version is upgraded to uniformly encode the version.
It realizes effective decoding and playback of video streams of different encoding formats, achieves the purpose of monitoring each warehouse environment, and improves the stability and efficiency of video playback.
Smart Images

Figure CN115914678B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video processing, and in particular, to a video processing method, apparatus, electronic device, and storage medium. Background Art
[0002] In actual business, the platform needs to access the monitoring video data from multiple warehouses. Due to different warehouse management, the video recording devices (i.e., cameras) in the purchased warehouses are different, which leads to different encoding formats of the video streams recorded by the cameras. If the monitoring videos of different warehouses are played on the platform, the platform needs to be able to decode the video streams of different encoding formats to achieve playback. Summary of the Invention
[0003] In view of the problems existing in the prior art, the present invention provides a video processing method, apparatus, electronic device, and storage medium.
[0004] In a first aspect, the present invention provides a video processing method, including:
[0005] Receiving a playback request sent by a video recording device, where the playback request includes encoding format information and video data;
[0006] Invoking a decoder corresponding to the encoding format information to decode the video data, and playing the decoded video data.
[0007] In an embodiment, after playing the video data sent by the video recording device for the first time, the method includes:
[0008] Establishing a correspondence relationship between the decoder and the device identifier of the video recording device;
[0009] Correspondingly, invoking a decoder corresponding to the device identifier to decode the video data, and playing the decoded video data.
[0010] In an embodiment, after establishing the correspondence relationship between the decoder and the device identifier, the method further includes:
[0011] Sending a notification message to the video recording device corresponding to the device identifier based on the device identifier, so that the video recording device only sends video data when requesting to play the video for the non-first time.
[0012] In an embodiment, after the decoder fails to decode the video data, the method further includes:
[0013] Analyzing the video data to determine the encoding version of the video data;
[0014] After determining that the encoding version is lower than the decoding version of the decoder, sending a version upgrade file to the video recording device.
[0015] In a second aspect, the present invention provides a video processing device, comprising:
[0016] a receiving module, configured to receive a playback request sent by a video recording device, where the playback request includes encoding format information and video data;
[0017] a processing module, configured to call a decoder corresponding to the encoding format information to decode the video data and play the decoded video data.
[0018] In one embodiment, after playing the video data sent by the video recording device for the first time, the device further includes an establishing module, configured to establish a correspondence between the decoder and the device identifier of the video recording device;
[0019] Correspondingly, the processing module is further configured to call a decoder corresponding to the device identifier to decode the video data and play the decoded video data.
[0020] In one embodiment, after establishing the correspondence between the decoder and the device identifier, the device further includes a notifying module, configured to:
[0021] send a notification message to the video recording device corresponding to the device identifier based on the device identifier, so that when the video recording device requests to play the video for the non-first time, only the video data is sent.
[0022] In one embodiment, after the decoder fails to decode the video data, the device further includes an updating module, configured to:
[0023] analyze the video data to determine the encoding version of the video data;
[0024] after determining that the encoding version is lower than the decoding version of the decoder, send a version upgrade file to the video recording device.
[0025] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the above video processing method when executing the program.
[0026] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above video processing method are implemented.
[0027] A video processing method, device, electronic device and storage medium provided by an embodiment of the present invention match a corresponding decoder through the encoding format information in the playback request, and enable the matched decoder to decode the video data, so as to implement the playback of different video streams by the platform and achieve the purpose of monitoring each warehouse environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0029] Figure 1 It is a flowchart of an embodiment of the video processing method of the present invention;
[0030] Figure 2 It is a structural diagram of an embodiment of the video processing device of the present invention;
[0031] Figure 3 It is a structural diagram of an embodiment of the electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0032] To make the objectives, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the drawings in the present invention. Obviously, the described embodiments are some, but not all, embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention belong to the scope of protection of the present invention.
[0033] The following will be combined with Figures 1-3 Describe the video processing method, device, electronic device and storage medium provided by the present invention.
[0034] Figure 1 The flowchart of a video processing method provided by the present invention is shown. Refer to Figure 1 , the method includes the following steps:
[0035] 11. Receive a playback request sent by a video recording device, where the playback request includes encoding format information and video data;
[0036] 12. Call a decoder corresponding to the encoding format information to decode the video data and play the decoded video data.
[0037] Regarding steps 11 to 12, it should be noted that in the present invention, this method is applicable to video monitoring of multiple warehouse environments. Due to different warehouse management, the video recording devices (i.e., cameras) purchased in the warehouse are different, which leads to different encoding formats of the video streams recorded by the cameras. If the monitoring videos of different warehouses are played on the platform, the platform needs to be able to decode video streams with different encoding formats to achieve playback.
[0038] In the present invention, multiple decoders are stored on the platform, and the decoding function of each decoder corresponds to a unique encoding format. Therefore, when a video recording device as the target needs to play a video, the video recording device will send a play request to the platform, and the play request includes encoding format information and video data. The encoding format information is the encoding format of the encoder in the video recording device. The video data is the picture data recorded by the video recording device for the warehouse environment. Correspondingly, the device identifier will also be marked in the video data.
[0039] After receiving the play request, the platform matches the encoding format information in the play request with the corresponding relationship between the pre-stored encoding format information and the decoder, determines the decoder corresponding to the encoding format information in the play request, calls the decoder to decode the video data, and then plays the decoded video data on the platform to achieve the monitoring of the warehouse environment.
[0040] The video processing method provided by the present invention matches the corresponding decoder through the encoding format information in the play request, and enables the matched decoder to decode the video data, so as to realize the playback of different video streams by the platform and achieve the purpose of monitoring each warehouse environment.
[0041] In a further method of the above method, when the platform plays the video data sent by the video recording device for the first time, the play request received by the platform includes encoding format information and video data, and the encoding format information is used to match a suitable decoder. However, the sending of these two types of information (encoding format information and video data) is likely to cause certain failure situations, such as a synthetic error resulting in an overall error in the play request, or separate sending being out of sync. Therefore, when the platform plays the video data sent by the video recording device for the first time, a corresponding relationship between the decoder and the device identifier of the video recording device can be established. The existence of this corresponding relationship enables the video recording device to apply for playing the video again without sending the encoding format information, but only needs to send the video data. Correspondingly, the platform will determine the device identifier from the video data, match the device identifier in the corresponding relationship to obtain the decoder corresponding to the device identifier, and then play the decoded video data on the platform to achieve the monitoring of the warehouse environment.
[0042] In a further method of the above method, after establishing the correspondence between the decoder and the device identifier, in order to enable the video recording device to only send video data subsequently, the platform needs to send a notification message to the video recording device corresponding to the device identifier based on the device identifier. After receiving the notification message, the video recording device will only send video data when requesting to play the video for the non-first time.
[0043] In a further method of the above method, after the decoder fails to decode the video data, it may be that the codec versions are not unified. For this reason, the platform needs to analyze the video data to determine the encoding version of the video data. After determining that the encoding version is lower than the decoding version of the decoder, a version upgrade file is sent to the video recording device so that the video recording device can upgrade its own encoding version.
[0044] In addition, when it is determined that the encoding version is the same as the decoding version, the platform will inform the video recording device that there may be a transmission error in the video data, so that the video recording device can resend the video data.
[0045] Next, the video processing device provided by the present invention will be described. The video processing device described below can be correspondingly referred to the video processing method described above.
[0046] Figure 2 The structural schematic diagram of a video processing device provided by the present invention is shown. Refer to Figure 2 This device includes a receiving module 21 and a computing module 22, where:
[0047] The receiving module 21 is used to receive a play request sent by a video recording device. The play request includes encoding format information and video data.
[0048] The processing module 22 is used to call a decoder corresponding to the encoding format information to decode the video data and play the decoded video data.
[0049] In a further device of the above device, after playing the video data sent by the video recording device for the first time, the device further includes an establishing module for establishing the correspondence between the decoder and the device identifier of the video recording device.
[0050] Correspondingly, the processing module is further used to call a decoder corresponding to the device identifier to decode the video data and play the decoded video data.
[0051] In a further device of the above device, after establishing the correspondence between the decoder and the device identifier, the device further includes a notification module for:
[0052] Sending a notification message to the video recording device corresponding to the device identifier based on the device identifier, so that the video recording device only sends video data when requesting to play the video for the non-first time.
[0053] In a further device of the above device, after the decoder fails to decode the video data, the device further includes an update module for:
[0054] Analyze the video data to determine the encoding version of the video data;
[0055] After determining that the encoding version is lower than the decoding version of the decoder, send a version upgrade file to the video recording device.
[0056] It should be noted that in the embodiments of the present invention, the relevant functional modules can be implemented by a hardware processor.
[0057] A video processing device provided by the present invention matches a corresponding decoder through the encoding format information in the play request, and enables the matched decoder to decode the video data, so as to realize the platform's playback of different video streams and achieve the purpose of monitoring each warehouse environment.
[0058] Figure 3 Illustrates a schematic physical structure diagram of an electronic device, as Figure 3 shown, the electronic device may include: a processor 31, a communication interface 32, a memory 33, and a communication bus 34. Among them, the processor 31, the communication interface 32, and the memory 33 communicate with each other through the communication bus 34. The processor 31 can call the logical instructions in the memory 33 to execute the following methods:
[0059] Receive a play request sent by a video recording device, where the play request includes encoding format information and video data; call a decoder corresponding to the encoding format information to decode the video data, and play the decoded video data.
[0060] In addition, when the logic instructions in the above-mentioned memory 33 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0061] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned various methods. The method includes:
[0062] Receiving a play request sent by a video recording device. The play request includes encoding format information and video data; calling a decoder corresponding to the encoding format information to decode the video data, and playing the decoded video data.
[0063] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the methods provided by the above-mentioned various embodiments, for example, including:
[0064] Receiving a play request sent by a video recording device. The play request includes encoding format information and video data; calling a decoder corresponding to the encoding format information to decode the video data, and playing the decoded video data.
[0065] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disks, optical discs, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A video processing method, characterized in that, Including: When first playing the video data sent by the video recording device, receiving the play request sent by the video recording device, where the play request includes encoding format information and video data; Invoking a decoder corresponding to the encoding format information to decode the video data and playing the decoded video data; Determining a device identifier from the video data and establishing a correspondence between the decoder and the device identifier of the video recording device; Sending a notification message to the video recording device corresponding to the device identifier based on the device identifier, so that when the video recording device requests to play the video for the non-first time, only the video data is sent; When playing the video data sent by the video recording device for the non-first time, invoking a decoder corresponding to the device identifier to decode the video data and playing the decoded video data.
2. The video processing method according to claim 1, wherein After the decoder fails to decode the video data, the method further includes: Analyzing the video data to determine the encoding version of the video data; After determining that the encoding version is lower than the decoding version of the decoder, sending a version upgrade file to the video recording device.
3. A video processing device, characterized in that, Including: A receiving module for receiving the play request sent by the video recording device, where the play request includes encoding format information and video data; A processing module for invoking a decoder corresponding to the encoding format information to decode the video data and playing the decoded video data; The apparatus further includes an establishing module for determining a device identifier from the video data and establishing a correspondence between the decoder and the device identifier of the video recording device; Sending a notification message to the video recording device corresponding to the device identifier based on the device identifier, so that when the video recording device requests to play the video for the non-first time, only the video data is sent; Correspondingly, the processing module is further configured to, when playing the video data sent by the video recording device for the non-first time, invoke a decoder corresponding to the device identifier to decode the video data and play the decoded video data.
4. The video processing device according to claim 3, wherein After the decoder fails to decode the video data, the apparatus further includes an updating module for: Analyzing the video data to determine the encoding version of the video data; After determining that the encoding version is lower than the decoding version of the decoder, sending a version upgrade file to the video recording device.
5. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the video processing method according to claim 1 or 2.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the video processing method according to claim 1 or 2.
Citation Information
Patent Citations
Monitoring video display method and device, electronic equipment and storage medium
CN112422914A