[go: up one dir, main page]

CN113613015A - Tamper-resistant video generation method and device, electronic equipment and readable medium - Google Patents

Tamper-resistant video generation method and device, electronic equipment and readable medium Download PDF

Info

Publication number
CN113613015A
CN113613015A CN202110872543.2A CN202110872543A CN113613015A CN 113613015 A CN113613015 A CN 113613015A CN 202110872543 A CN202110872543 A CN 202110872543A CN 113613015 A CN113613015 A CN 113613015A
Authority
CN
China
Prior art keywords
video data
frame picture
target
picture
counterfeiting information
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.)
Pending
Application number
CN202110872543.2A
Other languages
Chinese (zh)
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 Ncast Electronics Co ltd
Original Assignee
Guangzhou Ncast Electronics 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 Ncast Electronics Co ltd filed Critical Guangzhou Ncast Electronics Co ltd
Priority to CN202110872543.2A priority Critical patent/CN113613015A/en
Publication of CN113613015A publication Critical patent/CN113613015A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention provides a tamper-resistant video generation method, which comprises the steps of decoding video data in the video data recording process to obtain decoded video data; the decoded video data comprises a plurality of frame pictures; generating a target frame picture according to the frame picture and preset anti-counterfeiting information; adding the target frame picture to decoded video data to obtain target decoded video data; and coding the target decoding video data to obtain target video data. The generated tamper-resistant video can be played on a common video player, and is more universal; when video data is recorded, anti-counterfeiting information is added to the frame picture of the video, so that the video data can be prevented from being tampered, and the safety of the video data is enhanced.

Description

Tamper-resistant video generation method and device, electronic equipment and readable medium
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a tamper-resistant video generation method, a tamper-resistant video generation apparatus, an electronic device, and a computer-readable medium.
Background
The examination is an important mode for selecting talents, in order to ensure the justice and fairness of results, an examination room must have strong discipline constraints, and is specially provided with a supervising examination process such as a main examination and invigilation, and recording invigilation videos in the examination room becomes an important invigilation mode along with the improvement of science and technology.
After the invigilation video is recorded, the evidence for later checking is stored, but the direct storage has great risk, the prior art can decode the video and then modify the video at will, and the method is very unfavorable for ensuring the justice fairness of the examination. Therefore, there is a need to enhance the security of video. At present, the common method is to encrypt the video, but directly encrypting the video requires a specific player to play, and if the video is migrated to a terminal without the specific player, the video cannot be played; in addition, the password for encrypting the video can be cracked, malicious personnel can tamper the cracked video content, the flexibility for storing and playing the video encryption mode is low, and the safety is insufficient.
Disclosure of Invention
The embodiment of the invention provides a tamper-resistant video generation method and device, electronic equipment and a computer readable storage medium, and aims to solve the problems that a video is not favorable for watching after being encrypted and the safety is insufficient.
The embodiment of the invention discloses a tamper-resistant video generation method, which comprises the following steps:
in the process of recording video data, decoding the video data to obtain decoded video data; the decoded video data comprises a plurality of frame pictures;
generating a target frame picture according to the frame picture and preset anti-counterfeiting information;
adding the target frame picture to decoded video data to obtain target decoded video data;
and coding the target decoding video data to obtain target video data.
Optionally, decoding the video data includes:
determining decoding parameters for the video data; the decoding parameters at least comprise time and frame picture number;
and decoding the video data according to the decoding parameters in the video data recording process.
Optionally, the generating a target frame picture according to the frame picture and preset anti-counterfeiting information includes:
acquiring picture parameters of a reference frame picture in the decoded video data, wherein the picture parameters at least comprise one of width, height, bit depth and format of the reference frame picture;
generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information; the anti-counterfeiting information at least comprises one of preset character strings or pictures; the anti-counterfeiting information comprises an examination certificate number.
Optionally, the generating a target frame picture according to the picture parameter, the reference frame picture and preset anti-fake information includes:
copying the reference frame picture to generate a transparent copied frame picture;
and adding preset anti-counterfeiting information at the specified position of the copied frame picture according to the picture parameters to generate a target frame picture.
Optionally, the adding the target frame picture to the decoded video data includes:
adding the target frame picture to an arbitrary position in the decoded video data; or,
and adding the target frame picture to the decoded video data according to a preset time interval.
Optionally, the generating a target frame picture according to the picture parameter, the reference frame picture and preset anti-fake information includes:
acquiring a pixel at a specified position in the reference frame picture as a target pixel according to the picture parameter;
and replacing the target pixel with preset anti-counterfeiting information to generate a target frame picture.
Optionally, the method further comprises:
acquiring video data to be detected;
decoding the video data to obtain decoded video data;
extracting anti-counterfeiting information from the decoded video data;
and when the anti-counterfeiting information is matched with pre-stored anti-counterfeiting information, determining that the video data is not tampered.
The embodiment of the invention also discloses a tamper-proof video generation device, which comprises:
the video data decoding module is used for decoding the video data in the video data recording process to obtain decoded video data; the decoded video data comprises a plurality of frame pictures;
the target frame picture generating module is used for generating a target frame picture according to the frame picture and preset anti-counterfeiting information;
the target decoding video data acquisition module is used for adding the target frame picture to the decoding video data to obtain target decoding video data;
and the video data coding module is used for coding the target decoding video data to obtain the target video data.
Optionally, the video data decoding module is configured to determine a decoding parameter for the video data; the decoding parameters at least comprise time and frame picture number; and decoding the video data according to the decoding parameters in the video data recording process.
Optionally, the target frame picture generating module is configured to obtain picture parameters of a reference frame picture in the decoded video data, where the picture parameters at least include one of a width, a height, a bit depth, and a format of the reference frame picture; generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information; the anti-counterfeiting information at least comprises one of preset character strings or pictures; the anti-counterfeiting information comprises an examination certificate number.
Optionally, the generating a target frame picture according to the picture parameter, the reference frame picture and preset anti-fake information includes: copying the reference frame picture to generate a transparent copied frame picture; and adding preset anti-counterfeiting information at the specified position of the copied frame picture according to the picture parameters to generate a target frame picture.
Optionally, the target decoded video data obtaining module is configured to add the target frame picture to any position in the decoded video data; or, adding the target frame picture to the decoded video data according to a preset time interval.
Optionally, the generating a target frame picture according to the picture parameter, the reference frame picture and preset anti-fake information includes: acquiring a pixel at a specified position in the reference frame picture as a target pixel according to the picture parameter; and replacing the target pixel with preset anti-counterfeiting information to generate a target frame picture.
Optionally, the apparatus further comprises:
the to-be-detected video data acquisition submodule is used for acquiring the to-be-detected video data;
the to-be-detected video data decoding submodule is used for decoding the video data to obtain decoded video data;
the anti-counterfeiting information extraction submodule is used for extracting anti-counterfeiting information from the decoded video data;
and the anti-counterfeiting information detection submodule is used for determining that the video data is not tampered when the anti-counterfeiting information is matched with pre-stored anti-counterfeiting information.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Also disclosed are one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method according to an embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the video data is decoded in the video data recording process to obtain decoded video data; the decoded video data comprises a plurality of frame pictures; generating a target frame picture according to the frame picture and preset anti-counterfeiting information; adding the target frame picture to the decoded video data to obtain target decoded video data; and coding the target decoding video data to obtain the target video data. The generated tamper-resistant video can be played on a common video player, and is more universal; when video data is recorded, anti-counterfeiting information is added to the frame picture of the video, so that the video data can be prevented from being tampered, and the safety of the video data is enhanced.
Drawings
Fig. 1 is a flowchart illustrating steps of a tamper-resistant video generation method provided in an embodiment of the present invention;
fig. 2 is a video data decoding flow chart of a tamper-resistant video generation method provided in an embodiment of the present invention;
fig. 3 is a flow chart of tamper-resistant video detection provided in an embodiment of the present invention;
fig. 4 is a block diagram of a tamper-resistant video generation apparatus provided in an embodiment of the present invention;
fig. 5 is a block diagram of an electronic device provided in an embodiment of the invention;
fig. 6 is a schematic diagram of a computer-readable medium provided in an embodiment of the invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The tamper-resistant video generation method in the embodiment of the invention can be operated in terminal equipment. The terminal device may be a local terminal device.
In an alternative embodiment, the terminal device may be a local terminal device. The local terminal equipment is provided with a recording device for recording the video, and stores the application program and is used for generating the anti-tampering video. The local terminal equipment is used for recording videos through the recording equipment and modifying the video data to generate an anti-tampering video. For example, the local terminal device may include a recording device for recording video data, a display screen for presenting a graphical user interface including an application screen, and a processor for running the application, generating the graphical user interface, and controlling display of the graphical user interface on the display screen.
Referring to fig. 1, a flowchart illustrating steps of a tamper-resistant video generation method provided in an embodiment of the present invention is shown, which may specifically include the following steps:
step 101, decoding the video data in the process of recording the video data to obtain decoded video data; the decoded video data comprises a plurality of frame pictures;
the video data recording is realized through terminal equipment with a video recording function, in the embodiment of the invention, the terminal equipment can be a USB camera, a network camera, a monitoring camera and the like, and the recorded video data can be stored in a mode of writing in a local storage medium, transmitting to a remote server, uploading to a cloud server and the like.
A video is a continuous image sequence, and is composed of continuous frame pictures, and one frame picture is an image. Due to the persistence of vision effect of human eyes, when a sequence of frame pictures is played at a certain rate, we see a video with continuous motion. Because the similarity between the continuous frame pictures is extremely high, in order to be convenient for storage and transmission, the original video needs to be coded and compressed; if the video data needs to be operated, decoding the video after the coding and compression; after the original video data is decoded, the corresponding decoded video data can be obtained.
In the embodiment of the invention, the video data can be decoded in the video data recording process, so that the frame picture corresponding to the decoded video data is obtained. In a specific implementation, the method can be applied to a scene that a video needs to be modified during video recording, for example, for an exam recording invigilated video, the modifying may include modifying image content during the recording process.
102, generating a target frame picture according to the frame picture and preset anti-counterfeiting information;
in the frame picture, the parameter information and the image information may be specifically included; the parameter information comprises the parameters of the wide picture and the high picture of the frame picture, and the image information consists of image pixels of the frame picture;
the anti-counterfeiting information can comprise character strings or pictures, including numerical numbers, character combinations, specific symbols, graphic combinations and the like.
In a specific implementation, original video data may be recorded by a video recording device, and the original video data is decoded during the recording process to obtain a decoded frame picture, where a possible case is that a pixel in the frame picture is modified, and the anti-counterfeiting information may be added to a specified position of the frame picture or replaced with the anti-counterfeiting information. Another possible situation is that parameter information and image information of the frame picture can be acquired, a frame of transparent frame picture identical to the frame picture is generated, and anti-counterfeiting information is added to a specified position of the transparent frame picture. The modification of the frame picture may be any content and any position of the frame picture, or may be one or more positions of the frame picture.
Step 103, adding the target frame picture to decoded video data to obtain target decoded video data;
after the anti-counterfeiting information is added to the frame picture of the video data to obtain the target frame picture, the target frame picture can be added to the video data to finish the anti-tampering processing of the decoded video data.
In an exemplary embodiment, the target frame picture may be added to any position in the decoded video data, multiple target frame pictures may be added to any segment of the decoded video data, and the target frame pictures may be added in a centralized manner to a specific segment of the decoded video data or may be added to multiple segments of the decoded video data in a distributed manner.
In another exemplary embodiment, the generated target frame picture may be buffered, a time interval is preset, and then the buffered target frame picture is added to the decoded video data according to the time interval; or a time interval may be preset, a target frame picture may be generated according to the time interval, and the generated target frame picture may be added to the decoded video data.
And step 104, encoding the target decoding video data to obtain target video data.
Video coding, which means compressing original video data by a compression technique, has strong correlation between video image data, that is, a large amount of redundant information. The redundant information can be divided into spatial domain redundant information and time domain redundant information. The compression technique is to remove redundant information in the data (remove correlation between data). The most important codec standards in video streaming are h.261, h.263, and h.264 of the international telecommunications union, M-JPEG of the moving picture experts group, and MPEG series standards of the moving picture experts group of the international organization for standardization. In the embodiment of the present invention, the decoded video data after adding the anti-counterfeiting information may be encoded to obtain the final target video data, and the embodiment of the present invention is not limited to the video encoding standard.
In the embodiment of the invention, the video data is decoded in the video data recording process to obtain decoded video data; the decoded video data comprises a plurality of frame pictures; generating a target frame picture according to the frame picture and preset anti-counterfeiting information; adding the target frame picture to the decoded video data to obtain target decoded video data; and coding the target decoding video data to obtain the target video data. The generated tamper-resistant video can be played on a common video player, and is more universal; when video data is recorded, anti-counterfeiting information is added to the frame picture of the video, so that the video data can be prevented from being tampered, and the safety of the video data is enhanced.
In an exemplary embodiment, the step 101 of decoding the video data includes:
determining decoding parameters for the video data; the decoding parameters at least comprise time and frame picture number;
and decoding the video data according to the decoding parameters in the video data recording process.
In the video data recording process, the video data can be decoded according to the relevant decoding parameters, and particularly, the video data can be decoded according to the preset time.
Specifically, decoding can be performed according to a preset time parameter, for example, a preset time interval is set to 10 seconds, when a video is recorded for 10 seconds, video data recorded for the first 10 seconds are decoded, and similarly, video data are decoded every 10 seconds; the time interval may be set freely, and the embodiment of the present invention is not limited thereto.
Specifically, the decoding may be performed according to the number of preset frame pictures, for example, the number of the preset frame pictures is set to 10 frames, when 10 frames are recorded in the video, the 10 frames are decoded, and similarly, the 10 frames of video data may be decoded every time 10 frames are recorded. The number of the frame pictures can be freely set, which is not limited in the embodiment of the present invention.
In order to make the flow of decoding video data easier to understand in the embodiment of the present invention, this will be described in detail below.
Referring to fig. 2, a video data decoding flowchart of a tamper-resistant video generation method provided in the embodiment of the present invention is shown, which may specifically include the following steps:
step 201, acquiring video data;
the embodiment of the invention records through terminal equipment with a video recording function, such as a USB camera, a network camera, a monitoring camera and the like, and obtains input source video data;
step 202, determining decoding parameters of video data; the decoding parameters at least comprise time and frame picture number;
since the video data is encoded, the decoding operation can modify the content of the video, similar to the decompression process of the video data; in the embodiment of the present invention, decoding parameters may be preset to decode video data, where the decoding parameters may be preset time or the number of frame pictures;
step 203, decoding the video data according to the decoding parameters;
after the decoding parameters are determined, decoding the video data according to the preset decoding parameters;
because video recording is a continuous process, the steps are executed circularly in the recording process, specifically, after step 203 is executed, whether recording is finished or not is judged, and if yes, recording is finished; if not, the step 201 is continuously executed until the recording is finished or stopped.
In a specific implementation, the decoding parameters are used as frame picture parameters to further explain the above steps, and it is assumed that the preset number of frame pictures is 1 frame. Starting to record a video, executing to step 201, and acquiring currently recorded video data; continuing to step 202, determining that the current decoding parameter is the number of frame pictures, and the preset value is 1 frame; then, the process goes to step 203 to decode the current 1 frame picture; and in the video recording process, the steps are executed circularly until the video recording is finished or stopped.
In the embodiment of the invention, the decoding parameters of the video data are determined by presetting the decoding parameters of the video data; the decoding parameters at least comprise time and frame picture number; and decoding the video data according to the decoding parameters in the video data recording process. The video can be decoded in real time, the decoding is more flexible due to the preset decoding parameters, and the video data is subjected to tamper-proof processing in the video recording process, so that the safety of the video data is enhanced.
In an exemplary embodiment, the step 102 of generating a target frame picture according to the frame picture and preset anti-counterfeiting information includes:
acquiring picture parameters of a reference frame picture in the decoded video data, wherein the picture parameters at least comprise one of width, height, bit depth and format of the reference frame picture;
generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information; the anti-counterfeiting information at least comprises one of preset character strings or pictures; the anti-counterfeiting information comprises an examination certificate number.
Because the video data is formed by combining a plurality of frame pictures according to the frame picture sequence, when the video data is modified, each frame picture is modified.
The frame picture has picture parameters, where the picture parameters may include a width and a height of the frame picture, that is, a length of the frame picture in the horizontal direction and a length of the frame picture in the vertical direction, and are generally expressed by a maximum pixel that the frame picture can display in the horizontal direction and a maximum pixel that the frame picture can display in the vertical direction, that is, a resolution of the frame picture, for example, may be 1920 × 1080, 1280 × 720, 1024 × 768, and the like, where 1920 × 1080 indicates that the maximum pixels displayed in the horizontal direction of the frame picture are 1920 pixels, and the maximum pixels displayed in the vertical direction are 1080 pixels; in addition to the resolution, the width and height of a frame picture also indicate the aspect ratio of the frame picture, i.e. the scale of the picture, e.g. 1920 × 1080 is 16: 9.
The picture parameter may further include a bit Depth of the frame picture, and an Image Depth (Image Depth) is also referred to as a bit Depth of the Image, and refers to a number of bits occupied by data describing each pixel in the Image. The data corresponding to each pixel of the image may be 1 bit (bit) or multiple bits, and is used to store the color, brightness, and other information of the pixel, and the more the number of bits of data, the more the corresponding color types of the image.
The picture parameters can also comprise video formats, and the video formats are essentially video coding modes and can be divided into two categories, namely local video suitable for local playing and network streaming media video suitable for playing in a network. The video coding format is inseparable from the coding standard, and the specific video coding format file is a result generated according to the specific coding standard. The most important coding standards in video streaming are h.261 and h.263 of the international electrotechnical commission video coding experts group, the MPEG series standards of the international organization for standardization moving picture experts group, and h.264 commonly established by the Joint Video Team (JVT) established by the two organizations in a joint way. The video encapsulation format is to put the encoded video data, audio data, and subtitle data into a file in a certain manner, and in order to organically combine the video data together, a container is required for encapsulation, which is the encapsulation format. The names of the encoding format and the packaging format are sometimes consistent, for example, MPEG, WMV, DivX, XviD, RM, RMVB, etc., are both encoding and packaging formats. Common video formats include MPEG, AVI, ASF, MOV, WMV, and the like.
The anti-counterfeiting information can be a preset character string or a preset picture, and can be a number, a character combination, a specific symbol, a graphic combination and the like. One possible application scenario may be to add anti-counterfeiting information to the invigilation video of the examination, where the anti-counterfeiting information may be examination-related information such as the examination admission card number, study number, seat number, etc. of the examinee.
In specific implementation, the method can be applied to examination monitoring, and a frame picture of decoded video data of an examination invigilator is acquired as a reference frame picture, so that picture parameters of the reference frame picture can be acquired, for example, the width and the height of the reference frame picture are acquired; and then adding preset anti-counterfeiting information into the reference frame picture according to the obtained width and height to generate a processed target frame picture. Specifically, assuming that the width of the reference frame picture is 1920 and the height is 1080, and the preset anti-counterfeiting information is the scholarship number 017 of the examinee, the scholarship number 017 can be added to any position within 1920 × 1080 of the reference frame picture to replace the pixel of the position. Another way to add anti-counterfeiting information may be to add the school number 017 dispersedly to a designated position within 1920 × 1080 of the reference frame picture, for easy understanding, the width and height of the reference frame picture may be expressed as coordinates, for example, a number 0 is added to the position of (100,300) to replace the content of the coordinate position; similarly, the remaining numbers 1 and 7 may be added to other designated locations of the reference frame picture.
In the embodiment of the present invention, by obtaining a picture parameter of a reference frame picture in the decoded video data, the picture parameter at least includes one of a width, a height, a bit depth, and a format of the reference frame picture; generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information; the anti-counterfeiting information at least comprises one of preset character strings or pictures; the anti-counterfeiting information comprises an examination certificate number. The preset anti-counterfeiting information can be added to the appointed position in the frame picture, and the flexibility of video tamper resistance is improved.
In an exemplary embodiment, the generating a target frame picture according to the picture parameter, the reference frame picture and preset anti-counterfeiting information includes:
copying the reference frame picture to generate a transparent copied frame picture;
and adding preset anti-counterfeiting information at the specified position of the copied frame picture according to the picture parameters to generate a target frame picture.
The reference frame picture can be copied according to the picture parameters of the reference frame picture, a transparent picture which is the same as the reference frame picture in parameters such as width, height, bit depth and format is generated, namely the copied frame picture, and then the preset anti-counterfeiting information is added to the specified position of the copied frame picture.
In a specific implementation, any frame picture of the video data may be copied to generate a copied frame picture, which may be a designated frame picture, for example, a 15 th frame picture; the frame pictures with the preset frame picture number interval may be copied, for example, if the preset frame picture number interval is 10, the frame pictures are copied every 10 frames; the frame pictures at a preset time interval may be copied, for example, the frame pictures are copied every 5 seconds at a preset time interval. After the copied frame picture is obtained, the preset anti-counterfeiting information can be directly added to any specified position of the copied frame picture because the copied frame picture is transparent, and pixel content does not need to be replaced.
In the embodiment of the invention, a transparent copied frame picture is generated by copying the reference frame picture; and adding preset anti-counterfeiting information at the specified position of the copied frame picture according to the picture parameters to generate a target frame picture. The preset anti-counterfeiting information can be added into the decoded video data on the basis of not replacing the original video data content, and the method has stronger universality.
In an exemplary embodiment, the adding 103 of the target frame picture to the decoded video data includes:
adding the target frame picture to an arbitrary position in the decoded video data; or,
and adding the target frame picture to the decoded video data according to a preset time interval.
Specifically, the adding of the target frame picture to any position in the decoded video data may be adding a plurality of target frame pictures to any segment of the decoded video data, and the adding may be performed in a manner of being collectively added to a specific segment of the decoded video data, or may be dispersedly added to a plurality of segments of the decoded video data. For example, when recording is started, the target frame picture is added to the decoded video data at the 1 st frame, and then the target frame picture is added again at every 30 frames, and the number of the interval frames can be set by itself; similarly, the target frame picture is added to the decoded video data according to the preset number of interval frames until the recording is finished.
Another possible situation is that the generated target frame picture can be cached, a time interval is preset, and then the cached target frame picture is added into the decoded video data according to the time interval; for example, if the preset time interval is 10 seconds, only the target frame picture is generated in the first 9 seconds after the start of recording, and is not added to the decoded video data, and when the time interval, that is, the 10 th second, is reached, the previously generated target frame picture is added to the decoded video data, similarly, the target frame picture is added to the decoded video data once every 10 seconds until the end of recording; or a time interval is preset, a target frame picture is generated according to the time interval, and the generated target frame picture is added into the decoded video data; for example, if the preset time interval is 3 seconds, every 3 seconds of recording, the target frame picture is generated and added to the decoded video data until the end of recording.
In the embodiment of the invention, the target frame picture is added to any position in the decoded video data; or, adding the target frame picture to the decoded video data according to a preset time interval. Frame pictures with anti-counterfeiting information can be flexibly added into the video data, and the safety of recording the video data is enhanced.
In an exemplary embodiment, the generating the target frame picture according to the picture parameter, the reference frame picture and preset anti-counterfeit information includes:
acquiring a pixel at a specified position in the reference frame picture as a target pixel according to the picture parameter;
and replacing the target pixel with preset anti-counterfeiting information to generate a target frame picture.
The video is composed of a plurality of frame pictures according to a sequence, the frame pictures are composed of a plurality of pixels, each pixel is a minimum unit in an image represented by a digital sequence and is composed of small squares of the image, the small squares have definite positions and assigned color values, and the colors and the positions of the small squares determine the appearance of the image. A pixel can be considered to be an indivisible unit or element in the entire image. I.e. the pixels can no longer be cut into smaller units or elements, which exist as a single color cell. Each dot matrix image contains a certain number of pixels that determine the size of the image to be presented on the screen.
In a specific implementation, the pixels at random or designated positions in the frame picture may be obtained according to picture parameters of the frame picture, specifically, the target pixels may be determined according to coordinates of the pixels, or the target pixels may be determined according to regions of the frame picture, for example, the frame picture is divided into an upper region, a middle region and a lower region, and then the target pixels are determined in one or more of the regions, where the target pixels may be one or more; and after the target pixel is determined, replacing the target pixel with preset anti-counterfeiting information. One possible scenario is that target frame pictures with the same number as the decoded video data frame pictures can be generated, that is, anti-counterfeiting information is added to each frame picture, and when the target pixels are replaced by the anti-counterfeiting information, the anti-counterfeiting information can be set as small as possible so as to reduce damage to the original pixels of the video data.
In the embodiment of the invention, the pixel at the appointed position in the reference frame picture is obtained as the target pixel according to the picture parameter; and replacing the target pixel with preset anti-counterfeiting information to generate a target frame picture. Anti-counterfeiting information can be added at the designated positions of any number of frame pictures in the video data.
Referring to fig. 3, a flow chart of tamper-resistant video detection provided in the embodiment of the present invention is shown, which may specifically include the following steps:
301, acquiring video data to be detected;
the video data to be detected refers to target video data generated by adding anti-counterfeiting information into a frame picture and coding;
step 302, decoding the video data to obtain decoded video data;
step 303, extracting anti-counterfeiting information from the decoded video data;
acquiring all target frame pictures added with anti-counterfeiting information from decoded video data, and extracting the anti-counterfeiting information from the target frame pictures;
and 304, when the anti-counterfeiting information is matched with pre-stored anti-counterfeiting information, determining that the video data is not tampered.
For each tamper-resistant video data, anti-counterfeiting information for detection can be preset; and a corresponding detection rule can be set for the anti-counterfeiting information for detection, so that the anti-counterfeiting information can be adapted to a plurality of anti-tampering video data meeting the detection rule, and the workload of repeatedly setting the preset anti-counterfeiting information is reduced.
Extracting anti-counterfeiting information of video data to be detected, judging whether the anti-counterfeiting information is matched with preset anti-counterfeiting information or not, if so, determining that the video data is not tampered, and if not, determining that the video data is tampered. In the specific implementation, it is assumed that the anti-counterfeiting information and the preset anti-counterfeiting information are both the admission card numbers of examinees, and for example, the number may be 12345; assuming that 5 target frame pictures with anti-counterfeiting information exist in the video data to be detected, recording admission ticket numbers 12345 in sequence, combining the anti-counterfeiting information of the 5 target frame pictures when extracting the anti-counterfeiting information, and matching the anti-counterfeiting information with preset anti-counterfeiting information if the combination result is 12345, wherein the video data are not tampered; if the video data is extracted with a part of frame pictures including the target frame picture, such as the result of the combination of the anti-counterfeiting information is 1245, or the target frame picture of the video data is tampered with maliciously, such as the result of the combination of the anti-counterfeiting information is 12543, it can be determined that the video data is tampered with.
In the embodiment of the invention, the video data to be detected is acquired; decoding the video data to obtain decoded video data; extracting anti-counterfeiting information from the decoded video data; and when the anti-counterfeiting information is matched with pre-stored anti-counterfeiting information, determining that the video data is not tampered. The video data subjected to the tamper-proof processing can be detected to determine whether the video data is tampered, so that the authenticity of the video data is ensured, and the video data is prevented from being tampered.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 4, a block diagram of a structure of a tamper-resistant video generation apparatus provided in the embodiment of the present invention is shown, and specifically, the tamper-resistant video generation apparatus may include the following modules:
a video data decoding module 401, configured to decode video data in a video data recording process to obtain decoded video data; the decoded video data comprises a plurality of frame pictures;
a target frame picture generating module 402, configured to generate a target frame picture according to the frame picture and preset anti-fake information;
a target decoded video data obtaining module 403, configured to add the target frame picture to decoded video data to obtain target decoded video data;
and a video data encoding module 404, configured to encode the target decoded video data to obtain target video data.
In an exemplary embodiment, the video data decoding module 401 is configured to determine a decoding parameter for the video data; the decoding parameters at least comprise time and frame picture number; and decoding the video data according to the decoding parameters in the video data recording process.
In an exemplary embodiment, the target frame picture generating module 402 is configured to obtain picture parameters of a reference frame picture in the decoded video data, where the picture parameters include at least one of a width, a height, a bit depth, and a format of the reference frame picture; generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information; the anti-counterfeiting information at least comprises one of preset character strings or pictures; the anti-counterfeiting information comprises an examination certificate number.
In an exemplary embodiment, the generating a target frame picture according to the picture parameter, the reference frame picture and preset anti-counterfeiting information includes: copying the reference frame picture to generate a transparent copied frame picture; and adding preset anti-counterfeiting information at the specified position of the copied frame picture according to the picture parameters to generate a target frame picture.
In an exemplary embodiment, the target decoded video data obtaining module 403 is configured to add the target frame picture to an arbitrary position in the decoded video data; or, adding the target frame picture to the decoded video data according to a preset time interval.
In an exemplary embodiment, the generating the target frame picture according to the picture parameter, the reference frame picture and preset anti-counterfeit information includes: acquiring a pixel at a specified position in the reference frame picture as a target pixel according to the picture parameter; and replacing the target pixel with preset anti-counterfeiting information to generate a target frame picture.
In an exemplary embodiment, the apparatus further comprises:
the to-be-detected video data acquisition submodule is used for acquiring the to-be-detected video data;
the to-be-detected video data decoding submodule is used for decoding the video data to obtain decoded video data;
the anti-counterfeiting information extraction submodule is used for extracting anti-counterfeiting information from the decoded video data;
and the anti-counterfeiting information detection submodule is used for determining that the video data is not tampered when the anti-counterfeiting information is matched with pre-stored anti-counterfeiting information.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an embodiment of the present invention further provides an electronic device, as shown in fig. 5, which includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
in the process of recording video data, decoding the video data to obtain decoded video data; the decoded video data comprises a plurality of frame pictures;
generating a target frame picture according to the frame picture and preset anti-counterfeiting information;
adding the target frame picture to decoded video data to obtain target decoded video data;
and coding the target decoding video data to obtain target video data.
In an optional embodiment of the present invention, the decoding the video data includes:
determining decoding parameters for the video data; the decoding parameters at least comprise time and frame picture number;
and decoding the video data according to the decoding parameters in the video data recording process.
In an optional embodiment of the present invention, the generating a target frame picture according to the frame picture and preset anti-fake information includes:
acquiring picture parameters of a reference frame picture in the decoded video data, wherein the picture parameters at least comprise one of width, height, bit depth and format of the reference frame picture;
generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information; the anti-counterfeiting information at least comprises one of preset character strings or pictures; the anti-counterfeiting information comprises an examination certificate number.
In an optional embodiment of the present invention, the generating a target frame picture according to the picture parameter, the reference frame picture, and preset anti-fake information includes:
copying the reference frame picture to generate a transparent copied frame picture;
and adding preset anti-counterfeiting information at the specified position of the copied frame picture according to the picture parameters to generate a target frame picture.
In an optional embodiment of the present invention, the adding the target frame picture to decoded video data includes:
adding the target frame picture to an arbitrary position in the decoded video data; or,
and adding the target frame picture to the decoded video data according to a preset time interval.
In an optional embodiment of the present invention, the generating the target frame picture according to the picture parameter, the reference frame picture, and the preset anti-counterfeit information includes:
acquiring a pixel at a specified position in the reference frame picture as a target pixel according to the picture parameter;
and replacing the target pixel with preset anti-counterfeiting information to generate a target frame picture.
In an optional embodiment of the present invention, the method further includes:
acquiring video data to be detected;
decoding the video data to obtain decoded video data;
extracting anti-counterfeiting information from the decoded video data;
and when the anti-counterfeiting information is matched with pre-stored anti-counterfeiting information, determining that the video data is not tampered.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. In an alternative embodiment of the present invention, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present invention, as shown in fig. 6, a computer-readable storage medium 601 is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the method for generating training data described in the above embodiment.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of generating training data described in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A tamper-resistant video generation method, the method comprising:
in the process of recording video data, decoding the video data to obtain decoded video data; the decoded video data comprises a plurality of frame pictures;
generating a target frame picture according to the frame picture and preset anti-counterfeiting information;
adding the target frame picture to decoded video data to obtain target decoded video data;
and coding the target decoding video data to obtain target video data.
2. The method of claim 1, wherein decoding the video data comprises:
determining decoding parameters for the video data; the decoding parameters at least comprise time and frame picture number;
and decoding the video data according to the decoding parameters in the video data recording process.
3. The method according to claim 1, wherein the generating a target frame picture according to the frame picture and preset anti-counterfeiting information comprises:
acquiring picture parameters of a reference frame picture in the decoded video data, wherein the picture parameters at least comprise one of width, height, bit depth and format of the reference frame picture;
generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information; the anti-counterfeiting information at least comprises one of preset character strings or pictures; the anti-counterfeiting information comprises an examination certificate number.
4. The method according to claim 3, wherein the generating a target frame picture according to the picture parameter, the reference frame picture and preset anti-counterfeiting information comprises:
copying the reference frame picture to generate a transparent copied frame picture;
and adding preset anti-counterfeiting information at the specified position of the copied frame picture according to the picture parameters to generate a target frame picture.
5. The method of claim 4, wherein the adding the target frame picture to decoded video data comprises:
adding the target frame picture to an arbitrary position in the decoded video data; or,
and adding the target frame picture to the decoded video data according to a preset time interval.
6. The method according to claim 4, wherein the frame picture is composed of a plurality of pixels, and the generating a target frame picture according to the picture parameters, the reference frame picture and preset anti-counterfeiting information comprises:
acquiring a pixel at a specified position in the reference frame picture as a target pixel according to the picture parameter;
and replacing the target pixel with preset anti-counterfeiting information to generate a target frame picture.
7. The method of claim 1, further comprising:
acquiring video data to be detected;
decoding the video data to obtain decoded video data;
extracting anti-counterfeiting information from the decoded video data;
and when the anti-counterfeiting information is matched with pre-stored anti-counterfeiting information, determining that the video data is not tampered.
8. A tamper-resistant video generating apparatus, the apparatus comprising:
the video data decoding module is used for decoding the video data in the video data recording process to obtain decoded video data; the decoded video data comprises a plurality of frame pictures;
the target frame picture generating module is used for generating a target frame picture according to the frame picture and preset anti-counterfeiting information;
the target decoding video data acquisition module is used for adding the target frame picture to the decoding video data to obtain target decoding video data;
and the video data coding module is used for coding the target decoding video data to obtain the target video data.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1 to 7.
10. One or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of any of claims 1-7.
CN202110872543.2A 2021-07-30 2021-07-30 Tamper-resistant video generation method and device, electronic equipment and readable medium Pending CN113613015A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110872543.2A CN113613015A (en) 2021-07-30 2021-07-30 Tamper-resistant video generation method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110872543.2A CN113613015A (en) 2021-07-30 2021-07-30 Tamper-resistant video generation method and device, electronic equipment and readable medium

Publications (1)

Publication Number Publication Date
CN113613015A true CN113613015A (en) 2021-11-05

Family

ID=78306274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110872543.2A Pending CN113613015A (en) 2021-07-30 2021-07-30 Tamper-resistant video generation method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN113613015A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155464A (en) * 2021-11-29 2022-03-08 北京中交兴路信息科技有限公司 Video data storage method and device, storage medium and terminal
CN115550663A (en) * 2022-08-02 2022-12-30 杭州网易云音乐科技有限公司 Audio and video anti-leech method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915912A (en) * 2016-04-30 2016-08-31 安徽天虹数码科技股份有限公司 Fragile watermark embedding and detection method of MPEG-2 compressed domain video
CN110896484A (en) * 2018-09-12 2020-03-20 中兴通讯股份有限公司 Video watermark adding and extracting method and device, video playing end and storage medium
US20200267404A1 (en) * 2020-05-04 2020-08-20 Intel Corportation Detection of video tampering
CN111669615A (en) * 2020-05-13 2020-09-15 北京奇艺世纪科技有限公司 Video stream processing method and device
CN113014926A (en) * 2021-04-30 2021-06-22 北京汇钧科技有限公司 Video transcoding method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915912A (en) * 2016-04-30 2016-08-31 安徽天虹数码科技股份有限公司 Fragile watermark embedding and detection method of MPEG-2 compressed domain video
CN110896484A (en) * 2018-09-12 2020-03-20 中兴通讯股份有限公司 Video watermark adding and extracting method and device, video playing end and storage medium
US20200267404A1 (en) * 2020-05-04 2020-08-20 Intel Corportation Detection of video tampering
CN111669615A (en) * 2020-05-13 2020-09-15 北京奇艺世纪科技有限公司 Video stream processing method and device
CN113014926A (en) * 2021-04-30 2021-06-22 北京汇钧科技有限公司 Video transcoding method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155464A (en) * 2021-11-29 2022-03-08 北京中交兴路信息科技有限公司 Video data storage method and device, storage medium and terminal
CN114155464B (en) * 2021-11-29 2022-11-25 北京中交兴路信息科技有限公司 Video data storage method and device, storage medium and terminal
CN115550663A (en) * 2022-08-02 2022-12-30 杭州网易云音乐科技有限公司 Audio and video anti-leech method, device and equipment

Similar Documents

Publication Publication Date Title
US11023618B2 (en) Systems and methods for detecting modifications in a video clip
CN101273367B (en) Covert and robust mark for media identification
US9094733B2 (en) Methods and systems for cryptographic access control of video
WO2015127865A1 (en) Information pushing method, terminal and server
CN107959895B (en) A video playback traceability method, device, equipment and storage medium
CN107509080B (en) Method and device for displaying coded image and electronic equipment
CN113613015A (en) Tamper-resistant video generation method and device, electronic equipment and readable medium
CN113316004B (en) Method and device for protecting copyright of streaming media
US20120210447A1 (en) Secure video download method
WO2018010118A1 (en) Digital video content security authentication method and system thereof
US11165929B2 (en) Encrypted gallery management system and implementation method thereof
Lakshmi et al. Digital video watermarking tools: an overview
CN110891195A (en) Method, device and equipment for generating screen image and storage medium
CN108449627B (en) Video processing method, video source identification method, video processing device, video source identification device and video source identification medium
CN117336570B (en) Video tamper-proof system and method based on digital watermark, electronic equipment and medium
CN108256360A (en) The display methods and terminal of a kind of sensitive information
CN115550691A (en) Video processing method, video transmission method, video viewing method and device
CN114070950B (en) Image processing method, related device and equipment
CN112434327B (en) Information protection method and device and electronic equipment
Ahuja et al. Video data security: analysis, relevance and open challenges
US20220351323A1 (en) Steganographic techniques for tracking video access events
CN111860367B (en) Video repeatability identification method, electronic device and computer-readable storage medium
CN114157884B (en) High-efficiency cloud video cross-equipment screen projection method, system and storage medium
RU2839835C1 (en) Method and system for protecting authenticity of video generated by machine learning model
Kojima et al. Visible video data hiding techniques based on visual effects utilizing barcodes

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