CN115834926A - Video encryption method based on H.265 entropy coding binarization - Google Patents

Video encryption method based on H.265 entropy coding binarization Download PDF

Info

Publication number
CN115834926A
CN115834926A CN202211454317.3A CN202211454317A CN115834926A CN 115834926 A CN115834926 A CN 115834926A CN 202211454317 A CN202211454317 A CN 202211454317A CN 115834926 A CN115834926 A CN 115834926A
Authority
CN
China
Prior art keywords
video
encrypted
quality type
picture quality
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211454317.3A
Other languages
Chinese (zh)
Other versions
CN115834926B (en
Inventor
廖国波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Super Times Software Co ltd
Original Assignee
Shenzhen Super Times Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Super Times Software Co ltd filed Critical Shenzhen Super Times Software Co ltd
Priority to CN202211454317.3A priority Critical patent/CN115834926B/en
Publication of CN115834926A publication Critical patent/CN115834926A/en
Application granted granted Critical
Publication of CN115834926B publication Critical patent/CN115834926B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a video encryption method, a device, a medium and equipment based on H.265 entropy coding binarization, comprising the following steps: determining the code flow rate of each picture quality type according to the picture quality type of the video to be encrypted; respectively cutting the video to be encrypted into a plurality of sub video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each picture quality type; determining the transmission weight corresponding to the picture quality type according to the data length of the sub video packet corresponding to the picture quality type; determining an encryption key matrix of the sub-video packet corresponding to the picture quality type according to the similarity, transmission weight and a preset distribution function of a plurality of sub-video packets to be encrypted corresponding to the picture quality type among adjacent video frames in the sub-video packet; inputting an encryption key matrix of the H.265 format video sub-data packet to be encrypted, which corresponds to the picture quality type, into an entropy encoder to obtain a corresponding binary encryption key; and encrypting the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted by the binary encryption key.

Description

Video encryption method based on H.265 entropy coding binarization
Technical Field
The invention relates to the technical field of video encryption, in particular to a video encryption method, a video encryption device, a video encryption medium and video encryption equipment based on H.265 entropy coding binarization.
Background
The H.265 video coding standard can improve the relationship among code stream, coding quality, delay and algorithm complexity, so that the video achieves the optimal setting during encryption, thereby improving the compression efficiency, robustness and error recovery capability of the video, simultaneously reducing the delay, channel acquisition time and random access delay, and meeting the coding requirements of high-definition, ultra-high-definition or 3D video. In the prior art, h.265 format video data is cut to obtain a plurality of h.265 format video subdata, an encryption key for each h.265 format video subdata is set, the encryption keys for the h.265 format video subdata are input into an entropy encoder, and the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption keys to obtain corresponding binarization encryption keys; and then all the binary encryption keys and the H.265 format video data are stored in a video database together, so that the encryption processing of the video is completed. Although the encoding performance can be balanced and the format compatibility can be improved, the method is only suitable for the video with low code rate and cannot be suitable for the video with high code rate.
Disclosure of Invention
The invention provides a video encryption method, a device, a medium and equipment based on H.265 entropy coding binarization, aiming at the technical problem that audio data has lost frames and thus tone quality is defective in the prior art.
In order to achieve the purpose, the invention is realized by the following technical scheme:
in a first aspect of the embodiments of the present invention, a video encryption method based on h.265 entropy coding binarization is provided, where the method includes:
determining the code flow rate of each image quality type corresponding to the video to be encrypted according to the image quality type of the video to be encrypted at a playing end aiming at the obtained video to be encrypted;
according to the code flow rate corresponding to each image quality type, the video to be encrypted is respectively cut into a plurality of sub video packets to be encrypted in an H.265 format, wherein the data lengths of the sub video packets to be encrypted corresponding to the image quality types are different;
determining a transmission weight corresponding to the picture quality type according to the data length of the plurality of sub video packets to be encrypted corresponding to the picture quality type, wherein the transmission weight is positively correlated with the data length;
determining an encryption key matrix of a plurality of sub video packets to be encrypted corresponding to the image quality type according to the similarity of the plurality of sub video packets to be encrypted in adjacent video frames in the sub video packets, the transmission weight and a preset distribution function, wherein the preset distribution function is a distribution function taking the numerical value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
inputting the encryption key matrix of the H.265 format video sub-data packet corresponding to the picture quality type into an entropy encoder so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and video encryption is carried out on the sub video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binary encryption key.
Optionally, the step of determining a bitrate of each picture quality type corresponding to the video to be encrypted according to the picture quality type of the video to be encrypted at the playing end includes:
according to the picture quality type of the video to be encrypted at a playing end, obtaining a video stream to be processed containing each quantized picture quality type;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed under the condition that the quantized video stream to be processed is not in the H.265 format to obtain a video stream in the H.265 format;
performing inverse quantization on the H.265 format video stream to generate a standby H.265 format video stream;
generating a narrowband subband sequence signal by converting the standby H.265 format video stream into a time-frequency domain representation;
and according to the bandwidth extension parameters contained in the video stream to be processed, applying the narrowband subband sequence signal and determining the code flow rate of each picture quality type corresponding to the video to be encrypted.
Optionally, the step of determining the bitrate of the video to be encrypted corresponding to each picture quality type by applying the narrowband subband sequence signal according to the bandwidth extension parameter included in the video stream to be processed includes:
determining a hole rate for hole convolution according to bandwidth expansion parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband sub-band sequence signal according to the hole convolution kernel to obtain a down-sampling video image;
and carrying out deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining the code flow rate of each image quality type corresponding to the video to be encrypted according to the video stream to be processed and the deconvolution image.
Optionally, the obtaining, according to the to-be-processed video stream and the deconvolution image, a bitrate of each image quality type corresponding to the to-be-encrypted video includes:
calculating a Hardmann product of the video stream to be processed and the deconvolution image to obtain a Hardmann characteristic image;
placing a code stream mask on the Hardman characteristic image according to the size of a preset window and a preset step length, and calculating the average value of the characteristic values of the Hardman characteristic image covered by the code stream mask;
and forming a code stream sequence by the average values according to the covering sequence of the code stream mask to obtain the code stream rate of each image quality type corresponding to the video to be encrypted.
Optionally, before the step of determining, for the obtained video to be encrypted, a bitrate of each picture quality type corresponding to the video to be encrypted according to the picture quality type of the video to be encrypted at a playing end, the method includes:
sending a corresponding video acquisition instruction to a video acquisition device according to the image quality type of the playing end, wherein the video acquisition instruction is used for the video acquisition device to acquire target videos with a plurality of definitions according to the definitions corresponding to the image quality type;
receiving a target video corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with multiple definitions to obtain a video to be restored;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the step of performing luminance restoration processing on the video to be restored to obtain the video to be encrypted includes:
determining a foreground average brightness value and a background average brightness corresponding to a foreground area and a background area in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset foreground brightness threshold value and a second brightness deviation value between the background average brightness and a preset background brightness threshold value;
if the first brightness deviation value is within a first preset deviation range and the second brightness deviation value is within a second preset deviation range, keeping the brightness of the current foreground area and the current background area, wherein the first preset deviation range and the second preset deviation range have a one-to-one correspondence relationship with the image quality type;
if the first brightness deviation value is not within the first preset deviation range or the second brightness deviation value is not within the second preset deviation range, adjusting the brightness of the foreground area in the video to be repaired or adjusting the brightness of the background area in the video to be repaired, so that the first brightness deviation value is within the first preset deviation range and the second brightness deviation value is within the second preset deviation range.
Optionally, the picture quality type includes at least one of standard picture quality, high definition picture quality, ultra high definition picture quality, or blue light picture quality.
In a second aspect of the embodiments of the present invention, there is provided a video encryption apparatus based on h.265 entropy coding binarization, the apparatus including:
the code flow rate determining module is configured to determine, according to the image quality type of the video to be encrypted at a playing end, the code flow rate of each image quality type corresponding to the video to be encrypted, for the obtained video to be encrypted;
the video cutting module is configured to cut the video to be encrypted into a plurality of sub-video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type, wherein the data lengths of the sub-video packets to be encrypted corresponding to the image quality types are different;
a transmission weight module configured to determine a transmission weight corresponding to the picture quality type according to the data length of the plurality of sub video packets to be encrypted corresponding to the picture quality type, wherein the transmission weight is positively correlated to the data length;
a key matrix module configured to perform encryption key matrix determination on a plurality of sub-video packets to be encrypted corresponding to the picture quality type through similarity between adjacent video frames of the plurality of sub-video packets to be encrypted corresponding to the picture quality type in the sub-video packets, the transmission weight, and a preset distribution function, wherein the preset distribution function is a distribution function using a value of similarity between a preset bandwidth and the adjacent video frames as an input parameter;
the input module is configured to input the encryption key matrix of the h.265 format to-be-video sub-data packet corresponding to the picture quality type into an entropy encoder, so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and the encryption module is configured to perform video encryption on the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binary encryption key.
Optionally, the code flow rate determination module is configured to:
according to the picture quality type of the video to be encrypted at a playing end, obtaining a video stream to be processed containing each quantized picture quality type;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed under the condition that the quantized video stream to be processed is not in the H.265 format to obtain a video stream in the H.265 format;
performing inverse quantization on the H.265 format video stream to generate a standby H.265 format video stream;
generating a narrowband subband sequence signal by converting the standby H.265 format video stream into a time-frequency domain representation;
and according to the bandwidth extension parameters contained in the video stream to be processed, applying the narrowband subband sequence signal and determining the code flow rate of each image quality type corresponding to the video to be encrypted.
Optionally, the code flow rate determination module is configured to:
determining a hole rate for hole convolution according to bandwidth expansion parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband sub-band sequence signal according to the hole convolution kernel to obtain a down-sampling video image;
and carrying out deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining the code flow rate of each image quality type corresponding to the video to be encrypted according to the video stream to be processed and the deconvolution image.
Optionally, the code flow rate determination module is configured to:
calculating a Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman characteristic image according to the size of a preset window and a preset step length, and calculating the average value of characteristic values of the Hardman characteristic image covered by the code stream mask;
and forming a code stream sequence by the average values according to the covering sequence of the code stream mask to obtain the code stream rate of each image quality type corresponding to the video to be encrypted.
Optionally, the code flow rate determining module is configured to send, before the step of determining, according to the image quality type of the video to be encrypted at a playing end, the code flow rate of each image quality type corresponding to the video to be encrypted for the obtained video to be encrypted, a corresponding video acquisition instruction to a video acquirer according to the image quality type of the playing end, where the video acquisition instruction is used by the video acquirer to acquire target videos of multiple definitions according to the definitions corresponding to the image quality types;
receiving a target video corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with multiple definitions to obtain a video to be restored;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the code flow rate determination module is configured to:
determining a foreground average brightness value and a background average brightness value corresponding to a foreground area and a background area in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset foreground brightness threshold value and a second brightness deviation value between the background average brightness and a preset background brightness threshold value;
if the first brightness deviation value is within a first preset deviation range and the second brightness deviation value is within a second preset deviation range, keeping the brightness of the current foreground area and the current background area, wherein the first preset deviation range and the second preset deviation range have a one-to-one correspondence relationship with the image quality type;
if the first brightness deviation value is not within the first preset deviation range or the second brightness deviation value is not within the second preset deviation range, adjusting the brightness of the foreground area in the video to be repaired or adjusting the brightness of the background area in the video to be repaired, so that the first brightness deviation value is within the first preset deviation range and the second brightness deviation value is within the second preset deviation range.
Optionally, the picture quality type includes at least one of standard picture quality, high definition picture quality, ultra high definition picture quality, or blue light picture quality.
In a third aspect of the embodiments of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method according to any one of the first aspect.
In a fourth aspect of the embodiments of the present invention, there is provided an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to carry out the steps of the method of any one of the first aspect when executing the executable instructions.
Advantageous effects
The invention provides a video encryption method, a video encryption device, a video encryption medium and video encryption equipment based on H.265 entropy coding binarization. Compared with the prior art, the method has the following beneficial effects:
according to the scheme, for the obtained video to be encrypted, the code flow rate of each image quality type corresponding to the video to be encrypted is determined according to the image quality type of the video to be encrypted at the playing end; according to the code flow rate corresponding to each image quality type, respectively cutting a video to be encrypted into a plurality of sub video packets to be encrypted in an H.265 format, wherein the data lengths of the sub video packets to be encrypted corresponding to each image quality type are different; determining a transmission weight corresponding to the picture quality type according to the data length of a plurality of sub video packets to be encrypted corresponding to the picture quality type, wherein the transmission weight is positively correlated with the data length; determining an encryption key matrix of a plurality of sub video packets to be encrypted corresponding to the picture quality type according to the similarity, transmission weight and a preset distribution function of the plurality of sub video packets to be encrypted corresponding to the picture quality type among adjacent video frames in the sub video packets, wherein the preset distribution function is a distribution function taking the numerical value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter; inputting an encryption key matrix of the H.265 format video sub-data packet to be encrypted, which corresponds to the picture quality type, into an entropy encoder so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key; and video encryption is carried out on the sub video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binary encryption key. The method is not only suitable for the video with low code rate, but also can balance the coding performance and improve the format compatibility, and is also suitable for the video with high code rate, so that the application range is improved, and the applicability is improved.
Drawings
Fig. 1 is a flowchart illustrating a video encryption method based on h.265 entropy coding binarization according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method of implementing step S11 of fig. 1 according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a method of implementing step S115 in fig. 2, according to an example embodiment.
Fig. 4 is a block diagram illustrating a video encryption apparatus based on h.265 entropy coding binarization according to an exemplary embodiment.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
Referring to fig. 1, fig. 1 is a flowchart illustrating a video encryption method based on h.265 entropy coding and binarization according to an exemplary embodiment, where the video encryption method based on h.265 entropy coding and binarization provided by the present invention can be applied to a transit terminal device, and the transit terminal device is connected between an intermediate layer of a telecommunication network structure of an operator and a user equipment, and can also be directly applied to the user equipment, and the method includes the following steps.
Step S11, determining the code flow rate of each image quality type corresponding to the video to be encrypted according to the image quality type of the video to be encrypted at a playing end aiming at the obtained video to be encrypted;
and S12, respectively cutting the video to be encrypted into a plurality of sub video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type.
The data lengths of the sub video packets to be encrypted corresponding to the image quality types are different;
step S13, determining a transmission weight corresponding to the picture quality type according to the data length of the plurality of sub video packets to be encrypted corresponding to the picture quality type, wherein the transmission weight is positively correlated with the data length;
step 14, determining an encryption key matrix for the plurality of sub-video packets to be encrypted corresponding to the image quality type according to the similarity between adjacent video frames of the plurality of sub-video packets to be encrypted corresponding to the image quality type, the transmission weight and a preset distribution function, wherein the preset distribution function is a distribution function taking a numerical value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
step S15, inputting the encryption key matrix of the H.265 format video sub-data packet corresponding to the picture quality type into an entropy encoder so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and S16, video encryption is carried out on the sub video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binary encryption key.
According to the scheme, for the obtained video to be encrypted, the code flow rate of each image quality type corresponding to the video to be encrypted is determined according to the image quality type of the video to be encrypted at the playing end; according to the code flow rate corresponding to each image quality type, respectively cutting a video to be encrypted into a plurality of sub video packets to be encrypted in an H.265 format, wherein the data lengths of the sub video packets to be encrypted corresponding to each image quality type are different; determining a transmission weight corresponding to the picture quality type according to the data length of a plurality of sub video packets to be encrypted corresponding to the picture quality type, wherein the transmission weight is positively correlated with the data length; determining an encryption key matrix of a plurality of sub video packets to be encrypted corresponding to the picture quality type according to the similarity, transmission weight and a preset distribution function of the plurality of sub video packets to be encrypted corresponding to the picture quality type among adjacent video frames in the sub video packets, wherein the preset distribution function is a distribution function taking the numerical value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter; inputting an encryption key matrix of the H.265 format video sub-data packet to be encrypted, which corresponds to the picture quality type, into an entropy encoder so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key; and performing video encryption on the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted by the binary encryption key. The method is not only suitable for the video with low code rate, but also suitable for the video with high code rate, and can balance the coding performance and improve the format compatibility, thereby improving the application range and further improving the applicability.
Optionally, referring to fig. 2, in step S11, the step of determining a bitrate of the video to be encrypted corresponding to each picture quality type according to the picture quality type of the video to be encrypted at the playing end includes:
in step S111, obtaining a quantized video stream to be processed including each of the image quality types according to the image quality type of the video to be encrypted at a playing end;
in step S112, determining whether the quantized video stream to be processed is in h.265 format, and performing format conversion on the quantized video stream to be processed to obtain a video stream in h.265 format if the quantized video stream to be processed is not in h.265 format;
in step S113, performing inverse quantization on the h.265 format video stream to generate a standby h.265 format video stream;
in step S114, a narrowband subband sequence signal is generated by converting the standby h.265 format video stream into a time-frequency domain representation;
in step S115, the narrowband subband sequence signal is applied according to the bandwidth extension parameter included in the video stream to be processed, and the bitrate of each picture quality type corresponding to the video to be encrypted is determined.
Optionally, referring to fig. 3, in step S115, the step of determining a bitrate of each picture quality type corresponding to the video to be encrypted by applying the narrowband subband sequence signal according to the bandwidth extension parameter included in the video stream to be processed includes:
in step S1151, determining a void rate for void convolution according to a bandwidth extension parameter included in the video stream to be processed;
in step S1152, generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband subband sequence signal according to the hole convolution kernel to obtain a downsampled video image;
in step S1153, performing deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining a code flow rate of each image quality type corresponding to the video to be encrypted according to the video stream to be processed and the deconvolution image.
Optionally, in step S1153, the step of obtaining a bitrate of the video to be encrypted corresponding to each picture quality type according to the video stream to be processed and the deconvolution image includes:
calculating a Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman characteristic image according to the size of a preset window and a preset step length, and calculating the average value of the characteristic values of the Hardman characteristic image covered by the code stream mask;
and forming a code stream sequence by the average values according to the covering sequence of the code stream mask to obtain the code stream rate of each image quality type corresponding to the video to be encrypted.
Optionally, before the step of determining, for the obtained video to be encrypted, a bitrate of each picture quality type corresponding to the video to be encrypted according to the picture quality type of the video to be encrypted at a playing end, the method includes:
sending a corresponding video acquisition instruction to a video acquisition device according to the image quality type of the playing end, wherein the video acquisition instruction is used for the video acquisition device to acquire target videos with a plurality of definitions according to the definitions corresponding to the image quality type;
receiving a target video corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with multiple definitions to obtain a video to be restored;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the step of performing luminance restoration processing on the video to be restored to obtain the video to be encrypted includes:
determining a foreground average brightness value and a background average brightness value corresponding to a foreground area and a background area in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset foreground brightness threshold value and a second brightness deviation value between the background average brightness and a preset background brightness threshold value;
if the first brightness deviation value is within a first preset deviation range and the second brightness deviation value is within a second preset deviation range, keeping the brightness of the current foreground area and the current background area, wherein the first preset deviation range and the second preset deviation range have a one-to-one correspondence relationship with the image quality type;
if the first brightness deviation value is not within the first preset deviation range or the second brightness deviation value is not within the second preset deviation range, adjusting the brightness of the foreground area in the video to be repaired or adjusting the brightness of the background area in the video to be repaired so that the first brightness deviation value is within the first preset deviation range and the second brightness deviation value is within the second preset deviation range.
Optionally, the picture quality type includes at least one of standard picture quality, high definition picture quality, ultra-high definition picture quality, or blue light picture quality.
The embodiment of the invention also provides a video encryption device based on H.265 entropy coding and binarization, which is shown in figure 4. The apparatus 400 comprises:
the bitrate determining module 410 is configured to determine, for an obtained video to be encrypted, a bitrate of each picture quality type corresponding to the video to be encrypted according to the picture quality type of the video to be encrypted at a playing end;
a video splitting module 420 configured to split the video to be encrypted into a plurality of h.265 format sub-video packets to be encrypted according to the code flow rate corresponding to each of the image quality types, where data lengths of the sub-video packets to be encrypted corresponding to the image quality types are different;
a transmission weight module 430, configured to determine a transmission weight corresponding to the picture quality type according to the data length of the sub video packets to be encrypted corresponding to the picture quality type, where the transmission weight is positively correlated to the data length;
a key matrix module 440, configured to perform encryption key matrix determination on the plurality of sub-video packets to be encrypted corresponding to the picture quality type according to similarity between adjacent video frames in the sub-video packets of the plurality of sub-video packets to be encrypted corresponding to the picture quality type, the transmission weight, and a preset distribution function, where the preset distribution function is a distribution function that takes a value of similarity between a preset bandwidth and the adjacent video frames as an input parameter;
the input module 450 is configured to input the encryption key matrix of the h.265 format to-be-video subpacket corresponding to the picture quality type into an entropy encoder, so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and the encryption module 460 is configured to perform video encryption on the sub video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binary encryption key.
The device is not only suitable for the video with low code rate, but also suitable for the video with high code rate, can balance the coding performance and improve the format compatibility, and improves the application range, thereby improving the applicability.
Optionally, the code flow rate determining module 410 is configured to:
according to the picture quality type of the video to be encrypted at a playing end, obtaining a video stream to be processed containing each quantized picture quality type;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed under the condition that the quantized video stream to be processed is not in the H.265 format to obtain a video stream in the H.265 format;
inversely quantizing the H.265 format video stream to generate a standby H.265 format video stream;
generating a narrowband subband sequence signal by converting the standby H.265 format video stream into a time-frequency domain representation;
and according to the bandwidth extension parameters contained in the video stream to be processed, applying the narrowband subband sequence signal and determining the code flow rate of each image quality type corresponding to the video to be encrypted.
Optionally, the code flow rate determining module 410 is configured to:
determining a void rate for void convolution according to bandwidth extension parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband sub-band sequence signal according to the hole convolution kernel to obtain a down-sampling video image;
and carrying out deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining the code flow rate of each image quality type corresponding to the video to be encrypted according to the video stream to be processed and the deconvolution image.
Optionally, the code flow rate determining module 410 is configured to:
calculating a Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman characteristic image according to the size of a preset window and a preset step length, and calculating the average value of the characteristic values of the Hardman characteristic image covered by the code stream mask;
and forming a code stream sequence by the average values according to the covering sequence of the code stream mask to obtain the code stream rate of each image quality type corresponding to the video to be encrypted.
Optionally, the code flow rate determining module 410 is configured to, before the step of determining, for the obtained video to be encrypted, a code flow rate of each image quality type corresponding to the video to be encrypted according to the image quality type of the video to be encrypted at a playing end, send a corresponding video acquisition instruction to a video acquirer according to the image quality type of the playing end, where the video acquisition instruction is used by the video acquirer to acquire target videos of multiple definitions according to the definitions corresponding to the image quality types;
receiving a target video corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with multiple definitions to obtain a video to be restored;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the code flow rate determining module 410 is configured to:
determining a foreground average brightness value and a background average brightness value corresponding to a foreground area and a background area in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset foreground brightness threshold value and a second brightness deviation value between the background average brightness and a preset background brightness threshold value;
if the first brightness deviation value is within a first preset deviation range and the second brightness deviation value is within a second preset deviation range, keeping the brightness of the current foreground area and the current background area, wherein the first preset deviation range and the second preset deviation range have a one-to-one correspondence relationship with the image quality type;
if the first brightness deviation value is not within the first preset deviation range or the second brightness deviation value is not within the second preset deviation range, adjusting the brightness of the foreground area in the video to be repaired or adjusting the brightness of the background area in the video to be repaired, so that the first brightness deviation value is within the first preset deviation range and the second brightness deviation value is within the second preset deviation range.
Optionally, the picture quality type includes at least one of standard picture quality, high definition picture quality, ultra high definition picture quality, or blue light picture quality.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method of any of the preceding embodiments.
An embodiment of the present invention further provides an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to carry out the steps of the method of any one of the preceding embodiments when executing the executable instructions.
In light of the foregoing description of the preferred embodiments according to the present application, it is to be understood that various changes and modifications may be made without departing from the spirit and scope of the invention. The technical scope of the present application is not limited to the contents of the specification, and must be determined according to the scope of the claims.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (10)

1. A video encryption method based on H.265 entropy coding binarization is characterized by comprising the following steps:
determining the code flow rate of each image quality type corresponding to the video to be encrypted according to the image quality type of the video to be encrypted at a playing end aiming at the obtained video to be encrypted;
according to the code flow rate corresponding to each image quality type, the video to be encrypted is respectively cut into a plurality of sub video packets to be encrypted in an H.265 format, wherein the data lengths of the sub video packets to be encrypted corresponding to the image quality types are different;
determining a transmission weight corresponding to the picture quality type according to the data length of the plurality of sub video packets to be encrypted corresponding to the picture quality type, wherein the transmission weight is positively correlated with the data length;
determining an encryption key matrix of a plurality of sub video packets to be encrypted corresponding to the picture quality type according to the similarity between adjacent video frames of the plurality of sub video packets to be encrypted corresponding to the picture quality type in the sub video packets, the transmission weight and a preset distribution function, wherein the preset distribution function is a distribution function taking the numerical value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
inputting the encryption key matrix of the H.265 format video sub-data packet corresponding to the picture quality type into an entropy encoder so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and video encryption is carried out on the sub video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binary encryption key.
2. The method according to claim 1, wherein the step of determining the bitrate of the video to be encrypted corresponding to each picture quality type according to the picture quality type of the video to be encrypted at a playing end comprises:
according to the picture quality type of the video to be encrypted at a playing end, obtaining a video stream to be processed containing each quantized picture quality type;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed under the condition that the quantized video stream to be processed is not in the H.265 format to obtain a video stream in the H.265 format;
performing inverse quantization on the H.265 format video stream to generate a standby H.265 format video stream;
generating a narrowband subband sequence signal by converting the standby H.265 format video stream into a time-frequency domain representation;
and according to the bandwidth extension parameters contained in the video stream to be processed, applying the narrowband subband sequence signal and determining the code flow rate of each picture quality type corresponding to the video to be encrypted.
3. The method according to claim 2, wherein the step of determining the bitrate of the video to be encrypted corresponding to each picture quality type by applying the narrowband subband sequence signal according to the bandwidth extension parameter included in the video stream to be processed comprises:
determining a void rate for void convolution according to bandwidth extension parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband sub-band sequence signal according to the hole convolution kernel to obtain a down-sampling video image;
and performing deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining a code flow rate of the video to be encrypted corresponding to each image quality type according to the video stream to be processed and the deconvolution image.
4. The method according to claim 3, wherein the step of obtaining the bitrate of the video to be encrypted corresponding to each picture quality type according to the video stream to be processed and the deconvolution image comprises:
calculating a Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman characteristic image according to the size of a preset window and a preset step length, and calculating the average value of the characteristic values of the Hardman characteristic image covered by the code stream mask;
and forming a code stream sequence by the average values according to the covering sequence of the code stream mask to obtain the code stream rate of each image quality type corresponding to the video to be encrypted.
5. The method according to claim 1, wherein before the step of determining, for the obtained video to be encrypted, a bitrate corresponding to each picture quality type of the video to be encrypted according to the picture quality type of the video to be encrypted at a playing end, the method comprises:
sending a corresponding video acquisition instruction to a video acquisition device according to the image quality type of the playing end, wherein the video acquisition instruction is used for the video acquisition device to acquire target videos with a plurality of definitions according to the definitions corresponding to the image quality type;
receiving a target video corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with multiple definitions to obtain a video to be restored;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
6. The method according to claim 5, wherein the step of performing luminance restoration processing on the video to be restored to obtain the video to be encrypted includes:
determining a foreground average brightness value and a background average brightness value corresponding to a foreground area and a background area in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset foreground brightness threshold value and a second brightness deviation value between the background average brightness and a preset background brightness threshold value;
if the first brightness deviation value is within a first preset deviation range and the second brightness deviation value is within a second preset deviation range, keeping the brightness of the current foreground area and the current background area, wherein the first preset deviation range and the second preset deviation range have a one-to-one correspondence relationship with the image quality type;
if the first brightness deviation value is not within the first preset deviation range or the second brightness deviation value is not within the second preset deviation range, adjusting the brightness of the foreground area in the video to be repaired or adjusting the brightness of the background area in the video to be repaired, so that the first brightness deviation value is within the first preset deviation range and the second brightness deviation value is within the second preset deviation range.
7. The method of any one of claims 1-6, wherein the type of picture quality comprises at least one of a standard picture quality, a high definition picture quality, an ultra high definition picture quality, or a blue picture quality.
8. An apparatus for video encryption based on H.265 entropy coding binarization, the apparatus comprising:
the code flow rate determining module is configured to determine, according to the image quality type of the video to be encrypted at a playing end, the code flow rate of each image quality type corresponding to the video to be encrypted, for the obtained video to be encrypted;
the video cutting module is configured to cut the video to be encrypted into a plurality of sub-video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type, wherein the data lengths of the sub-video packets to be encrypted corresponding to the image quality types are different;
a transmission weight module configured to determine a transmission weight corresponding to the picture quality type according to the data length of the plurality of sub video packets to be encrypted corresponding to the picture quality type, wherein the transmission weight is positively correlated to the data length;
a key matrix module configured to perform encryption key matrix determination on a plurality of sub-video packets to be encrypted corresponding to the picture quality type through similarity between adjacent video frames of the plurality of sub-video packets to be encrypted corresponding to the picture quality type in the sub-video packets, the transmission weight, and a preset distribution function, wherein the preset distribution function is a distribution function using a value of similarity between a preset bandwidth and the adjacent video frames as an input parameter;
the input module is configured to input the encryption key matrix of the h.265 format to-be-video sub-data packet corresponding to the picture quality type into an entropy encoder, so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and the encryption module is configured to perform video encryption on the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binary encryption key.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to carry out the steps of the method of any one of claims 1 to 7 when executing the executable instructions.
CN202211454317.3A 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization Active CN115834926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211454317.3A CN115834926B (en) 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211454317.3A CN115834926B (en) 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization

Publications (2)

Publication Number Publication Date
CN115834926A true CN115834926A (en) 2023-03-21
CN115834926B CN115834926B (en) 2023-11-21

Family

ID=85529526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211454317.3A Active CN115834926B (en) 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization

Country Status (1)

Country Link
CN (1) CN115834926B (en)

Citations (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2363273A1 (en) * 1999-02-15 2000-08-24 Digital Accelerator Corporation Method and system of region-based image coding with dynamic streaming of code blocks
US20040196972A1 (en) * 2003-04-01 2004-10-07 Bin Zhu Scalable, error resilient DRM for scalable media
CN101710852A (en) * 2009-11-06 2010-05-19 北京交通大学 LDPC code encoding/decoding method and encoder/decoder with encryption function
KR20100054697A (en) * 2008-11-14 2010-05-25 한국전자통신연구원 Encryption method for data and decryption method therefor
US20120082343A1 (en) * 2009-04-15 2012-04-05 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Detecting a change between images or in a sequence of images
CN103546750A (en) * 2013-10-22 2014-01-29 中国人民解放军重庆通信学院 H.264 video encryption method based on region of interest
US20140105390A1 (en) * 2012-08-30 2014-04-17 Tencent Technology (Shenzhen), Co., Ltd. Video file encryption and decryption method, device, and mobile terminal
JP2014093569A (en) * 2012-10-31 2014-05-19 Toshiba Corp Information processing device, control method, and control program
CN105791979A (en) * 2014-12-26 2016-07-20 深圳Tcl数字技术有限公司 Video file processing method and display device
KR101646072B1 (en) * 2015-04-22 2016-08-05 유승진 Encryption apparatus and method for moving picture data
CN105939484A (en) * 2016-06-14 2016-09-14 深圳创维数字技术有限公司 Audio/video encrypted playing method and system thereof
CN108650510A (en) * 2018-05-10 2018-10-12 中南大学 The coding method of video and device, storage medium, electronic device
CN108833924A (en) * 2018-06-22 2018-11-16 东北大学 It is a kind of based on more security level video encryption algorithms H.265
CN109167999A (en) * 2018-09-04 2019-01-08 宁波工程学院 A kind of HEVC video-encryption and decryption method
CN109391846A (en) * 2017-08-07 2019-02-26 浙江宇视科技有限公司 A kind of video scrambling method and device of adaptive model selection
CN109788160A (en) * 2018-12-13 2019-05-21 平安科技(深圳)有限公司 Image transfer method, device, electronic equipment and storage medium
CN111052748A (en) * 2017-07-06 2020-04-21 弗劳恩霍夫应用研究促进协会 Segmented video streaming concept
CN111083425A (en) * 2019-11-25 2020-04-28 视联动力信息技术股份有限公司 Video stream processing method and device, server, electronic equipment and storage medium
US20200296362A1 (en) * 2019-03-15 2020-09-17 Mux, Inc. Method for generating video- and audience-specific encoding ladders
CN112243127A (en) * 2020-09-30 2021-01-19 江苏大学 HEVC video encryption method based on region of interest
CN112312231A (en) * 2019-07-31 2021-02-02 北京金山云网络技术有限公司 Video image coding method and device, electronic equipment and medium
CN112491532A (en) * 2020-12-03 2021-03-12 珠海格力电器股份有限公司 Video data encryption method and device, storage medium and electronic equipment
CN112689195A (en) * 2020-12-22 2021-04-20 中国传媒大学 Video encryption method, distributed encryption system, electronic device and storage medium
CN112929679A (en) * 2021-01-18 2021-06-08 广州虎牙科技有限公司 Method and device for detecting legality of live client and identifying plug-in behavior
CN113034334A (en) * 2021-03-22 2021-06-25 绍兴聚量数据技术有限公司 Encryption image reversible information hiding method and device combining JPEG and Huffman coding
CN113114619A (en) * 2021-03-02 2021-07-13 杭州海康威视数字技术股份有限公司 Video identification analysis method, device and system based on Handle system
CN113347421A (en) * 2021-06-02 2021-09-03 黑芝麻智能科技(上海)有限公司 Video encoding and decoding method, device and computer equipment
CN114363638A (en) * 2021-12-08 2022-04-15 慧之安信息技术股份有限公司 Video encryption method based on H.265 entropy coding binarization

Patent Citations (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2363273A1 (en) * 1999-02-15 2000-08-24 Digital Accelerator Corporation Method and system of region-based image coding with dynamic streaming of code blocks
US20040196972A1 (en) * 2003-04-01 2004-10-07 Bin Zhu Scalable, error resilient DRM for scalable media
KR20100054697A (en) * 2008-11-14 2010-05-25 한국전자통신연구원 Encryption method for data and decryption method therefor
US20120082343A1 (en) * 2009-04-15 2012-04-05 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Detecting a change between images or in a sequence of images
CN101710852A (en) * 2009-11-06 2010-05-19 北京交通大学 LDPC code encoding/decoding method and encoder/decoder with encryption function
US20140105390A1 (en) * 2012-08-30 2014-04-17 Tencent Technology (Shenzhen), Co., Ltd. Video file encryption and decryption method, device, and mobile terminal
JP2014093569A (en) * 2012-10-31 2014-05-19 Toshiba Corp Information processing device, control method, and control program
CN103546750A (en) * 2013-10-22 2014-01-29 中国人民解放军重庆通信学院 H.264 video encryption method based on region of interest
CN105791979A (en) * 2014-12-26 2016-07-20 深圳Tcl数字技术有限公司 Video file processing method and display device
KR101646072B1 (en) * 2015-04-22 2016-08-05 유승진 Encryption apparatus and method for moving picture data
CN105939484A (en) * 2016-06-14 2016-09-14 深圳创维数字技术有限公司 Audio/video encrypted playing method and system thereof
CN111052748A (en) * 2017-07-06 2020-04-21 弗劳恩霍夫应用研究促进协会 Segmented video streaming concept
CN109391846A (en) * 2017-08-07 2019-02-26 浙江宇视科技有限公司 A kind of video scrambling method and device of adaptive model selection
CN108650510A (en) * 2018-05-10 2018-10-12 中南大学 The coding method of video and device, storage medium, electronic device
CN108833924A (en) * 2018-06-22 2018-11-16 东北大学 It is a kind of based on more security level video encryption algorithms H.265
CN109167999A (en) * 2018-09-04 2019-01-08 宁波工程学院 A kind of HEVC video-encryption and decryption method
CN109788160A (en) * 2018-12-13 2019-05-21 平安科技(深圳)有限公司 Image transfer method, device, electronic equipment and storage medium
US20200296362A1 (en) * 2019-03-15 2020-09-17 Mux, Inc. Method for generating video- and audience-specific encoding ladders
CN112312231A (en) * 2019-07-31 2021-02-02 北京金山云网络技术有限公司 Video image coding method and device, electronic equipment and medium
CN111083425A (en) * 2019-11-25 2020-04-28 视联动力信息技术股份有限公司 Video stream processing method and device, server, electronic equipment and storage medium
CN112243127A (en) * 2020-09-30 2021-01-19 江苏大学 HEVC video encryption method based on region of interest
CN112491532A (en) * 2020-12-03 2021-03-12 珠海格力电器股份有限公司 Video data encryption method and device, storage medium and electronic equipment
CN112689195A (en) * 2020-12-22 2021-04-20 中国传媒大学 Video encryption method, distributed encryption system, electronic device and storage medium
CN112929679A (en) * 2021-01-18 2021-06-08 广州虎牙科技有限公司 Method and device for detecting legality of live client and identifying plug-in behavior
CN113114619A (en) * 2021-03-02 2021-07-13 杭州海康威视数字技术股份有限公司 Video identification analysis method, device and system based on Handle system
CN113034334A (en) * 2021-03-22 2021-06-25 绍兴聚量数据技术有限公司 Encryption image reversible information hiding method and device combining JPEG and Huffman coding
CN113347421A (en) * 2021-06-02 2021-09-03 黑芝麻智能科技(上海)有限公司 Video encoding and decoding method, device and computer equipment
CN114363638A (en) * 2021-12-08 2022-04-15 慧之安信息技术股份有限公司 Video encryption method based on H.265 entropy coding binarization

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ASGHAR, MN等: "Sufficient encryption based on entropy coding syntax elements of H.264/SVC", MULTIMEDIA TOOLS AND APPLICATIONS, vol. 74, no. 23, XP035924348, DOI: 10.1007/s11042-014-2160-6 *
MOUSA FARAJALLAH等: "Selective Encryption of the Versatile Video Coding Standard", IEEE ACCESS, vol. 10 *
廉士国, 孙金生, 王执铨: "视频加密算法及其发展现状", 信息与控制, no. 05 *
张潆元: "基于H.265的部分视频加密技术", CNKI优秀硕士学位论文全文库, no. 2 *

Also Published As

Publication number Publication date
CN115834926B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
CN106937121B (en) Image decoding and encoding method, decoding and encoding device, decoder and encoder
US10237576B2 (en) 3D-HEVC depth video information hiding method based on single-depth intra mode
JP5034089B2 (en) Method for enabling determination of compression and protection parameters for multimedia data transmission over a wireless data channel
US20080123749A1 (en) Method of transmitting at varying bit rates through a transmission channel
US11418802B2 (en) Video decoder memory optimization
WO2008047865A1 (en) Image quality evaluation method, image quality evaluation system and image quality evaluation program
CN107343202B (en) Feedback-free distributed video coding and decoding method based on additional code rate
Comas et al. Rate-distortion optimization in a robust video transmission based on unbalanced multiple description coding
CN108347607B (en) Embedded video compression method with fixed code rate and based on lines and image processing equipment
CN115834926B (en) Video encryption method based on H.265 entropy coding binarization
Barannik et al. Technology of Composite Code Forming in The Spatial-Spectral Description Significant Microsegments
WO2015106383A1 (en) Method for assessing video quality and related device
CN101296166B (en) Method for measuring multimedia data based on index
Grangetto et al. Ensuring quality of service for image transmission: hybrid loss protection
Usman et al. Exploiting the spatio-temporal attributes of HD videos: A bandwidth efficient approach
CN116982082A (en) Image encoding/decoding method, encoder, decoder, and storage medium
CN112887714A (en) Video coding bit resource reallocation method
CN101316198B (en) Monitoring method for multimedia data based on index
KR100365118B1 (en) Apparatus and method for dithering and compressing data of dynamic picture image
US10750168B2 (en) Image encoding and decoding method, encoding and decoding device and corresponding computer programs
KR20190066691A (en) Method for transmitting and receiving compressed data and apparatus using the same
CN116761023A (en) Video transmission method between different devices
US20240121392A1 (en) Neural-network media compression using quantized entropy coding distribution parameters
CN110099279B (en) Method for adjusting lossy compression based on hardware
Akbari et al. A novel robust image transmission scheme over lossy channel using data hiding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant