CN112672167B - Video processing method, computer device, and storage medium - Google Patents

Video processing method, computer device, and storage medium Download PDF

Info

Publication number
CN112672167B
CN112672167B CN202011384342.XA CN202011384342A CN112672167B CN 112672167 B CN112672167 B CN 112672167B CN 202011384342 A CN202011384342 A CN 202011384342A CN 112672167 B CN112672167 B CN 112672167B
Authority
CN
China
Prior art keywords
frame
fingerprint
code stream
video
fingerprint image
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.)
Active
Application number
CN202011384342.XA
Other languages
Chinese (zh)
Other versions
CN112672167A (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.)
Guangzhou Kuvision Digital Technology Co ltd
Original Assignee
Guangzhou Kuvision Digital Technology 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 Guangzhou Kuvision Digital Technology Co ltd filed Critical Guangzhou Kuvision Digital Technology Co ltd
Priority to CN202011384342.XA priority Critical patent/CN112672167B/en
Publication of CN112672167A publication Critical patent/CN112672167A/en
Application granted granted Critical
Publication of CN112672167B publication Critical patent/CN112672167B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application provides a video processing method, a computer device and a storage medium, wherein the method comprises the following steps: acquiring a video, wherein the video comprises an I frame, a B frame and a P frame, and a reference frame of the B frame comprises a forward frame and/or a backward frame; determining whether a non-reference B frame exists for the video, the non-reference B frame being a B frame that is not referenced by other frames in the video; and replacing at least one non-reference B frame with a fingerprint code stream embedded with fingerprint information to obtain a video containing the fingerprint code stream. The video processed by the method is decoded, and the person who is an illegal propagator is known according to the fingerprint information embedded in the fingerprint code stream, so that the video product is effectively protected, the fair competition of the market is maintained, and the legal rights and interests of producers are protected.

Description

Video processing method, computer device, and storage medium
Technical Field
The present disclosure relates to the field of video processing technologies, and in particular, to a video processing method, a computer device, and a storage medium.
Background
With the rapid development of networks and information technologies, pay television channels, pay network videos, pay lectures and other videos are increasing, and how to protect pay video content from illegal distribution becomes the first thing of content providers.
The movie is now added with digital watermarks, unique codes which cannot be seen by naked eyes are added, the unique codes are read out through a special decoder, the special codes identify which cinema, which hall and which time are in piracy, the manufacturing cost is high, the direction difference of the digital watermarks with the protection video content of pay television channels and the like is very large, the content provider pays attention to whether the content is protected or not and can find out who is transmitted when illegally transmitted in terms of the pay television channels, but the prior art needs a special player or decoder, which is unfavorable for protecting the legal rights of the video, easily generates the extreme condition of expelling bad coins, influences the market benefits of video producers and is unfavorable for the healthy development of social technology.
Based on the technical problems in the prior art, the inventor of the present application proposes a video encoding method, a computer device and a storage medium.
Disclosure of Invention
The application provides a video processing method, computer equipment and a storage medium, which are used for processing videos, so that effective protection of video products is realized, fair competition of markets is maintained, and legal rights of producers are protected.
In a first aspect, an embodiment of the present application provides a video processing method, including:
acquiring a video, wherein the video comprises an I frame, a B frame and a P frame, and a reference frame of the B frame comprises a forward frame and/or a backward frame;
determining whether a non-reference B frame exists for the video, the non-reference B frame being a B frame that is not referenced by other frames in the video;
and replacing at least one non-reference B frame with a fingerprint code stream embedded with fingerprint information to obtain a video containing the fingerprint code stream.
In a second aspect, embodiments of the present application provide a computer device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor is configured to execute the computer program and implement the video processing method described above when the computer program is executed.
In a third aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, which when executed by a processor causes the processor to implement the method described above.
The embodiment of the application provides a video processing method, computer equipment and storage medium, wherein the video comprises an I frame, a B frame and a P frame by acquiring the video, wherein a reference frame of the B frame comprises a forward frame and/or a backward frame; determining whether a non-reference B frame exists for the video, the non-reference B frame being a B frame that is not referenced by other frames in the video; and replacing at least one non-reference B frame with a fingerprint code stream embedded with fingerprint information to obtain a video containing the fingerprint code stream. The video processed by the method is decoded, and the person who is an illegal propagator is known according to the fingerprint information embedded in the fingerprint code stream, so that the video product is effectively protected, the fair competition of the market is maintained, and the legal rights and interests of producers are protected.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure of embodiments of the present application.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a video processing method according to an embodiment of the present application;
FIG. 2 is a schematic illustration of a fingerprint image;
FIGS. 3A-3F are schematic diagrams showing fingerprint information when decoding a fingerprint code stream;
FIG. 4 is a schematic diagram of setting RGB values of a pixel point by a dot matrix;
FIG. 5 is a flow chart of a video processing method according to an embodiment;
fig. 6 is a schematic block diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart of a video processing method according to an embodiment of the present application. The video processing method can be applied to computer equipment, such as terminal equipment or a server, and is used for setting digital fingerprints and other processes on videos; the terminal equipment can be electronic equipment such as a cable television set top box, a network television set top box, a mobile phone, a tablet personal computer, a notebook computer, a desktop computer, a video shooting device, a video encoding device and the like; the servers may be independent servers or may be server clusters.
By way of example, the computer device may include hardware encoders and/or software encoders, including, for example, mpeg2, H263, H264, avs +, vc-1, H265, H266, avs2, avs3, etc., and the frames that may be employed encode video images for intra prediction, inter prediction, transformation, quantization.
For ease of description, the present application uses a higher complexity avs encoder, encoded data in yuv420p10le format for illustration.
As shown in fig. 1, the video processing method in the embodiment of the present application includes steps S110 to S130.
S110, acquiring a video, wherein the video comprises an I frame, a B frame and a P frame, and the reference frame of the B frame comprises a forward frame and/or a backward frame.
In the technical field, a frame coded by intra-frame prediction is simply called an I frame; the frames coded by inter-frame prediction include P frames and B frames, wherein the B frames include B frames that can be referred to and B frames that are not referred to, the P frames can refer to forward frames, and the B frames can refer to only forward frames, only backward frames, and both forward and backward frames. For I frames, P frames, B frames, each frame may be divided into a plurality of slices, or there may be only one slice, and each slice may be divided into W (wide) x H (high) macro blocks/LCUs, and then each macro block/LCU is encoded sequentially. For example, in mpeg2, H263, H264, avs + encoders, w×h may be 16×16, whereas in H265, avs, etc. encoders w×h may be 64×64 at maximum. It can be understood that the Macroblock (MB) is a coding unit in an encoder such as 261,263, AVS, etc., and the LCU (maximum coding unit) is a coding unit in an encoder such as AVS2, etc.
S120, determining whether a non-reference B frame exists in the video, wherein the non-reference B frame is a B frame which is not referred to by other frames in the video.
Specifically, the non-reference B frame is a frame that is not referred to or cited by other frames.
In some implementations, non-reference B frames in video can be determined by: analyzing the code stream data of the video to obtain multi-frame data; searching whether a video sequence starting code exists or not from the multi-frame data according to the code stream sequence, wherein if the video sequence starting code exists, then if the non-reference B frame exists, executing the next step; if the video sequence start code does not exist, then finding whether the video sequence start code exists in the next frame or not until the video sequence start code is found; and then stopped if it is determined that there is no non-reference B frame.
For example, sequence information of the code stream data of the avs encoder is obtained first. Analyzing the code stream to obtain frame data of one frame, sequentially reading one frame, searching whether 0x000001B0 (avs encoder video sequence start code) exists in the code stream data, and if not, continuously reading the next frame to continue searching until finding; if the avs encoder video sequence start code has not been found, then it is said that the code stream is not a avs code stream; if the avs encoder video sequence start code is found, the code stream data analysis is performed, the sequence header information therein is analyzed to obtain a profile_id (level), a level_id (level), a progressive_sequence (progressive sequence), a horizontal_size (horizontal size), a chroma_format (chroma format), a sample_precision (sample precision), a frame_rate_code (frame rate code), a sample_adaptive_offset_enable_flag (adaptive correction filter enable flag), a cross_slice_flag (cross band loop filter), a lcu _size (maximum coding unit size), and reference frame parameters such as a reference_by_flag (frame rate code), a sample_adaptive_offset_enable_flag (adaptive correction filter_enable flag), a cross_slice_flag (cross band loop filter), a reference_picture_number (frame number), and the like.
Illustratively, it may be determined whether the current B-frame is a non-reference B-frame based on a reference frame parameter, such as a referenced_by_other_flag.
If the start code of the avs2 encoder video sequence is found, a non-reference B frame meeting the condition of replacing the fingerprint code stream is searched in the avs code stream sequence.
S130, replacing at least one non-reference B frame with a fingerprint code stream embedded with fingerprint information to obtain a video containing the fingerprint code stream.
The fingerprint code stream is embedded with fingerprint information, which may for example comprise at least one of the following: the pay television channel CA card number, pay network video, and/or user name used by the pay lecture is of course not limited thereto. For the video containing the fingerprint code stream, the content provider of the video can be confirmed according to the fingerprint information in the fingerprint code stream, so that the user can know who is an illegal propagator, thereby realizing effective protection of video products, maintaining fair competition of markets and protecting legal rights and interests of producers. For example, the fingerprint information embedded in the fingerprint code stream can be encoded and displayed by decoding the fingerprint code stream, and the provider of illegally propagating video content can be known to the encrypted content provider by querying the corresponding pay television channel CA card number, pay network video, and user name used by the pay lecture through the decoded fingerprint information.
In some embodiments, the fingerprint code stream embedded with the fingerprint information may be encoded from a fingerprint image. Specifically, the fingerprint code stream may be obtained by encoding a fingerprint image.
Illustratively, as shown in fig. 2, the area ABCD is a fingerprint image, and the rest of the EFGH except the area ABCD is referred to as an image of a non-fingerprint area, which is a virtual image according to horizontal_size and vertical_size, and which is image data referencing a reference frame. Fig. 3A-3F are schematic diagrams of fingerprint information displayed when decoding a fingerprint code stream under different conditions.
Correspondingly, when judging whether the B frame can be replaced or not, the embodiment exits to perform the next frame judgment if the B frame is not an unreferenced non-reference B frame; wherein a non-reference B frame is a condition under which this B frame can be replaced.
For example, if the data amount (bytes) of the data portion of the non-reference B frame (i.e., the data amount of the stream data of the non-reference B frame minus the header data amount of the non-reference B frame) is equal to or greater than the data amount of the fingerprint code stream, it is determined that the non-reference B frame can be replaced, and the non-reference B frame is replaced with the fingerprint code stream embedded with the fingerprint information to obtain the video including the fingerprint code stream.
After the non-reference B frame is replaced with the fingerprint code stream, the format of the non-reference B frame code stream data is as follows: firstly, the original head of the non-reference B frame is provided, then the code stream of the fingerprint code stream is provided, finally, 0x00 data is filled, and the number of 0x00 bytes is the data volume of the data part of the non-reference B frame minus the data volume of the fingerprint code stream.
In some embodiments, the non-reference B frames that need replacement may be determined according to a preset period. For example, every 0.5 minute, one minute, two minutes or other period of time, or dynamically set according to customer requirements, a non-reference B frame is determined to be a non-reference B frame that needs to be replaced, and the non-reference B frame is replaced with a fingerprint code stream embedded with fingerprint information. Of course, the non-periodic manner may be set randomly, which is not limited herein.
Generating a fingerprint image according to preset fingerprint information, wherein the fingerprint image is generated according to the preset fingerprint information. The fingerprint information may be, but is not limited to, a pay television channel CA card number, pay network video, a user name for pay lecture, it is readily understood that the fingerprint information may be a specific string or graphic specified by the content provider; as shown in fig. 4, for example, when avs is used for encoding, numbers and letters are set to RGB values of pixels through a dot matrix, and then the RGB values are converted into a 10bit 420 fingerprint image; the width and height of the 10bit 420 fingerprint image after conversion are amplified to be a multiple of the maximum LCU (maximum coding unit) of avs 2. Meanwhile, the position (x, y) of the fingerprint image in the upper left corner of the image obtained by decoding the fingerprint code stream is a multiple of the maximum LCU (maximum coding unit).
In some embodiments, the position corresponding to the preset fingerprint region in the fingerprint code stream is a code stream of the fingerprint image, the position outside the fingerprint image in the fingerprint code stream is a preset code stream, and the preset code stream is used for generating an image of the corresponding position after the fingerprint code stream is decoded according to the image of the corresponding position in the target frame when the fingerprint code stream is decoded; wherein the target frame is a reference frame of a non-reference B frame that needs replacement.
For example, when decoding a fingerprint code stream, the code stream of the fingerprint image is decoded to obtain an image of a fingerprint region as in fig. 3A-3F, and when decoding a position outside the fingerprint image in the fingerprint code stream, the image of the corresponding position after decoding the fingerprint code stream, that is, the image of a non-fingerprint region, is generated according to the image of the corresponding position in the target frame. Illustratively, the image of the non-fingerprint region is determined from the forward reference frame and/or the backward reference frame of the non-reference B frame that is replaced as needed.
For example, when the fingerprint image is encoded, the encoding mode of the macroblock/LCU corresponding to the fingerprint image is an intra-frame encoding type. So as to decode the code stream of the fingerprint image to obtain the fingerprint image.
The preset code stream is used for indicating the inter-frame coding type of the macro block/LCU outside the fingerprint image as zero residual, so that the image at the corresponding position after the fingerprint code stream is decoded is generated according to the image at the corresponding position in the target frame during decoding.
In some embodiments, the encoding the fingerprint image to obtain the code stream of the fingerprint image includes the following steps: coding the fingerprint image based on coding parameters used in the process of coding the non-reference B frame needing to be replaced to obtain a code stream of the fingerprint image; writing a preset code stream into a macro block/LCU outside a fingerprint image in the fingerprint code stream, wherein the preset code stream is used for generating an image of a corresponding position after the fingerprint code stream is decoded according to the image of the corresponding position in a target frame when the fingerprint code stream is decoded; the target frame is a reference frame of a non-reference B frame that needs replacement.
Illustratively, the encoding the fingerprint image based on the encoding parameters used in the encoding of the non-reference B frame that needs to be replaced, to obtain a code stream of the fingerprint image includes: performing preset adjustment on coding parameters used in the process of coding the non-reference B frames to be replaced to obtain a code stream of the fingerprint image; encoding the fingerprint image based on preset and adjusted encoding parameters; the preset adjustment is used for enabling the encoding of the fingerprint image and the encoding of the macro block/LCU outside the fingerprint image in the fingerprint code stream not to be affected mutually.
The coding parameters are preset and adjusted, so that the coding in the fingerprint area and the coding outside the fingerprint area are not affected, the predicted value of the predicted mode is a constant pixel value no matter how the video content changes, the fingerprint image embedded with the unique fingerprint can be displayed by decoding, and according to the unique fingerprint, the fingerprint can comprise the unique information of the CA card number of the pay television channel, the pay network video and the user name used by the pay lecture, so that the user can know who illegally propagates the video content needing protection and charge.
According to the video processing method, a video is obtained, wherein the video comprises an I frame, a B frame and a P frame, and a reference frame of the B frame comprises a forward frame and/or a backward frame; determining whether a non-reference B frame exists for the video, the non-reference B frame being a B frame that is not referenced by other frames in the video; and replacing at least one non-reference B frame with a fingerprint code stream embedded with fingerprint information to obtain a video containing the fingerprint code stream. The video processed by the method is decoded, and the person who is an illegal propagator is known according to the fingerprint information embedded in the fingerprint code stream, so that the video product is effectively protected, the fair competition of the market is maintained, and the legal rights and interests of producers are protected.
In some embodiments, referring to fig. 5 in combination with the foregoing embodiments, the present embodiment may include the following steps S210-S260.
The video coding of the embodiment may be mpeg2, H263, H264, avs +, vc-1, H265, avs, etc., the frames used are intra-frame prediction, inter-frame prediction, transformation, quantization, and the video image is coded by one frame, wherein some frames are coded by intra-frame prediction, which is called I-frame coding for short; some frames adopt inter-frame predictive coding, and P frames and B frames are coded, wherein the P frames are codes capable of referring to forward frames; b frames can refer to only forward frames, only backward frames and reference forward and backward bidirectional frames 3, while IPB frames can be divided into a plurality of slices, or only one slice, each slice can be divided into macro blocks/LCUs of W (width) x H (height), then each macro block/LCU is coded sequentially, and W x H is 16 x 16 in mpeg2, H263, H264, avs + encoders; whereas w×h in H265, avs2 may be 64×64 at maximum.
The method of the embodiment is suitable for various encoders, and according to the idea of the invention, the non-reference B frame can be quickly replaced by the fingerprint code stream embedded with the fingerprint information, for convenience of description, the method uses a avs2 encoder with higher complexity, and encoded data is in a yuv420p10le format to illustrate that a avs non-reference B frame is replaced by the fingerprint code stream embedded with the fingerprint information.
S210, obtaining sequence (sequence) header information of the avs code stream.
For example, sequence information of the code stream data of the avs encoder is obtained first. Analyzing the code stream to obtain frame data of one frame, sequentially reading one frame, searching whether 0x000001B0 (avs encoder video sequence start code) exists in the code stream data, and if not, continuously reading the next frame to continue searching until finding; if the avs encoder video sequence start code has not been found, then it is said that the code stream is not a avs code stream; if the avs encoder video sequence start code is found, the code stream data analysis is performed, the sequence header information therein is analyzed to obtain a profile_id (level), a level_id (level), a progressive_sequence (progressive sequence), a horizontal_size (horizontal size), a chroma_format (chroma format), a sample_precision (sample precision), a frame_rate_code (frame rate code), a sample_adaptive_offset_enable_flag (adaptive correction filter enable flag), a cross_slice_flag (cross band loop filter), a lcu _size (maximum coding unit size), and reference frame parameters such as a reference_by_flag (frame rate code), a sample_adaptive_offset_enable_flag (adaptive correction filter_enable flag), a cross_slice_flag (cross band loop filter), a reference_picture_number (frame number), and the like.
Illustratively, it may be determined whether the current B-frame is a non-reference B-frame based on a reference frame parameter, such as a referenced_by_other_flag.
If the start code of the avs2 encoder video sequence is found, a non-reference B frame meeting the condition of replacing the fingerprint code stream is searched in the avs code stream sequence.
S220, according to sequence header information of avs code stream, determining width, bit depth and chromaticity space of the corresponding image of the fingerprint code stream, and determining the position of the corresponding preset fingerprint area in the fingerprint code stream according to the preset fingerprint position (such as the upper left corner coordinate of the fingerprint image in the corresponding image of the fingerprint code stream).
For example, according to the sequence (sequence) header information of the avs code stream, the width and height of the image corresponding to the fingerprint code stream are determined as a multiple of the maximum LCU (maximum coding unit)/macroblock, and are converted into 420P-10bit yuv according to the width and height.
Because of the CA card number of the pay television channel, pay network video, user name that pay lecture uses, it is a series of numbers and letters unique to the content provider, set up RGB value of the pixel point (see figure 4) through the dot matrix to the number, letter, then change RGB value into 10bit-420-YUV; it should be noted that if the 10bit-420-YUV width and height after the dot matrix is not a multiple of the maximum LCU (maximum coding unit)/macroblock, the dot matrix needs to be amplified to reach a multiple of the maximum LCU (maximum coding unit)/macroblock.
S230, avs coding is carried out on the fingerprint image, and a fingerprint code stream is obtained.
When the fingerprint image is coded, the coding mode of the macro block/LCU corresponding to the fingerprint image is of an intra-frame coding type; the position outside the fingerprint image in the fingerprint code stream is a preset code stream, and the preset code stream is used for indicating the inter-frame coding type of which the coding mode of the macro block/LCU outside the fingerprint image is zero residual. It can be understood that the coding mode of the macro block/LCU of the non-fingerprint area is the non-intra coding type of zero residual, and syntax elements needed by coding are directly written to obtain the fingerprint code stream data part.
In some embodiments, by adjusting the encoding parameters, the prediction data of the fingerprint image area is adapted to be unchanged regardless of the video content, without affecting each other inside and outside the fingerprint image; the fingerprint image area is encoded, the code stream of the fingerprint image area is decoded, the embedded fingerprint information can be displayed, and the user can know who illegally propagates the video content according to the fingerprint information. The effect is shown in FIGS. 3A-3F.
S240, checking whether the video has a non-reference B frame or not;
b frames encoded by mpeg2, H263, H264, avs +, etc., are not referenced by other frames; the B frames of H265, avs2, including B frames that can be referenced and B frames that cannot be referenced, can be replaced only with B frames that cannot be referenced, i.e., B frames that are not referenced.
S250, judging whether the frame can be replaced or not;
if the frame is not the non-reference B frame, exiting and judging the next frame; if the frame is a non-reference B frame, the frame may be replaced.
For example, if the data amount (bytes) of the data portion of the non-reference B frame (i.e., the data amount of the stream data of the non-reference B frame minus the header data amount of the non-reference B frame) is equal to or greater than the data amount of the fingerprint code stream, it is determined that the non-reference B frame can be replaced, and the non-reference B frame is replaced with the fingerprint code stream embedded with the fingerprint information to obtain the video including the fingerprint code stream.
After the non-reference B frame is replaced with the fingerprint code stream, the format of the non-reference B frame code stream data is as follows: firstly, the original head of the non-reference B frame is provided, then the code stream of the fingerprint code stream is provided, finally, 0x00 data is filled, and the number of 0x00 bytes is the data volume of the data part of the non-reference B frame minus the data volume of the fingerprint code stream.
S260, defining a replacement period according to the setting and returning to execution; for example, step S250 may be performed once at intervals of 10 seconds, 1 minute, etc. as needed, so as to achieve the purpose of embedding fingerprint information without too frequent.
Referring to fig. 6 in conjunction with the above embodiments, fig. 6 is a schematic block diagram of a computer device 600 provided in an embodiment of the present application.
The computer device 600 may be, for example, a terminal device or a server, where the terminal device may be an electronic device such as a cable tv set-top box, a network tv set-top box, a mobile phone, a tablet computer, a notebook computer, a desktop computer, a video shooting device, a video encoding device, etc.; the servers may be independent servers or may be server clusters.
The computer device 600 includes a processor 601 and a memory 602.
The processor 601 and the memory 602 are illustratively connected by a bus 603, such as an I2C (Inter-integrated Circuit) bus.
Specifically, the processor 601 may be a Micro-controller Unit (MCU), a central processing Unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
Specifically, the Memory 602 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
The processor 601 is configured to execute a computer program stored in the memory 602, and implement the aforementioned video processing method when the computer program is executed.
The processor 601 is for example arranged to run a computer program stored in the memory 602 and to implement the following steps when executing the computer program:
acquiring a video, wherein the video comprises an I frame, a B frame and a P frame, and a reference frame of the B frame comprises a forward frame and/or a backward frame;
determining whether a non-reference B frame exists for the video, the non-reference B frame being a B frame that is not referenced by other frames in the video;
and replacing at least one non-reference B frame with a fingerprint code stream embedded with fingerprint information to obtain a video containing the fingerprint code stream.
The specific principles and implementation manners of the computer device provided in the embodiments of the present application are similar to those of the video processing method in the foregoing embodiments, and are not repeated here.
The present application also provides a computer readable storage medium storing a computer program, which when executed by a processor, causes the processor to implement the steps of the video processing method provided in the foregoing embodiment.
The computer readable storage medium may be an internal storage unit of the computer device according to any one of the foregoing embodiments, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
The embodiment of the application provides a computer device and a computer readable storage medium, wherein the video comprises an I frame, a B frame and a P frame by acquiring the video, wherein a reference frame of the B frame comprises a forward frame and/or a backward frame; determining whether a non-reference B frame exists for the video, the non-reference B frame being a B frame that is not referenced by other frames in the video; and replacing at least one non-reference B frame with a fingerprint code stream embedded with fingerprint information to obtain a video containing the fingerprint code stream. The video processed by the method is decoded, and the person who is an illegal propagator is known according to the fingerprint information embedded in the fingerprint code stream, so that the video product is effectively protected, the fair competition of the market is maintained, and the legal rights and interests of producers are protected.
It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It should also be understood that the term "and/or" as used in this application and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (7)

1. A video processing method, comprising:
acquiring a video, wherein the video comprises an I frame, a B frame and a P frame, and a reference frame of the B frame comprises a forward frame and/or a backward frame;
determining whether a non-reference B frame exists for the video, the non-reference B frame being a B frame that is not referenced by other frames in the video;
if the data volume of the data part of the non-reference B frame is larger than or equal to the data volume of the fingerprint code stream embedded with the fingerprint information, judging that the non-reference B frame can be replaced, replacing the non-reference B frame with the fingerprint code stream to obtain a video containing the fingerprint code stream, wherein the data volume of the data part of the non-reference B frame is the data volume of the code stream data of the non-reference B frame minus the head data volume of the non-reference B frame; wherein the method further comprises:
encoding the fingerprint image to obtain the fingerprint code stream; the position of the fingerprint code stream corresponding to the preset fingerprint area is the code stream of the fingerprint image, the position outside the fingerprint image in the fingerprint code stream is the preset code stream, and the preset code stream is used for generating the image of the corresponding position after the fingerprint code stream is decoded according to the image of the corresponding position in the target frame when the fingerprint code stream is decoded; the target frame is a reference frame of a non-reference B frame which needs to be replaced;
when the fingerprint image is coded, the coding mode of the macro block or LCU corresponding to the fingerprint image is of an intra-frame coding type;
the preset code stream is used for indicating the inter-frame coding type of the macro block or LCU outside the fingerprint image, wherein the coding mode of the macro block or LCU is zero residual.
2. The video processing method according to claim 1, wherein the fingerprint image is generated based on preset fingerprint information.
3. The video processing method according to any one of claims 1-2, wherein the encoding the fingerprint image includes:
coding the fingerprint image based on coding parameters used in the process of coding the non-reference B frame needing to be replaced to obtain a code stream of the fingerprint image;
writing a preset code stream into a macro block or LCU outside a fingerprint image in the fingerprint code stream, wherein the preset code stream is used for generating an image of a corresponding position after the fingerprint code stream is decoded according to the image of the corresponding position in a target frame when the fingerprint code stream is decoded;
the target frame is a reference frame of a non-reference B frame that needs replacement.
4. A video processing method according to claim 3, wherein the encoding the fingerprint image based on the encoding parameters used in encoding the non-reference B frame that needs to be replaced, to obtain the code stream of the fingerprint image, comprises:
performing preset adjustment on coding parameters used in the process of coding the non-reference B frames to be replaced to obtain a code stream of the fingerprint image;
encoding the fingerprint image based on preset and adjusted encoding parameters;
the preset adjustment is used for enabling the coding of the fingerprint image and the coding of the macro block or LCU outside the fingerprint image in the fingerprint code stream not to be affected mutually.
5. The video processing method according to any one of claims 1-2, wherein the non-reference B frames that need replacement are determined according to a preset period.
6. A computer device, the computer device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor for executing the computer program and for implementing the video processing method according to any of claims 1 to 5 when the computer program is executed.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the video processing method according to any one of claims 1 to 5.
CN202011384342.XA 2020-12-01 2020-12-01 Video processing method, computer device, and storage medium Active CN112672167B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011384342.XA CN112672167B (en) 2020-12-01 2020-12-01 Video processing method, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011384342.XA CN112672167B (en) 2020-12-01 2020-12-01 Video processing method, computer device, and storage medium

Publications (2)

Publication Number Publication Date
CN112672167A CN112672167A (en) 2021-04-16
CN112672167B true CN112672167B (en) 2024-03-15

Family

ID=75400830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011384342.XA Active CN112672167B (en) 2020-12-01 2020-12-01 Video processing method, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN112672167B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6208745B1 (en) * 1997-12-30 2001-03-27 Sarnoff Corporation Method and apparatus for imbedding a watermark into a bitstream representation of a digital image sequence
CN108650491A (en) * 2018-05-15 2018-10-12 西安电子科技大学 A kind of video watermark detection method towards monitoring system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6563936B2 (en) * 2000-09-07 2003-05-13 Sarnoff Corporation Spatio-temporal channel for images employing a watermark and its complement
US8812852B2 (en) * 2003-03-19 2014-08-19 Sony Corporation Method and system for marking digital content
GB2425425B (en) * 2005-04-22 2011-01-19 Sony Uk Ltd Data processing apparatus
EP2011075B1 (en) * 2006-04-25 2017-03-29 Thomson Licensing Digital watermarking method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6208745B1 (en) * 1997-12-30 2001-03-27 Sarnoff Corporation Method and apparatus for imbedding a watermark into a bitstream representation of a digital image sequence
CN108650491A (en) * 2018-05-15 2018-10-12 西安电子科技大学 A kind of video watermark detection method towards monitoring system

Also Published As

Publication number Publication date
CN112672167A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
US10194150B2 (en) Method and device for coding image, and method and device for decoding image
EP1879388B1 (en) Video information recording device, video information recording method, video information recording program, and recording medium containing the video information recording program
US20220312006A1 (en) Cross-component adaptive loop filter for chroma
CN106464886B (en) Robust encoding and decoding of pictures in video
US20120307904A1 (en) Partial frame utilization in video codecs
EP2055106A2 (en) Techniques for variable resolution encoding and decoding of digital video
US20120027092A1 (en) Image processing device, system and method
CN102595124B (en) Image coding and decoding method and method for processing image data and equipment thereof
EP2960855B1 (en) Method and device for determining a set of modifiable elements in a group of pictures
JP2010532121A (en) Method for indexing video and apparatus for indexing video
JP6055155B2 (en) Increased security strength for hardware decoder accelerators
US20100158111A1 (en) Method for insertion of data, method for reading of inserted data
US9565404B2 (en) Encoding techniques for banding reduction
US9432694B2 (en) Signal shaping techniques for video data that is susceptible to banding artifacts
CN115134629A (en) Video transmission method, system, device and storage medium
US11463721B2 (en) Motion vector obtaining method and apparatus
TW202209879A (en) Image encoding method, image decoding method and related devices capable of improving the accuracy of intra-frame prediction and encoding efficiency
US8798140B2 (en) Encoding video frames in a video encoder
CN112672167B (en) Video processing method, computer device, and storage medium
EP1473668B1 (en) Apparatus, method and program for video data processing and tamper detection
KR102186480B1 (en) Apparatus for packaging DRM contents and system comprising it and method for packaging DRM contents
CN116095331B (en) Encoding method and decoding method
KR20180057788A (en) Method and apparatus for scene change using perceptual rate control
JP4018305B2 (en) Image processing method and apparatus and storage medium
CN117676148A (en) Video recoding method, device, computer readable storage medium and terminal equipment

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