A video processing method, device, terminal and computer readable storage medium

By encrypting a portion of the data in keyframes of a video and shifting the encrypted data to non-keyframes, the problems of low security and efficiency in video transmission are solved, achieving efficient encryption/decryption and network transmission.

CN116567302BActive Publication Date: 2026-02-06ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310332158.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-23
Publication Date
2026-02-06
Estimated Expiration
2043-03-23

AI Technical Summary

Technical Problem

Existing technologies suffer from low video transmission efficiency while ensuring video security.

Method used

Encrypting key frames in the video by encrypting some data segments and then combining the encrypted data with non-key frames for transmission reduces the amount of encrypted and decrypted data, thereby reducing the network transmission data size of key frames.

Benefits of technology

It improves encryption and decryption performance and video transmission efficiency, balancing security and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116567302B_ABST
    Figure CN116567302B_ABST
Patent Text Reader

Abstract

The application provides a video processing method, device, terminal and computer readable storage medium, the video processing method comprises: obtaining an original video; the original video comprises at least a key frame and a non-key frame adjacent to the key frame; the key frame comprises a first data segment and a second data segment; the first data segment in the key frame is extracted and encrypted to obtain encrypted data corresponding to the key frame; the encrypted data has attribute information; first update data is obtained based on the second data segment and the attribute information; second update data is obtained based on the encrypted data and the non-key frame; the first update data and the second update data are transmitted as encrypted video of the original video. The application encrypts part of the data segment in the key frame, reduces the data amount of encryption and decryption, and improves the encryption and decryption performance; the encrypted data of the key frame is shifted to the non-key frame, the data size of the key frame on the network transmission is reduced, and the efficiency of the code stream transmission under the same network condition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of video encryption and transmission, in particular to a video processing method and device, terminal and computer readable storage medium. BACKGROUND

[0002] The security of video and the transmission efficiency of video are two key points in the field of video monitoring, and the security is often solved by encryption, but the previous technology cannot balance the security and transmission efficiency, and the increase of security will lead to the reduction of transmission efficiency. SUMMARY

[0003] The technical problem solved by the present application is to provide a video processing method, device, terminal and computer readable storage medium, which solves the problem of low video transmission efficiency under the premise of ensuring video security in the prior art.

[0004] To solve the above technical problems, the first technical solution adopted by the present application is to provide a video processing method, which comprises: acquiring an original video; the original video comprises at least a key frame and a non-key frame adjacent to the key frame; the key frame comprises a first data segment and a second data segment; extracting the first data segment in the key frame and encrypting it to obtain encrypted data corresponding to the key frame; the encrypted data has attribute information; based on the second data segment and the attribute information, first update data is obtained; based on the encrypted data and the non-key frame, second update data is obtained; the first update data and the second update data are transmitted as encrypted video of the original video.

[0005] Among them, extracting the first data segment in the key frame and encrypting it to obtain encrypted data corresponding to the key frame, comprising: extracting the data of a preset position region in the original data corresponding to the key frame as the first data segment; encrypting the first data segment with a preset secret key to obtain the encrypted data.

[0006] Among them, extracting the data of a preset position region in the original data corresponding to the key frame as the first data segment, comprising: extracting the first N bytes of the original data corresponding to the key frame as the first data segment.

[0007] Among them, the attribute information includes the length of the encrypted data.

[0008] Among them, based on the second data segment and the attribute information, the first update data is obtained; based on the encrypted data and the non-key frame, the second update data is obtained, comprising: combining the second data segment and the attribute information according to a first preset order to obtain the first update data; combining the encrypted data and the non-key frame according to a second preset order to obtain the second update data.

[0009] To solve the above technical problems, a second technical solution adopted by the present application is to provide a video processing method, the video processing method comprising: obtaining an encrypted video corresponding to an original video, the original video comprising at least a key frame and a non-key frame adjacent to the key frame; the key frame comprising a first data segment and a second data segment; the encrypted video comprising at least first update data and second update data; the first update data comprising attribute information of encrypted data corresponding to the second data segment and the first data segment; the second update data comprising the encrypted data and the non-key frame; extracting the attribute information from the first update data, and extracting the encrypted data from the second update data based on the attribute information; decrypting the encrypted data to obtain the first data segment; obtaining the key frame based on the first data segment and the second data segment; eliminating the encrypted data in the second update data to obtain the non-key frame; and restoring the original video according to the key frame and the non-key frame.

[0010] Among them, the attribute information comprises a length value of the encrypted data; the attribute information is extracted from the first update data, and the encrypted data is extracted from the second update data based on the attribute information, comprising: extracting the length value of the encrypted data from the first update data, and extracting data with the length value from a preset position in the second update data as the encrypted data.

[0011] To solve the above technical problems, a third technical solution adopted by the present application is to provide a video processing device, the video processing device comprising: a first acquisition module for acquiring an original video; the original video comprising at least a key frame and a non-key frame adjacent to the key frame; the key frame comprising a first data segment and a second data segment; an encryption module for extracting the first data segment in the key frame and encrypting to obtain encrypted data corresponding to the key frame; the encrypted data having attribute information; a combination module for obtaining first update data based on the second data segment and the attribute information; obtaining second update data based on the encrypted data and the non-key frame; a transmission module for transmitting the first update data and the second update data as encrypted video of the original video.

[0012] To solve the above technical problems, a fourth technical solution adopted by the present application is to provide a video processing device, which comprises: a second acquisition module configured to acquire an encrypted video corresponding to an original video, the original video comprising at least a key frame and a non-key frame adjacent to the key frame; the key frame comprising a first data segment and a second data segment; the encrypted video comprising at least first update data and second update data; the first update data comprising attribute information of encrypted data corresponding to the second data segment and the first data segment; the second update data comprising the encrypted data and the non-key frame; an extraction module configured to extract the attribute information from the first update data and extract the encrypted data from the second update data based on the attribute information; a decryption module configured to decrypt the encrypted data to obtain the first data segment; a first combination module configured to obtain the key frame based on the first data segment and the second data segment; a second combination module configured to eliminate the encrypted data in the second update data to obtain the non-key frame; and a restoration module configured to restore the original video according to the key frame and the non-key frame.

[0013] To solve the above technical problems, a fifth technical solution adopted by the present application is to provide a terminal, which comprises a memory, a processor, and a computer program stored in the memory and running on the processor; the processor is configured to execute the program data to implement the steps of the video processing method as described above.

[0014] To solve the above technical problems, a sixth technical solution adopted by the present application is to provide a computer readable storage medium, which stores a computer program; when the computer program is executed by a processor, the steps of the video processing method as described above are implemented.

[0015] The present application has the following beneficial effects: Different from the prior art, the present application provides a video processing method, device, terminal and computer readable storage medium, the video processing method comprising: acquiring an original video; the original video comprising at least a key frame and a non-key frame adjacent to the key frame; the key frame comprising a first data segment and a second data segment; extracting the first data segment in the key frame and encrypting the same to obtain encrypted data corresponding to the key frame; the encrypted data having attribute information; obtaining first update data based on the second data segment and the attribute information; obtaining second update data based on the encrypted data and the non-key frame; and transmitting the first update data and the second update data as encrypted video of the original video. The present application encrypts part of the data segment in the key frame, thereby reducing the amount of data for encryption and decryption and improving the encryption and decryption performance; the encrypted data of the key frame is shifted to the non-key frame, thereby reducing the data size of the key frame on the network transmission and improving the efficiency of the code stream transmission under the same network condition. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to make the technical solutions in the embodiments of the present application clearer, the accompanying drawings needed in the embodiment description will be briefly introduced. Obviously, the accompanying drawings in the following description only show some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.

[0017] Figure 1 is a flowchart of an embodiment of the video processing method provided by the present application;

[0018] Figure 2 is a flowchart of an embodiment of the video processing method provided by the present application;

[0019] Figure 3 is a flowchart of an embodiment of the video processing method provided by the present application;

[0020] Figure 4 is a flowchart of an embodiment of the video processing method provided by the present application;

[0021] Figure 5 is a framework diagram of an embodiment of the video processing device provided by the present application;

[0022] Figure 6 is a framework diagram of an embodiment of the video processing device provided by the present application;

[0023] Figure 7 is a framework diagram of an embodiment of the terminal provided by the present application;

[0024] Figure 8 is a framework diagram of an embodiment of the computer readable storage medium provided by the present application. DETAILED DESCRIPTION

[0025] The technical solutions of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0026] In the following description, specific details are set forth in order to provide a thorough understanding of the present application. However, persons having ordinary skill in the art will appreciate that these details are not intended to limit the present application, but are merely provided to help explain the present application.

[0027] The term "and / or" in the present application is only used to describe the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can mean that there are three cases of A alone, A and B together, and B alone. In addition, the character " / " in the present application generally represents an "or" relationship between the associated objects. In addition, "multiple" in the present application means two or more than two.

[0028] In order for those skilled in the art to better understand the technical solutions of the present application, a video processing method provided by the present application is further described in detail below in combination with the drawings and specific embodiments.

[0029] Currently, the data decryption end can obtain and play the original video from the data encryption end. In order to improve the security of the original video, the data encryption end can encrypt the original video to obtain an encrypted video, and then send the encrypted video to the data decryption end. The data decryption end can receive the encrypted video sent by the data encryption end, and then decrypt the encrypted video to obtain the original video, and then play the original video.

[0030] However, in the above scenario, when the data encryption end encrypts the original video, the original video is often encrypted as a whole. The number of frames included in the original video is large, and therefore, the process of encrypting the original video as a whole needs to consume a long time, resulting in low encryption efficiency. In addition, due to the large amount of encrypted data, the data transmission efficiency is also low.

[0031] Therefore, in order to reduce the time consumed in the process of encrypting and transmitting the original video, and thus improve the encryption efficiency, the inventors have conducted in-depth research on the original video, and found that the original video includes key frames and non-key frames. The key frames can include I frames (I frame), and the non-key frames can include P frames (P frame) and B frames (B frame).

[0032] The I frame is also called an intra picture. It is a full-frame compressed encoded frame. The first frame obtained after the video is compressed using a video compression technology is an I frame. The I frame can be a reference point for random access, and can be regarded as an image. After the video is compressed, the picture of the I frame is completely retained. When decompressing, only the data of the current frame is needed to reconstruct the complete image, and there is no need to refer to the images of other frames.

[0033] The P frame is predicted from the P frame or I frame in front of it. It compares the same information or data between the P frame or I frame in front of it, that is, considers the characteristics of motion for inter-frame compression. The P frame represents the difference between the current frame and the previous I frame or P frame. When decompressing, the previous cached I frame or P frame is superimposed on the difference between the current frame to generate the final image. The P frame is also called a difference frame. The P frame does not have complete image data, but only has difference data between the previous frame.

[0034] The B frame is a bidirectional difference frame. The B frame records the difference between the current frame and the previous and subsequent frames. In other words, to decompress the B frame, not only the image located before the B frame is obtained, but also the image located after the B frame is obtained. The final image is obtained by superimposing the images before and after the current frame.

[0035] In addition, the inventors further found that, among the I frames, P frames and B frames included in the original video, the I frames are the most important frames.

[0036] After all the frames in the original video are encrypted, if the P frames and / or B frames in the original video are cracked but the I frames are not cracked, it is usually difficult to restore the original video, so as to not cause the original video to be leaked.

[0037] If at least the I frames are cracked but the P frames and / or B frames are not cracked, it is easy to restore part of the original video, so as to possibly cause the original video to be leaked.

[0038] It can be seen that, when the original video is encrypted, the encryption of the I frames in the original video can achieve the purpose of preventing the original video from being restored.

[0039] Therefore, in order to balance the security of the original video and the encryption transmission efficiency, in the present application, in order to improve the security of the original video and the efficiency of data transmission, the data encryption end encrypts part of the data of the key frame of the original video to obtain encrypted data. Then, the other data of the key frame and the attribute information of the encrypted data are combined and transmitted to the data decryption end, and the encrypted data and the non-key frame are combined and transmitted to the data decryption end. The data decryption end can receive the data sent by the data encryption end, then obtain the encrypted data from the combined data of the non-key frame based on the attribute information, decrypt the encrypted data, and combine the decrypted data with the key frame data to obtain the original key frame. After removing the encrypted data, the original non-key frame is obtained, and the original video is obtained based on the original key frame and the original non-key frame. Then, the original video can be played.

[0040] Please refer to Figure 1 , Figure 1 is a flowchart of an embodiment of the video processing method provided by the present application. In the embodiment, a video processing method is provided, and the execution subject of the video processing method is a data encryption end. The video processing method comprises the following steps.

[0041] S11: Obtain an original video.

[0042] Specifically, the format of the original video includes but is not limited to mp4, rmvb, wmv, etc. The original video can be a preset number of continuous video frames obtained in real time, or a video stream obtained offline.

[0043] In an embodiment, the user obtains the original video on the terminal device through the first client. The corresponding video file can also be selected from the video files stored locally on the terminal device as the original video through the first client. According to the user's request, the corresponding video file can also be obtained from other terminal devices or servers, and the video file is selected through the first client to obtain the original video required by the user. In this embodiment, the first client is the data encryption end.

[0044] The original video includes at least a key frame and a non-key frame adjacent to the key frame. In an embodiment, the original video includes at least one key frame and a plurality of non-key frames adjacent to the key frame. The key frame includes at least one non-key frame adjacent to the key frame.

[0045] The key frame includes a first data segment and a second data segment. In an embodiment, first, a length value N of data to be extracted from a preset position in the key frame is preset. The length value refers to the data length, specifically in bytes.

[0046] The data with a length value of N starting from the preset position in the key frame is taken as the first data segment. The data other than the first data segment in the key frame is taken as the second data segment. In a specific embodiment, the preset position is the starting end, and the data segment with a length value of N starting from the starting end of the data corresponding to the key frame is taken as the first data segment. In another specific embodiment, the preset position is a position with a length value of D from the starting end, and the data segment with a length value of N starting from the position with a length value of D from the starting end of the data corresponding to the key frame is taken as the first data segment. Wherein, D and N are positive integers.

[0047] S12: Extract the first data segment in the key frame and encrypt it to obtain the encrypted data corresponding to the key frame.

[0048] In this embodiment, only part of the data segment in the key frame is extracted for encryption, improving the encryption transmission efficiency.

[0049] Specifically, the data in the preset position region of the original data corresponding to the key frame is extracted as the first data segment.

[0050] In an embodiment, the first N bytes of the original data corresponding to the key frame are extracted as the first data segment.

[0051] In an embodiment, the data with a length value of N extracted from the preset position in the key frame is taken as the first data segment. In an embodiment, the data segment with a length value of N is extracted starting from the position with a length value of D from the starting end of the data corresponding to the key frame as the first data segment.

[0052] The first data segment is encrypted by using a preset key to obtain encrypted data. The first data segment can also be encrypted by using a preset encryption algorithm to obtain encrypted data. The preset encryption algorithm can include, but is not limited to, a symmetric encryption algorithm, and can also be an asymmetric encryption algorithm. The encrypted data has attribute information. In this embodiment, the attribute information includes a length value of the encrypted data.

[0053] The length value of the encrypted data can be greater than the length value of the first data segment. The length value of the encrypted data can be equal to the length value of the first data segment. The length value of the encrypted data can also be less than the length value of the first data segment. The length value of the encrypted data is determined according to the encryption key or the encryption algorithm.

[0054] S13: obtaining first update data based on the second data segment and the attribute information, and obtaining second update data based on the encrypted data and the non-key frame.

[0055] Specifically, the second data segment and the attribute information are combined in a first preset order to obtain the first update data.

[0056] The first preset order can be that the second data segment is in front and the attribute information of the encrypted data is in back. In an embodiment, the length value of the encrypted data is spliced after the second data segment of the key frame to obtain the first update data.

[0057] The first preset order can also be that the second data segment is in back and the attribute information of the encrypted data is in front. In an embodiment, the second data segment of the key frame is spliced after the length value of the encrypted data to obtain the first update data.

[0058] The first preset order can also be that the attribute information of the encrypted data is inserted at a preset position in the second data segment. In an embodiment, the length value of the encrypted data is inserted at a middle position of the second data segment of the key frame to obtain the first update data.

[0059] Specifically, the encrypted data and the non-key frame are combined in a second preset order to obtain the second update data.

[0060] The second preset order can be that the encrypted data is in front and the non-key frame is in back. In an embodiment, the non-key frame is spliced after the encrypted data to obtain the second update data.

[0061] The second preset order can also be that the encrypted data is in back and the non-key frame is in front. In an embodiment, the encrypted data is spliced after the non-key frame to obtain the second update data.

[0062] The second preset order can also be that the encrypted data is inserted in the data corresponding to the non-key frame. In an embodiment, the encrypted data is inserted at a middle position of the data segment corresponding to the non-key frame to obtain the second update data.

[0063] S14: transmit the first update data and the second update data as encrypted videos of the original video.

[0064] Specifically, the first client transmits the first update data and the second update data as encrypted videos of the original video to the second client. The first update data has a first identifier, and the first identifier is a key frame. The second update data has a second identifier, and the second identifier is a non-key frame adjacent to the previous key frame.

[0065] In the embodiment, the data encryption end transmits the preset position of the first data segment extracted from the key frame, the encryption key, the encryption algorithm, the first preset order and the second preset order to the data decryption end that needs to decode the code stream through a trusted communication mechanism.

[0066] Please refer to Figure 2 , Figure 2 is a flowchart of a specific embodiment of the video processing method provided by the application.

[0067] In a specific embodiment, a current video frame in an original video is obtained, and whether the current video frame is a key frame is determined according to characteristic information of the current video frame. If the current video frame is a key frame, the first data segment of the data corresponding to the current video frame is extracted as the first data segment, and the other data of the current video frame except the first data segment is the second data segment. The first data segment is encrypted based on an encryption key and an encryption algorithm to obtain encrypted data, and the length value of the encrypted data is determined. The length value of the encrypted data is spliced with the second data segment of the current video frame to obtain the first update data. If the current video frame is not a key frame, whether the current video frame is the first non-key frame after the key frame is determined according to the characteristic information of the current video frame. If the current video frame is the first non-key frame after the key frame, the encrypted data corresponding to the previous key frame of the current video frame is spliced with the current video frame to obtain the second update data. If the current video frame is not the first non-key frame after the key frame, the process is ended, and the next video frame is obtained. The key frame in the embodiment is an I frame, and the non-key frame is a P frame.

[0068] In this embodiment, the video processing method includes: acquiring an original video; the original video includes at least keyframes and non-keyframes adjacent to the keyframes; the keyframes include a first data segment and a second data segment; extracting the first data segment from the keyframes and encrypting it to obtain encrypted data corresponding to the keyframes; the encrypted data has attribute information; based on the second data segment and the attribute information, obtaining first updated data; based on the encrypted data and non-keyframes, obtaining second updated data; and transmitting the first updated data and the second updated data as encrypted video of the original video. This application reduces the amount of data to be encrypted and decrypted by encrypting a portion of the data segments in the keyframes, thereby improving encryption and decryption performance; and shifts the encrypted data of the keyframes to non-keyframes, reducing the data size of the keyframes in network transmission and improving the efficiency of bitstream transmission under the same network conditions.

[0069] Please see Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the video processing method provided by the present invention.

[0070] This embodiment provides a video processing method, in which the execution entity of the video processing method is a data decryption terminal, and the video processing method includes the following steps.

[0071] In this embodiment, the data decryption end and the data encryption end establish data sharing in advance through a mutual trust communication mechanism. Specifically, the data decryption end receives from the data encryption end the preset position for extracting the first data segment from the keyframe, the encryption key, the encryption algorithm, the first preset order, and the second preset order.

[0072] S21: Obtain the encrypted video corresponding to the original video.

[0073] The second client receives the encrypted video corresponding to the original video transmitted by the first client. The second client acts as the data decryption end.

[0074] Specifically, the original video includes at least keyframes and non-keyframes adjacent to the keyframes; the keyframes include a first data segment and a second data segment; the encrypted video includes at least first updated data and second updated data; the first updated data includes attribute information of the second data segment and the encrypted data corresponding to the first data segment; the second updated data includes encrypted data and non-keyframes.

[0075] S22: Extract attribute information from the first updated data, and extract encrypted data from the second updated data based on the attribute information.

[0076] Specifically, the second client extracts attribute information from the first update data according to a first preset order. The attribute information includes a length value of the encrypted data. The length value of the encrypted data is extracted from the first update data, and data of the length value is extracted from a preset position in the second update data according to a second preset order, to obtain the encrypted data.

[0077] S23: decrypting the encrypted data to obtain the first data segment.

[0078] Specifically, the encrypted data is decrypted based on a decryption key and a decryption algorithm to obtain the first data segment.

[0079] S24: obtaining a key frame based on the first data segment and the second data segment.

[0080] Specifically, the first data segment is inserted into the second data segment according to a preset position of the first data segment extracted from the key frame, to restore the key frame in the original video.

[0081] S25: removing the encrypted data in the second update data to obtain a non-key frame.

[0082] Specifically, the encrypted data in the second update data is removed to restore the non-key frame.

[0083] S26: restoring the original video according to the key frame and the non-key frame.

[0084] Specifically, the original video is obtained based on the restored key frame and non-key frame, and the second client can play the original video.

[0085] Please refer to Figure 4 , Figure 4 is a flowchart of another specific embodiment of the video processing method provided by the application.

[0086] In a specific embodiment, the second client receives the current data, determines whether the current data is the first update data according to the identifier of the current data. If the current data is loaded with the first identifier, the current data is the first update data, the length value of the encrypted data is obtained from the current data according to the first preset order, and the next frame corresponding data is received. If the current data is loaded with the second identifier, it is determined whether the current data is the second update data adjacent to the first update data. If the current data is the second update data adjacent to the first update data, the encrypted data is extracted from the second update data according to the length value of the encrypted data corresponding to the first update data and the second preset order. The encrypted data is decrypted based on the encryption key and the decryption algorithm to obtain the first data segment. The first data segment and other data in the first update data except the length value of the encrypted data are spliced and restored to obtain the original key frame based on the preset position of the first data segment extracted from the key frame. The other data in the second update data except the encrypted data is restored to obtain the original non-key frame. The original video is obtained based on the restored key frame and non-key frame. If the current data is not the second update data adjacent to the first update data, the process is ended.

[0087] In the embodiment, the video processing method comprises: obtaining an encrypted video corresponding to an original video, the original video comprising at least a key frame and a non-key frame adjacent to the key frame; the key frame comprising a first data segment and a second data segment; the encrypted video comprising at least a first update data and a second update data; the first update data comprising attribute information of encrypted data corresponding to the first data segment and the second data segment; the second update data comprising the encrypted data and the non-key frame; extracting the attribute information from the first update data, and extracting the encrypted data from the second update data based on the attribute information; decrypting the encrypted data to obtain the first data segment; obtaining the key frame based on the first data segment and the second data segment; removing the encrypted data in the second update data to obtain the non-key frame; and restoring the original video according to the key frame and the non-key frame. By encrypting part of the data segment in the key frame, the amount of data for encryption and decryption is reduced, and the encryption and decryption performance is improved. The encrypted data of the key frame is shifted to the non-key frame, the size of the data amount of the key frame in network transmission is reduced, and the efficiency of the code stream transmission under the same network condition is improved.

[0088] Referring to Figure 5 , Figure 5 is a schematic diagram of the framework of an embodiment of the video processing device provided by the application.

[0089] The embodiment provides a video processing device 60, which comprises a first acquisition module 61, an encryption module 62, a combination module 63 and a transmission module 64.

[0090] The first obtaining module 61 is configured to obtain an original video; the original video at least includes a key frame and a non-key frame adjacent to the key frame; the key frame includes a first data segment and a second data segment.

[0091] The encryption module 62 is configured to extract the first data segment in the key frame and encrypt the first data segment to obtain encrypted data corresponding to the key frame; the encrypted data has attribute information.

[0092] The combination module 63 is configured to obtain first update data based on the second data segment and the attribute information; and obtain second update data based on the encrypted data and the non-key frame.

[0093] The transmission module 64 is configured to transmit the first update data and the second update data as encrypted video of the original video.

[0094] The embodiment reduces the amount of data for encryption and decryption by encrypting part of the data segment in the key frame, and improves the encryption and decryption performance; the encrypted data of the key frame is shifted to the non-key frame, which reduces the size of the data amount of the key frame in network transmission, and improves the efficiency of the code stream transmission under the same network condition.

[0095] Referring to Figure 6 , Figure 6 is a framework schematic diagram of another embodiment of the video processing device provided by the application.

[0096] The embodiment provides a video processing device 70, which includes a second obtaining module 71, an extraction module 72, a decryption module 73, a first combination module 74, a second combination module 75 and a restoration module 76.

[0097] The second obtaining module 71 is configured to obtain encrypted video corresponding to an original video; the original video at least includes a key frame and a non-key frame adjacent to the key frame; the key frame includes a first data segment and a second data segment; the encrypted video at least includes first update data and second update data; the first update data includes attribute information of encrypted data corresponding to the second data segment and the first data segment; and the second update data includes the encrypted data and the non-key frame.

[0098] The extraction module 72 is configured to extract the attribute information from the first update data, and extract the encrypted data from the second update data based on the attribute information.

[0099] The decryption module 73 is configured to decrypt the encrypted data to obtain the first data segment.

[0100] The first combination module 74 is configured to obtain the key frame based on the first data segment and the second data segment.

[0101] The second combination module 75 is configured to exclude the encrypted data in the second update data to obtain the non-key frame.

[0102] The restoring module 76 is configured to restore the original video according to the key frames and the non-key frames.

[0103] The embodiment reduces the encrypted and decrypted data amount by encrypting part of the data segment in the key frame, and improves the encryption and decryption performance; and the encrypted data of the key frame is shifted to the non-key frame, thereby reducing the data amount of the key frame on the network transmission, and improving the efficiency of the code stream transmission under the same network condition.

[0104] Referring to Figure 7 , Figure 7 is a framework schematic diagram of an embodiment of the terminal provided by the present application. The terminal 80 includes a memory 81 and a processor 82 coupled with each other. The processor 82 is configured to execute program instructions stored in the memory 81 to implement the steps of any of the video processing method embodiments described above. In a specific implementation scenario, the terminal 80 can include but is not limited to a microcomputer, a server, and in addition, the terminal 80 can also include a notebook computer, a tablet computer and other mobile devices, which are not limited here.

[0105] Specifically, the processor 82 is configured to control itself and the memory 81 to implement the steps of any of the video processing method embodiments described above. The processor 82 can also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 82 can be an integrated circuit chip with a signal processing capability. The processor 82 can also be a general-purpose processor, a DSP (Digital Signal Processor, digital signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), an FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. In addition, the processor 82 can be implemented by an integrated circuit chip together.

[0106] Referring to Figure 8 , Figure 8 is a framework schematic diagram of an embodiment of the computer readable storage medium provided by the present application. The computer readable storage medium 90 stores program instructions 901 capable of being executed by a processor, and the program instructions 901 are used to implement the steps of any of the video processing method embodiments described above.

[0107] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or includes modules that can be used to execute the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, they will not be repeated here.

[0108] The above description of the various embodiments is intended to be illustrative of the various embodiments and is not intended to limit the scope of the various embodiments. Many variations are possible which would be readily apparent to those skilled in the art. Some conceptual aspects were described by emphasizing the differences between the various embodiments, and the same or similar aspects can be interchanged between the various embodiments. For the sake of brevity, the conceptual aspects of the various embodiments are not repeated here.

[0109] In several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other manners. For example, the division of the above-described device embodiments is merely an example, and there can be another division manner. For example, a plurality of modules or a plurality of components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different components can be implemented by using some interfaces, and the indirect couplings or communication connections between different components can be implemented in electronic, mechanical, or other forms.

[0110] In addition, each functional unit in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware, or in the form of software functional units.

[0111] When the integrated unit is implemented in the form of software functional units and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially, or the part that contributes to the prior art, or all or a part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (such as a personal computer, a server, or a network device) or a processor to perform all or part of the steps of the methods in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disk, and various other media that can store program codes.

Claims

1. A video processing method, characterized in that, The method includes: Acquire the original video; the original video includes at least keyframes and non-keyframes adjacent to the keyframes; the keyframes include a first data segment and a second data segment; Extract the first data segment from the keyframe and encrypt it to obtain encrypted data corresponding to the keyframe; the encrypted data has attribute information; the attribute information includes the length value of the encrypted data. Based on the second data segment and the attribute information, the first updated data is obtained; based on the encrypted data and the non-key frame, the second updated data is obtained. The first updated data and the second updated data are transmitted as an encrypted video of the original video.

2. The video processing method according to claim 1, characterized in that, The step of extracting the first data segment from the keyframe and encrypting it to obtain the encrypted data corresponding to the keyframe includes: Extract data from a preset location region in the original data corresponding to the keyframe, and use it as the first data segment; The first data segment is encrypted using a preset key to obtain the encrypted data.

3. The video processing method according to claim 2, characterized in that, The step of extracting data from a preset location region in the original data corresponding to the keyframe, as the first data segment, includes: Extract the first N bytes of the original data corresponding to the keyframe and use them as the first data segment.

4. The video processing method according to claim 1, characterized in that, The first updated data is obtained based on the second data segment and the attribute information; Based on the encrypted data and the non-key frame, the second updated data is obtained, including: The second data segment and the attribute information are combined in a first preset order to obtain the first updated data; The encrypted data and the non-keyframes are combined in a second preset order to obtain the second updated data.

5. A video processing method, characterized in that, The method includes: Obtain the encrypted video corresponding to the original video. The original video includes at least keyframes and non-keyframes adjacent to the keyframes. The keyframes include a first data segment and a second data segment. The encrypted video includes at least first updated data and second updated data. The first updated data includes attribute information of the second data segment and the encrypted data corresponding to the first data segment. The second updated data includes the encrypted data and the non-keyframes. The attribute information includes the length value of the encrypted data. Extract the attribute information from the first updated data, and extract the encrypted data from the second updated data based on the attribute information; The encrypted data is decrypted to obtain the first data segment; The keyframe is obtained based on the first data segment and the second data segment; The encrypted data is removed from the second updated data to obtain the non-key frame; The original video is reconstructed based on the keyframes and non-keyframes.

6. The video processing method according to claim 5, characterized in that, The step of extracting the attribute information from the first updated data and extracting the encrypted data from the second updated data based on the attribute information includes: The length value of the encrypted data is extracted from the first updated data, and the data of the length value is extracted from a preset position in the second updated data as the encrypted data.

7. A video processing apparatus, characterized in that, The device includes: A first acquisition module is used to acquire an original video; the original video includes at least keyframes and non-keyframes adjacent to the keyframes; the keyframes include a first data segment and a second data segment. An encryption module is used to extract the first data segment from the keyframe and encrypt it to obtain encrypted data corresponding to the keyframe; the encrypted data has attribute information; the attribute information includes the length value of the encrypted data. The combination module is used to obtain first updated data based on the second data segment and the attribute information; and to obtain second updated data based on the encrypted data and the non-key frame. The transmission module is used to transmit the first update data and the second update data as an encrypted video of the original video.

8. A video processing apparatus, characterized in that, The device includes: The second acquisition module is used to acquire the encrypted video corresponding to the original video. The original video includes at least keyframes and non-keyframes adjacent to the keyframes. The keyframes include a first data segment and a second data segment. The encrypted video includes at least first updated data and second updated data. The first updated data includes attribute information of the second data segment and the encrypted data corresponding to the first data segment. The second updated data includes the encrypted data and the non-keyframes. The attribute information includes the length value of the encrypted data. An extraction module is used to extract the attribute information from the first updated data and extract the encrypted data from the second updated data based on the attribute information; A decryption module is used to decrypt the encrypted data to obtain the first data segment; The first combination module is used to obtain the key frame based on the first data segment and the second data segment; The second combination module is used to remove the encrypted data from the second updated data to obtain the non-key frame; The restoration module is used to restore the original video based on the key frames and non-key frames.

9. A terminal, characterized in that, The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, the processor being configured to execute program data to implement the steps of the video processing method as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the video processing method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Video processing method and device, electronic equipment and storage medium

    CN111698534A

  • Video stream encryption method and device, communication equipment and storage medium

    CN113259718A