CN117812437A - Video watermark processing method and device, storage medium and electronic equipment - Google Patents

Video watermark processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117812437A
CN117812437A CN202311798695.8A CN202311798695A CN117812437A CN 117812437 A CN117812437 A CN 117812437A CN 202311798695 A CN202311798695 A CN 202311798695A CN 117812437 A CN117812437 A CN 117812437A
Authority
CN
China
Prior art keywords
image
video
watermark information
frame
rectangular
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
CN202311798695.8A
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.)
Beijing Feixun Digital Technology Co ltd
Original Assignee
Beijing Feixun 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 Beijing Feixun Digital Technology Co ltd filed Critical Beijing Feixun Digital Technology Co ltd
Priority to CN202311798695.8A priority Critical patent/CN117812437A/en
Publication of CN117812437A publication Critical patent/CN117812437A/en
Pending legal-status Critical Current

Links

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The application relates to a video watermark processing method, a video watermark processing device, a storage medium and electronic equipment. The method is applied to the video receiving end, and comprises the following steps: receiving a first video sent by a video sending end, and decoding the first video to obtain a first image of each frame of the first video; generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end; embedding watermark information into a first image of each frame of a first video to obtain a second image corresponding to each frame; and encoding all the second images to obtain a second video, and playing the second video. The method and the device solve the technical problem that the traditional video watermark tracing method can cause too large resource consumption of the video sending end.

Description

Video watermark processing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of video tracing technologies, and in particular, to a method and apparatus for processing a video watermark, a storage medium, and an electronic device.
Background
The video tracing technology is used for limiting the video transmission range and tracing the information of related leaked video. Most of the current tracing technologies can be divided into video metadata tracing and video watermark tracing. The video metadata is traced, namely, the video publishing end embeds the related information of the receiving end in the coded video, and when the video is copied and propagated, the information of the original publishing end or the receiving end can be traced through the embedded related information. Video watermark tracing refers to embedding watermark information of a video possession end into a video, and when the video is propagated, the original all ends of the video can be traced. The information is embedded in metadata or explicit watermark, is easily noticed by an attacker, and can be easily tampered with. Therefore, embedding the invisible watermark becomes a better video tracing method, and the current common method is that the video transmitting end embeds the related information of the video receiving end in the invisible watermark mode before transmitting the video, and then transmits the information to the video receiving end. When the video is copied or propagated, the invisible watermark can be extracted, and the user knows from which video receiving end the invisible watermark is leaked. The defect of this way is that the video transmitting end needs to embed watermark aiming at different receiving ends, which increases the resource consumption of the transmitting end.
Disclosure of Invention
The application provides a processing method, a device, a storage medium and electronic equipment for video watermarking, which are used for solving the technical problem that the traditional video watermarking tracing method can cause too large resource consumption of a video sending end.
In a first aspect, the present application provides a method for processing a video watermark, which is applied to a video receiving end, including: receiving a first video sent by a video sending end, and decoding the first video to obtain a first image of each frame of the first video; generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end; embedding the watermark information into a first image of each frame of the first video to obtain a second image corresponding to each frame; and encoding all the second images to obtain a second video, and playing the second video.
In a second aspect, the present application provides a processing apparatus for video watermarking, applied to a video receiving end, including: the decoding module is used for receiving the first video sent by the video sending end, and decoding the first video to obtain a first image of each frame of the first video; the generation module is used for generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end; the embedding module is used for embedding the watermark information into the first image of each frame of the first video to obtain a second image corresponding to each frame; and the encoding module is used for encoding all the second images to obtain a second video and playing the second video.
As an alternative example, the above decoding module includes: the decoding unit is used for decoding the first video to obtain a third image in YUV format of each frame of the first video; the conversion unit is used for carrying out format conversion on the third image in the YUV format of each frame to obtain a first image in the RBG format corresponding to each frame.
As an alternative example, the above-mentioned embedding module includes: a processing unit, configured to take the first image of each frame as a current image, and perform the following operations on the current image: selecting a first rectangular image from the current image, wherein a first distance from the first rectangular image to the top end of the current image is one fourth of the width of the current image, a second distance from the first rectangular image to the bottom end of the current image is one half of the width of the current image, a third distance from the first rectangular image to the left end of the current image is one fourth of the length of the current image, and a fourth distance from the first rectangular image to the right end of the current image is one fourth of the length of the current image; performing discrete cosine transform on the first rectangular image to obtain a corresponding first frequency domain image; embedding the watermark information in a preset position of the first frequency domain image to obtain a second frequency domain image, wherein the brightness value of the preset position is three thousandths of the maximum brightness value of the first frequency domain image; and performing inverse discrete cosine transform on the second frequency domain image to obtain a second rectangular image, filling the second rectangular image into the current image, and obtaining a second image corresponding to the current image.
In a third aspect, the present application provides a method for processing a video watermark, which is applied to a video source tracing end, including: obtaining a third video, wherein the third video is obtained after a preset action is performed on a second video with watermark information embedded in each frame of image, the watermark information comprises an equipment identification number of a video receiving end for performing watermark information embedding operation on each frame of image, and the preset action comprises any one or more of screen recording, screenshot, shooting and forwarding; decoding the third video to obtain a fourth image of each frame of the third video; extracting watermark information in a target image, wherein the target image is any frame image in all the fourth images; and identifying the watermark information through a character identification algorithm to obtain the equipment identification number of the video receiving end in the watermark information.
In a fourth aspect, the present application provides a processing apparatus for video watermarking, applied to a video source tracing end, including: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a third video, the third video is obtained after a preset action is performed on a second video with watermark information embedded in each frame of image, the watermark information comprises an equipment identification number of a video receiving end for performing watermark information embedding operation on each frame of image, and the preset action comprises any one or more of screen recording, screenshot, shooting and forwarding; the decoding module is used for decoding the third video to obtain a fourth image of each frame of the third video; the extraction module is used for extracting watermark information in a target image, wherein the target image is any frame of image in all the fourth images; and the identification module is used for identifying the watermark information through a character identification algorithm to obtain the equipment identification number of the video receiving end in the watermark information.
As an optional example, the extracting module includes: a selecting unit configured to select a third rectangular image from the target images, where a fifth distance from the third rectangular image to a top end of the target image is a quarter of a width of the target image, a sixth distance from the third rectangular image to a bottom end of the target image is a half of the width of the target image, a seventh distance from the third rectangular image to a left end of the target image is a quarter of a length of the target image, and an eighth distance from the third rectangular image to a right end of the target image is a quarter of the length of the target image; the first processing unit is used for performing discrete cosine transform on the third rectangular image to obtain a fourth rectangular image; the second processing unit is used for carrying out logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image; and the third processing unit is used for carrying out normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing the watermark information.
As an alternative example, the second processing unit includes: a first processing subunit, configured to take each pixel of the fourth rectangular image as a current pixel, and perform the following operations on the current pixel: the second gray value is calculated by the following formula: y=ln (|x|+1); wherein Y is the second gray value, and x is the first gray value; and modifying the first gray level value of the current pixel to the second gray level value.
As an optional example, the third processing unit includes: a second processing subunit, configured to take each pixel of the fifth rectangular image as a current pixel, and perform the following operations on the current pixel: acquiring a third gray value of the current pixel; the fourth gray value is calculated by the following formula:
wherein dst is the fourth gray level, beta is a first preset value, alpha is a second preset value, src is a third gray level of the current pixel, min (src) is a minimum gray level of the fourth rectangular image, and max (src) is a maximum gray level of the fourth rectangular image; and modifying the third gray level value of the current pixel to the fourth gray level value.
In a fifth aspect, the present application provides a storage medium having a computer program stored therein, wherein the computer program when executed by a processor performs the method of processing a video watermark as described above.
In a sixth aspect, the present application further provides an electronic device comprising a memory, in which a computer program is stored, and a processor arranged to execute the method of processing a video watermark as described above by means of the computer program.
In the embodiment of the application, a first video sent by a video sending end is received, and the first video is decoded to obtain a first image of each frame of the first video; generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end; embedding the watermark information into a first image of each frame of the first video to obtain a second image corresponding to each frame; and encoding all the second images to obtain a second video, and playing the second video. In the method, each video receiving end embeds the watermark in each frame image in real time when decoding the received video, and before the video transmitting end transmits the video to the receiving end, watermark information does not need to be embedded in videos transmitted to different receiving ends, no matter which receiving end is transmitted with the video, no matter how many receiving ends are, the videos transmitted by the video transmitting end do not need to carry watermark information, thereby reducing the resource consumption of the video transmitting end. In addition, the watermark information comprising the self equipment identification number is embedded in each frame of image by the receiving end, so that the watermark information can be detected for each frame of image obtained by screen recording, screenshot, shooting or forwarding during video tracing, the phenomenon that the detected video is leaked from which video receiving end at first because the video is captured and cannot be traced due to the fact that the watermark information is not available is avoided, and the reliability and convenience of video tracing are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which the figures of the drawings are not to be taken in a limiting sense, unless otherwise indicated.
Fig. 1 is a flowchart of an alternative video watermark processing method according to an embodiment of the present application;
fig. 2 is a flowchart of embedding watermark information for an alternative video watermark processing method according to an embodiment of the present application;
FIG. 3 is a first rectangular image effect diagram of an alternative video watermarking method according to an embodiment of the application;
Fig. 4 is an embedded position diagram of watermark information of an alternative video watermarking method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an alternative video watermarking processing device according to an embodiment of the present application;
FIG. 6 is a flow chart of an alternative video watermark processing method according to an embodiment of the application;
fig. 7 is a flowchart of extracting watermark information for an alternative video watermark processing method according to an embodiment of the application;
fig. 8 is a schematic structural diagram of an alternative video watermarking processing device according to an embodiment of the present application;
fig. 9 is a schematic diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. 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 application based on the embodiments herein.
The following disclosure provides many different embodiments, or examples, for implementing different structures of the application. In order to simplify the disclosure of the present application, the components and arrangements of specific examples are described below. Of course, they are merely examples and are not intended to limit the present application. Furthermore, the present application may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.
The traditional video watermark tracing method is that before a video transmitting end transmits a first video to a video receiving end, watermark information is generated by equipment information of the video receiving end, then the watermark information is embedded into the first video and finally transmitted to the video receiving end, if the video transmitting end transmits the first video to a plurality of different video receiving ends, the video transmitting end is required to embed watermark processing for the first video for a plurality of times, and resource consumption of the video transmitting end is increased.
In order to solve the technical problem that the conventional video watermark tracing method may cause too much resource consumption of a video transmitting end, according to a first aspect of an embodiment of the present application, a processing method of a video watermark is provided and applied to a video receiving end, optionally, as shown in fig. 1, the method includes:
S102, receiving a first video sent by a video sending end, and decoding the first video to obtain a first image of each frame of the first video;
s104, generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end;
s106, embedding watermark information into a first image of each frame of the first video to obtain a second image corresponding to each frame;
s108, all the second images are encoded to obtain second videos, and the second videos are played.
Optionally, in the first embodiment, watermark information including a device identifier of the video receiving end is embedded while the video receiving end decodes and plays the first video, specifically, after the video receiving end receives the first video sent by the video sending end and selects and plays the first video, before the first video is displayed, the first video is decoded frame by frame to obtain a first image of each frame, then the device identifier of the video receiving end is obtained, watermark information is generated according to the device identifier, then the watermark information is embedded into the first image of each frame to obtain a second image corresponding to each frame image, at this time, the second image of each frame includes watermark information, and finally, the second images of all frames are encoded to obtain a second video including watermark information, and the second video is played. Therefore, by the method of the embodiment, only the video receiving end is required to perform the watermark embedding processing, and the video transmitting end is not required to perform the watermark embedding processing, so that the watermark embedding can be performed in real time when the video receiving end decodes and plays the video, the purpose of reducing the resource consumption of the video transmitting end is realized, and the technical problem that the traditional video watermark tracing method can cause too large resource consumption of the video transmitting end is solved.
In the second embodiment, after receiving the first video sent by the video sending end, if the first video is to be played by the video receiving end, watermark information is to be embedded in real time, however, the watermark information is to be embedded in a first image of each frame of the first video, so that the first image of each frame needs to be decoded before the watermark information is embedded.
Optionally, decoding the first video to obtain a first image of each frame of the first video includes:
decoding the first video to obtain a third image in YUV format of each frame of the first video;
and carrying out format conversion on the third image in the YUV format of each frame to obtain a first image in the RBG format corresponding to each frame.
Optionally, in the second embodiment, the first video received by the video receiving device is in H264 format or H265 format in most cases, when the first video is decoded, an image in YUV format is obtained, so after the first video is decoded to obtain a third image in YUV format of each frame, format conversion needs to be performed on the third image in YUV format of each frame, and the third image in YUV format of each frame is converted into RBG format, so as to obtain the first image in RBG format corresponding to each frame. Since the first image in RBG format is generally more intuitive, easy to understand, and supports many image processing algorithms, it is easier to perform various image processing operations to convert the third image in YUV format into the first image in RBG format, so that the embedding speed of watermark information can be increased.
In the third embodiment, after receiving the first video sent by the video sending end, if the first video is to be played by the video receiving end, watermark information is to be embedded in real time, so that watermark information needs to be embedded in the first image of each frame of the first video after the first image of each frame of the first video is obtained. However, in the traditional watermark embedding method, watermark information is generated according to equipment information, and then the watermark information is explicitly embedded into a video, so that a user can see the watermark information with naked eyes when the video is played, and the watermark information is easily tampered by an attacker, and the security is low. In order to solve the technical problem of low security of the watermark embedding method, in this embodiment, watermark information is embedded in each frame image of the first video in a hidden manner by hidden processing of the watermark information.
Optionally, embedding watermark information onto the first image of each frame of the first video, obtaining the second image corresponding to each frame includes:
taking the first image of each frame as a current image, and executing the following operations on the current image:
Selecting a first rectangular image from the current image, wherein a first distance between the first rectangular image and the top end of the current image is one fourth of the width of the current image, a second distance between the first rectangular image and the bottom end of the current image is one half of the width of the current image, a third distance between the first rectangular image and the left end of the current image is one fourth of the length of the current image, and a fourth distance between the first rectangular image and the right end of the current image is one fourth of the length of the current image;
performing discrete cosine transform on the first rectangular image to obtain a corresponding first frequency domain image;
embedding watermark information in a preset position of the first frequency domain image to obtain a second frequency domain image, wherein the brightness value of the preset position is three thousandths of the maximum brightness value of the first frequency domain image;
and performing inverse discrete cosine transform on the second frequency domain image to obtain a second rectangular image, filling the second rectangular image into the current image, and obtaining a second image corresponding to the current image.
Optionally, in the third embodiment, taking the first image of any frame as the current image and taking embedding watermark information on the current image as an example, first, selecting a first rectangular image in the current image, where a selection rule is that a first distance between the first rectangular image and a top end of the current image is one fourth of a width of the current image, a second distance between the first rectangular image and a bottom end of the current image is one half of a width of the current image, a third distance between the first rectangular image and a left end of the current image is one fourth of a length of the current image, and a fourth distance between the first rectangular image and a right end of the current image is one fourth of a length of the current image. The first rectangular image is then subjected to a discrete cosine transform (Discrete Cosine Transform, DCT), a mathematical transform technique commonly used for image and signal processing, typically for image compression and frequency domain analysis, to obtain a corresponding first frequency domain image. The discrete cosine transform converts a signal or image in the spatial domain into a representation in the frequency domain, which reduces redundancy of data to enable compression or other processing, while the discrete cosine transform processes the image faster than the discrete fourier transform. The frequency domain image is used to represent the distribution of different frequency components in the image, in which components of different frequencies can be seen, as well as their amplitude and phase information. And then embedding watermark information in a preset position of the first frequency domain image to obtain a second frequency domain image, wherein the determination rule of the preset position is that the brightness value of the preset position is three thousandths of the maximum brightness value of the first frequency domain image. In the first frequency domain image, the low-frequency information is positioned at the left upper corner of the frequency domain image, pixels with pixel values higher than three thousandths of the maximum brightness value of the whole first frequency domain image are searched for from the left upper corner to the right lower corner (45 degrees obliquely), when the vertical distance between the adjacent pixels is greater than the height of watermark information to be written, the embedding position of the watermark information is between the two adjacent pixels, and three thousandths of the maximum brightness value of the whole first frequency domain image is selected to embed the watermark information, so that the watermark information is not too weak and the image distortion caused by the too strong watermark information is not too strong. And finally, performing inverse discrete cosine transform on the second frequency domain image to obtain a second rectangular image embedded with information, and filling the second rectangular image to the position of the first rectangular image of the current image to obtain a corresponding second image. Therefore, watermark information can be embedded into each frame of image of the first video in a invisible manner, and the safety of a watermark embedding method is improved. Meanwhile, in the third embodiment, watermark embedding is performed by selecting only a partial region of each frame image, so that the speed of watermark embedding can be increased.
In connection with an example, the present application relates to a processing method of video watermarking, in which when a video receiving end plays a first video sent by a video sending end, after decoding the first video, before displaying the first video, invisible watermark information including a device identification code of the video receiving end is embedded, and if a screen recording, a screenshot or a shooting situation exists during playing, an original divulgence person can be traced by extracting an invisible watermark from the recorded video. In addition, the invisible watermark in the application has good anti-stretching and anti-rotation capacity, and the embedded watermark has high speed, so that the normal playing of a playing end is not influenced.
The flow of embedding watermark information is shown in fig. 2:
step one: after receiving a first video sent by a video sending end, a video receiving end decodes the first video and converts the first video into a first image in each frame RGB format;
step two: selecting a first rectangular image from the first image, wherein the selection rule is that a first distance from the first rectangular image to the top end of the first image is one fourth of the width of the first image, a second distance from the first rectangular image to the bottom end of the first image is one half of the width of the first image, a third distance from the first rectangular image to the left end of the first image is one fourth of the length of the first image, and a fourth distance from the first rectangular image to the right end of the first image is one fourth of the length of the first image, as shown in fig. 3;
Step three: performing discrete cosine transform on the first rectangular image to obtain a corresponding first frequency domain image;
step four: obtaining the maximum brightness value of the first frequency domain image;
step five: acquiring an equipment identification code of a video receiving end, and generating watermark information according to the equipment identification code;
step six: watermark information is embedded in a preset position of the first frequency domain image to obtain a second frequency domain image, wherein, as shown in fig. 4, the determination rule of the preset position is that the brightness value of the preset position is three thousandths of the maximum brightness value of the first frequency domain image. In the first frequency domain image, the low-frequency information is positioned at the left upper corner of the frequency domain image, and pixels with pixel values higher than the maximum brightness value of the whole first frequency domain image by three thousandths are searched from the left upper corner to the right lower corner (45 degrees obliquely downwards);
step seven: performing inverse discrete cosine transform on the second frequency domain image to obtain a second rectangular image with embedded information;
step eight: filling the second rectangular image to the position of the first rectangular image of the current image to obtain a corresponding second image;
step nine: converting the format of the second image into YUV format, encoding the YUV format, and playing and displaying the second video containing watermark information.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
According to another aspect of the embodiments of the present application, there is further provided a processing apparatus for video watermarking, as shown in fig. 5, applied to a video receiving end, including:
the decoding module 502 is configured to receive a first video sent by the video sending end, and decode the first video to obtain a first image of each frame of the first video;
a generating module 504, configured to generate watermark information of the video receiving end, where the watermark information includes an equipment identification number of the video receiving end;
an embedding module 506, configured to embed watermark information into a first image of each frame of the first video, to obtain a second image corresponding to each frame;
The encoding module 508 is configured to encode all the second images to obtain a second video, and play the second video.
Optionally, in the conventional video watermark tracing method, before the video transmitting end transmits the first video to the video receiving end, watermark information is generated by device information of the video receiving end, then the watermark information is embedded into the first video and finally transmitted to the video receiving end, if the video transmitting end transmits the first video to a plurality of different video receiving ends, the video transmitting end is required to embed watermark processing for the first video for a plurality of times, so that resource consumption of the video transmitting end is increased. The method aims to solve the technical problem that the traditional video watermark tracing method can cause too large resource consumption of a video sending end. In the first embodiment, watermark information including a device identifier of a video receiving end is embedded while a video receiving end decodes and plays a first video, specifically, after the video receiving end receives the first video sent by a video sending end and selects to play the first video, before the first video is displayed, the first video is decoded frame by frame to obtain a first image of each frame, then the device identifier of the video receiving end is obtained, watermark information is generated according to the device identifier, then the watermark information is embedded into the first image of each frame to obtain a second image corresponding to each frame image, at this time, the second image of each frame contains watermark information, finally, the second images of all frames are encoded to obtain a second video containing watermark information, and the second video is played. Therefore, by the method of the embodiment, only the video receiving end is required to perform the watermark embedding processing, and the video transmitting end is not required to perform the watermark embedding processing, so that the watermark embedding can be performed in real time when the video receiving end decodes and plays the video, the purpose of reducing the resource consumption of the video transmitting end is realized, and the technical problem that the traditional video watermark tracing method can cause too large resource consumption of the video transmitting end is solved.
As an alternative example, the first control module includes:
the decoding unit is used for decoding the first video to obtain a third image in YUV format of each frame of the first video;
the conversion unit is used for carrying out format conversion on the third image in the YUV format of each frame to obtain a first image in the RBG format corresponding to each frame.
Optionally, after receiving the first video sent by the video sending end, if the first video is to be played by the video receiving end, watermark information is to be embedded in real time, however, the watermark information is to be embedded in a first image of each frame of the first video, so that the first image of each frame needs to be decoded before the watermark information is embedded. In the second embodiment, the first video received by the video receiving end is in H264 format or H265 format in most cases, and when the first video is decoded, an image in YUV format is obtained, so after the first video is decoded to obtain a third image in YUV format of each frame, format conversion needs to be performed on the third image in YUV format of each frame, and the third image in YUV format of each frame is converted into RBG format, so as to obtain a first image in RBG format corresponding to each frame. Since the first image in RBG format is generally more intuitive, easy to understand, and supports many image processing algorithms, it is easier to perform various image processing operations to convert the third image in YUV format into the first image in RBG format, so that the embedding speed of watermark information can be increased.
As an alternative example, the second control module includes:
a processing unit, configured to take the first image of each frame as a current image, and perform the following operations on the current image:
selecting a first rectangular image from the current image, wherein a first distance between the first rectangular image and the top end of the current image is one fourth of the width of the current image, a second distance between the first rectangular image and the bottom end of the current image is one half of the width of the current image, a third distance between the first rectangular image and the left end of the current image is one fourth of the length of the current image, and a fourth distance between the first rectangular image and the right end of the current image is one fourth of the length of the current image;
performing discrete cosine transform on the first rectangular image to obtain a corresponding first frequency domain image;
embedding watermark information in a preset position of the first frequency domain image to obtain a second frequency domain image, wherein the brightness value of the preset position is three thousandths of the maximum brightness value of the first frequency domain image;
and performing inverse discrete cosine transform on the second frequency domain image to obtain a second rectangular image, filling the second rectangular image into the current image, and obtaining a second image corresponding to the current image.
Optionally, after receiving the first video sent by the video sending end, if the first video is to be played by the video receiving end, watermark information is to be embedded in real time, so that watermark information needs to be embedded in the first image of each frame of the first video after the first image of each frame of the first video is obtained. However, in the traditional watermark embedding method, watermark information is generated according to equipment information, and then the watermark information is explicitly embedded into a video, so that a user can see the watermark information with naked eyes when the video is played, and the watermark information is easily tampered by an attacker, and the security is low. In order to solve the technical problem of low security of the watermark embedding method, in this embodiment, watermark information is embedded in each frame image of the first video in a hidden manner by hidden processing of the watermark information. In the third embodiment, taking a first image of any frame as a current image and taking embedding watermark information on the current image as an example, firstly, selecting a first rectangular image in the current image, wherein a selection rule is that a first distance between the first rectangular image and the top end of the current image is one fourth of the width of the current image, a second distance between the first rectangular image and the bottom end of the current image is one half of the width of the current image, a third distance between the first rectangular image and the left end of the current image is one fourth of the length of the current image, and a fourth distance between the first rectangular image and the right end of the current image is one fourth of the length of the current image. The first rectangular image is then subjected to a discrete cosine transform (Discrete Cosine Transform, DCT), a mathematical transform technique commonly used for image and signal processing, typically for image compression and frequency domain analysis, to obtain a corresponding first frequency domain image. The discrete cosine transform converts a signal or image in the spatial domain into a representation in the frequency domain, which reduces redundancy of data to enable compression or other processing, while the discrete cosine transform processes the image faster than the discrete fourier transform. The frequency domain image is used to represent the distribution of different frequency components in the image, in which components of different frequencies can be seen, as well as their amplitude and phase information. And then embedding watermark information in a preset position of the first frequency domain image to obtain a second frequency domain image, wherein the determination rule of the preset position is that the brightness value of the preset position is three thousandths of the maximum brightness value of the first frequency domain image. In the first frequency domain image, the low-frequency information is positioned at the left upper corner of the frequency domain image, pixels with pixel values higher than three thousandths of the maximum brightness value of the whole first frequency domain image are searched for from the left upper corner to the right lower corner (45 degrees obliquely), when the vertical distance between the adjacent pixels is greater than the height of watermark information to be written, the embedding position of the watermark information is between the two adjacent pixels, and three thousandths of the maximum brightness value of the whole first frequency domain image is selected to embed the watermark information, so that the watermark information is not too weak and the image distortion caused by the too strong watermark information is not too strong. And finally, performing inverse discrete cosine transform on the second frequency domain image to obtain a second rectangular image embedded with information, and filling the second rectangular image to the position of the first rectangular image of the current image to obtain a corresponding second image. Therefore, watermark information can be embedded into each frame of image of the first video in a invisible manner, and the safety of a watermark embedding method is improved. Meanwhile, in the third embodiment, watermark embedding is performed by selecting only a partial region of each frame image, so that the speed of watermark embedding can be increased.
In the first embodiment, after the second video is played, the video receiving end is likely to perform operations such as screen recording, screenshot, shooting, forwarding and the like on the second video, so that the video is likely to leak, and the privacy of the video sending end is likely to leak, so that after watermark information is embedded in the first video, if the first video leaks or is forwarded, a source tracing needs to be performed on a leak person of the first video. According to a third aspect of the embodiments of the present application, a method for processing a video watermark is provided, which is applied to a video source-tracing end, and optionally, as shown in fig. 6, the method includes:
s602, obtaining a third video, wherein the third video is obtained after a preset action is performed on a second video with watermark information embedded in each frame of image, the watermark information comprises an equipment identification number of a video receiving end for performing watermark information embedding operation on each frame of image, and the preset action comprises any one or more of screen recording, screenshot, shooting and forwarding;
s604, decoding the third video to obtain a fourth image of each frame of the third video;
s606, extracting watermark information in a target image, wherein the target image is any frame of image in all fourth images;
S608, the watermark information is identified through a character identification algorithm, and the equipment identification number of the video receiving end in the watermark information is obtained.
Optionally, in this embodiment, when the video receiving end receives the first video sent by the video sending end, watermark information including the device identification number of the video receiving end is embedded into the first video, so as to obtain and play the second video. Any device performs operations such as screen recording, screenshot, shooting, forwarding and the like on the second video with watermark information embedded in each frame, and the traceability person can trace the leaked third video, and the third video can also be a video obtained by the second video through multiple preset actions, for example, multiple forwarding, and then the third video can be obtained from any device side in the forwarding process. When the third video is required to be traced, watermark information is extracted from the leaked or forwarded third video containing watermark information, so that a video receiving end equipment identification code is obtained, and equipment for leaking the first video is determined. Specifically, decoding a third video recorded on a screen, or captured, or shot, or forwarded to obtain a YUV format image of each frame, then performing format conversion to obtain a RBG format fourth image of each frame, selecting any frame of target image from all the fourth images to extract watermark information, obtaining watermark information, and finally identifying the watermark information through a character identification algorithm to obtain a device identification number, wherein the device identification number can be observed by naked eyes by the watermark information at the moment, so that the device identification number can be obtained through naked eye identification. In the method, the third video which is leaked or forwarded and contains watermark information is extracted to obtain the identification code of the video receiving end equipment, so that the aim of tracing the information of the original divulger is fulfilled, and in the process of extracting the watermark information, only one frame of image is extracted, so that the speed of extracting the watermark information is greatly increased.
In the second embodiment, since watermark information in the target image is embedded in a hidden embedding manner, it is necessary to extract the watermark information in the target image through image processing.
Optionally, extracting watermark information in the target image includes:
selecting a third rectangular image from the target image, wherein the fifth distance from the third rectangular image to the top end of the target image is one fourth of the width of the target image, the sixth distance from the third rectangular image to the bottom end of the target image is one half of the width of the target image, the seventh distance from the third rectangular image to the left end of the target image is one fourth of the length of the target image, and the eighth distance from the third rectangular image to the right end of the target image is one fourth of the length of the target image;
performing discrete cosine transform on the third rectangular image to obtain a fourth rectangular image;
carrying out logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image;
and carrying out normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information.
Optionally, performing a logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image includes:
taking each pixel of the fourth rectangular image as a current pixel, performing the following operation on the current pixel:
Acquiring a first gray value of a current pixel;
the second gray value is calculated by the following formula:
Y=ln(|x|+1);
wherein Y is a second gray value, and x is a first gray value;
the first gray value of the current pixel is modified to a second gray value.
Optionally, performing normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information includes:
taking each pixel of the fifth rectangular image as a current pixel, performing the following operation on the current pixel:
acquiring a third gray value of the current pixel;
the fourth gray value is calculated by the following formula:
wherein dst is a fourth gray value, beta is a first preset value, alpha is a second preset value, src is a third gray value of the current pixel, min (src) is a minimum gray value of the fourth rectangular image, and max (src) is a maximum gray value of the fourth rectangular image;
and modifying the third gray value of the current pixel to a fourth gray value.
Optionally, in the second embodiment, when watermark information is extracted from the third image, a third rectangular image needs to be selected from the third image, a fifth distance between the third rectangular image and a top end of the third image is a quarter of a width of the third image, a sixth distance between the third rectangular image and a bottom end of the third image is a half of a width of the third image, a seventh distance between the third rectangular image and a left end of the third image is a quarter of a length of the third image, and an eighth distance between the third rectangular image and a right end of the third image is a quarter of a length of the third image, that is, a position of the first rectangular image. And performing discrete cosine transform on the third rectangular image to obtain a fourth rectangular image of the corresponding frequency domain image, performing logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image, performing normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information, and visualizing the watermark information through logarithmic operation and normalization operation, so that the equipment identification code in the watermark information can be identified through a character recognition algorithm.
Optionally, when performing a logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image, performing the logarithmic operation on the fourth rectangular image according to y=ln (|x|+1) to obtain the fifth rectangular image, where if the gray value of the pixel at the position i in the fourth rectangular image is x, after calculating Y according to y=ln (|x|+1), changing the gray value of the pixel at the position i in the fourth rectangular image to Y, and finally obtaining the fifth rectangular image.
Optionally, the normalizing operation is performed on the fifth rectangular image, and when the sixth rectangular image containing watermark information is obtained, the normalizing operation is performed according to the following steps And carrying out normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information, wherein alpha can be 0, beta is 255, src is the gray value of each pixel in the fifth rectangular image, min (src) is the minimum gray value of the fourth rectangular image, max (src) is the maximum gray value of the fourth rectangular image, and after dst is obtained, changing the gray value of each pixel in the fifth rectangular image into the corresponding dst.
Alternatively, in the second embodiment, watermark information is extracted from the target image by discrete cosine transform, logarithmic operation, normalization operation, and the like, so that the speed of watermark information extraction can be increased.
Describing with an example, the flow of extracting watermark information is shown in fig. 7:
step one: decoding the third video to obtain a YUV format image of each frame, and then performing format conversion to obtain a RBG format fourth image of each frame;
step two: selecting any frame of target image from all fourth images, selecting a third rectangular image from the target image, wherein the fifth distance between the third rectangular image and the top end of the target image is one fourth of the width of the target image, the sixth distance between the third rectangular image and the bottom end of the target image is one half of the width of the target image, the seventh distance between the third rectangular image and the left end of the target image is one fourth of the length of the target image, and the eighth distance between the third rectangular image and the right end of the target image is one fourth of the length of the target image, namely the position of the first rectangular image;
step three: performing discrete cosine transform on the third rectangular image to obtain a fourth rectangular image of the corresponding frequency domain image;
step four: carrying out logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image, specifically carrying out logarithmic operation on the fourth rectangular image according to Y=ln (|x|+1) to obtain a fifth rectangular image, wherein if the pixel gray value at the position i in the fourth rectangular image is x, after Y is calculated according to Y=ln (|x|+1), changing the pixel gray value at the position i in the fourth rectangular image into Y, and finally obtaining the fifth rectangular image;
Step five: normalizing the fifth rectangular image to obtain a visualized sixth rectangular image containing watermark information, specifically according to the following steps of Carrying out normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information, wherein alpha can be 0, beta is 255, src is the gray value of each pixel in the fifth rectangular image, min (src) is the minimum gray value of the fourth rectangular image, max (src) is the maximum gray value of the fourth rectangular image, and after dst is obtained, changing the gray value of each pixel in the fifth rectangular image into the corresponding dst;
step six: the device identification code in the watermark information is identified by a character recognition algorithm.
According to a fourth aspect of the embodiments of the present application, there is further provided a processing apparatus for video watermarking, applied to a video tracing end, as shown in fig. 8, including:
the obtaining module 802 is configured to obtain a third video, where the third video is a video obtained after performing a preset action on a second video in which watermark information is embedded in each frame of image, and the watermark information includes an equipment identification number of a video receiving end that performs an operation of embedding watermark information in each frame of image, and the preset action includes, but is not limited to, any one or more of screen recording, screenshot, shooting, and forwarding;
A decoding module 804, configured to decode the third video to obtain a fourth image of each frame of the third video;
an extracting module 806, configured to extract watermark information in a target image, where the target image is any frame of image in all fourth images;
and the identification module 808 is configured to identify the watermark information by using a character recognition algorithm, so as to obtain the device identification number of the video receiving end in the watermark information.
Optionally, after the second video is played, the video receiving end may perform operations such as screen recording, screenshot, shooting, forwarding, etc. on the second video, so that the video may leak, and the privacy of the video sending end may be likely to leak, so after the watermark information is embedded in the first video, if the first video leaks or forwards, a source tracing needs to be performed on a leak person of the first video. In this embodiment, when the video receiving end receives the first video sent by the video sending end, watermark information including the device identification number of the video receiving end is embedded into the first video, and a second video is obtained and played. Any device performs operations such as screen recording, screenshot, shooting, forwarding and the like on the second video with watermark information embedded in each frame, and the traceability person can trace the leaked third video, and the third video can also be a video obtained by the second video through multiple preset actions, for example, multiple forwarding, and then the third video can be obtained from any device side in the forwarding process. When the third video is required to be traced, watermark information is extracted from the leaked or forwarded third video containing watermark information, so that a video receiving end equipment identification code is obtained, and equipment for leaking the first video is determined. Specifically, decoding a third video recorded on a screen, or captured, or shot, or forwarded to obtain a YUV format image of each frame, then performing format conversion to obtain a RBG format fourth image of each frame, selecting any frame of target image from all the fourth images to extract watermark information, obtaining watermark information, and finally identifying the watermark information through a character identification algorithm to obtain a device identification number, wherein the device identification number can be observed by naked eyes by the watermark information at the moment, so that the device identification number can be obtained through naked eye identification. In the method, the third video which is leaked or forwarded and contains watermark information is extracted to obtain the identification code of the video receiving end equipment, so that the aim of tracing the information of the original divulger is fulfilled, and in the process of extracting the watermark information, only one frame of image is extracted, so that the speed of extracting the watermark information is greatly increased.
As an alternative example, the extraction module includes:
a selecting unit, configured to select a third rectangular image from the target image, where a fifth distance between the third rectangular image and a top end of the target image is a quarter of a width of the target image, a sixth distance between the third rectangular image and a bottom end of the target image is a half of the width of the target image, a seventh distance between the third rectangular image and a left end of the target image is a quarter of a length of the target image, and an eighth distance between the third rectangular image and a right end of the target image is a quarter of the length of the target image;
the first processing unit is used for performing discrete cosine transform on the third rectangular image to obtain a fourth rectangular image;
the second processing submodule is used for carrying out logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image;
and the third processing unit is used for carrying out normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information.
As an alternative example, the second processing unit includes:
a first processing subunit, configured to take each pixel of the fourth rectangular image as a current pixel, and perform the following operations on the current pixel:
Acquiring a first gray value of a current pixel;
the second gray value is calculated by the following formula:
Y=ln(|x|+1);
wherein Y is a second gray value, and x is a first gray value;
the first gray value of the current pixel is modified to a second gray value.
As an alternative example, the third processing unit includes:
a second processing subunit, configured to take each pixel of the fifth rectangular image as a current pixel, and perform the following operations on the current pixel:
acquiring a third gray value of the current pixel;
the fourth gray value is calculated by the following formula:
wherein dst is a fourth gray value, beta is a first preset value, alpha is a second preset value, src is a third gray value of the current pixel, min (src) is a minimum gray value of the fourth rectangular image, and max (src) is a maximum gray value of the fourth rectangular image;
and modifying the third gray value of the current pixel to a fourth gray value.
Optionally, since the watermark information in the target image is embedded by means of implicit embedding, it is necessary to extract the watermark information in the target image through image processing. In this embodiment, when watermark information is extracted from the third image, a third rectangular image is selected from the third image, a fifth distance between the third rectangular image and a top end of the third image is a quarter of a width of the third image, a sixth distance between the third rectangular image and a bottom end of the third image is a half of a width of the third image, a seventh distance between the third rectangular image and a left end of the third image is a quarter of a length of the third image, and an eighth distance between the third rectangular image and a right end of the third image is a quarter of a length of the third image, that is, a position of the first rectangular image. And performing discrete cosine transform on the third rectangular image to obtain a fourth rectangular image of the corresponding frequency domain image, performing logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image, performing normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information, and visualizing the watermark information through logarithmic operation and normalization operation, so that the equipment identification code in the watermark information can be identified through a character recognition algorithm.
Optionally, when performing a logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image, performing the logarithmic operation on the fourth rectangular image according to y=ln (|x|+1) to obtain the fifth rectangular image, where if the gray value of the pixel at the position i in the fourth rectangular image is x, after calculating Y according to y=ln (|x|+1), changing the gray value of the pixel at the position i in the fourth rectangular image to Y, and finally obtaining the fifth rectangular image.
Optionally, the normalizing operation is performed on the fifth rectangular image, and when the sixth rectangular image containing watermark information is obtained, the normalizing operation is performed according to the following steps And carrying out normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing watermark information, wherein alpha can be 0, beta is 255, src is the gray value of each pixel in the fifth rectangular image, min (src) is the minimum gray value of the fourth rectangular image, max (src) is the maximum gray value of the fourth rectangular image, and after dst is obtained, changing the gray value of each pixel in the fifth rectangular image into the corresponding dst.
Optionally, in this embodiment, watermark information is extracted from the target image by discrete cosine transform, logarithmic operation, normalization operation, and other methods, so that the speed of extracting watermark information can be increased.
For other examples of this embodiment, please refer to the above examples, and are not described herein.
Fig. 9 is a schematic diagram of an alternative electronic device, as shown in fig. 9, including a processor 902, a communication interface 904, a memory 906, and a communication bus 908, wherein the processor 902, the communication interface 904, and the memory 906 communicate with each other via the communication bus 908, wherein,
a memory 906 for storing a computer program;
the processor 902 is configured to execute the computer program stored in the memory 906, and implement the following steps:
receiving a first video sent by a video sending end, and decoding the first video to obtain a first image of each frame of the first video;
generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end;
embedding watermark information into a first image of each frame of a first video to obtain a second image corresponding to each frame;
and encoding all the second images to obtain a second video, and playing the second video.
Alternatively, in the present embodiment, the above-described communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 9, but not only one bus or one type of bus. The communication interface is used for communication between the electronic device and other devices.
The memory may include RAM or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
As an example, the memory 906 may include, but is not limited to, the first control module 502, the generating module 504, the second control module 506, and the third control module 508 in the processing device including the video watermark. In addition, other module units in the processing apparatus of video watermarking may be included, but are not limited to, and are not described in detail in this example.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the structure shown in fig. 9 is only illustrative, and the device implementing the video watermarking method may be a terminal device, and the terminal device may be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palmtop computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 9 does not limit the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 9, or have a different configuration than shown in FIG. 9.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, etc.
According to yet another aspect of embodiments of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program when executed by a processor performs the steps in the method of processing video watermarks described above.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (11)

1. A method for processing a video watermark, applied to a video receiving end, comprising:
receiving a first video sent by a video sending end, and decoding the first video to obtain a first image of each frame of the first video;
generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end;
embedding the watermark information into a first image of each frame of the first video to obtain a second image corresponding to each frame;
And encoding all the second images to obtain a second video, and playing the second video.
2. The method of claim 1, wherein decoding the first video to obtain a first image for each frame of the first video comprises:
decoding the first video to obtain a third image in YUV format of each frame of the first video;
and carrying out format conversion on the third image in the YUV format of each frame to obtain a first image in the RBG format corresponding to each frame.
3. The method of claim 1, wherein embedding the watermark information onto the first image of each frame of the first video to obtain the second image corresponding to each frame comprises:
taking the first image of each frame as a current image, and executing the following operations on the current image:
selecting a first rectangular image from the current image, wherein a first distance between the first rectangular image and the top end of the current image is one fourth of the width of the current image, a second distance between the first rectangular image and the bottom end of the current image is one half of the width of the current image, a third distance between the first rectangular image and the left end of the current image is one fourth of the length of the current image, and a fourth distance between the first rectangular image and the right end of the current image is one fourth of the length of the current image;
Performing discrete cosine transform on the first rectangular image to obtain a corresponding first frequency domain image;
embedding the watermark information in a preset position of the first frequency domain image to obtain a second frequency domain image, wherein the brightness value of the preset position is three thousandths of the maximum brightness value of the first frequency domain image;
and performing inverse discrete cosine transform on the second frequency domain image to obtain a second rectangular image, filling the second rectangular image into the current image, and obtaining a second image corresponding to the current image.
4. The processing method of the video watermark is characterized by being applied to a video tracing end and comprising the following steps:
obtaining a third video, wherein the third video is obtained after a preset action is performed on a second video with watermark information embedded in each frame of image, the watermark information comprises an equipment identification number of a video receiving end for performing watermark information embedding operation on each frame of image, and the preset action comprises any one or more of screen recording, screenshot, shooting and forwarding;
decoding the third video to obtain a fourth image of each frame of the third video;
Extracting watermark information in a target image, wherein the target image is any frame of image in all fourth images;
and identifying the watermark information through a character identification algorithm to obtain the equipment identification number of the video receiving end in the watermark information.
5. The method of claim 1, wherein extracting watermark information in the target image comprises:
selecting a third rectangular image from the target image, wherein a fifth distance from the third rectangular image to the top end of the target image is one fourth of the width of the target image, a sixth distance from the third rectangular image to the bottom end of the target image is one half of the width of the target image, a seventh distance from the third rectangular image to the left end of the target image is one fourth of the length of the target image, and an eighth distance from the third rectangular image to the right end of the target image is one fourth of the length of the target image;
performing discrete cosine transform on the third rectangular image to obtain a fourth rectangular image;
carrying out logarithmic operation on the fourth rectangular image to obtain a fifth rectangular image;
And carrying out normalization operation on the fifth rectangular image to obtain a sixth rectangular image containing the watermark information.
6. The method of claim 5, wherein logarithmically manipulating the fourth rectangular image to obtain a fifth rectangular image comprises:
taking each pixel of the fourth rectangular image as a current pixel, and executing the following operation on the current pixel:
acquiring a first gray value of the current pixel;
the second gray value is calculated by the following formula:
Y=ln(|x|+1);
wherein Y is the second gray value and x is the first gray value;
and modifying the first gray level value of the current pixel to the second gray level value.
7. The method of claim 5, wherein normalizing the fifth rectangular image to obtain a sixth rectangular image comprising the watermark information comprises:
taking each pixel of the fifth rectangular image as a current pixel, and executing the following operation on the current pixel:
acquiring a third gray value of the current pixel;
the fourth gray value is calculated by the following formula:
wherein dst is the fourth gray value, beta is a first preset value, alpha is a second preset value, src is the third gray value of the current pixel, min (src) is the minimum gray value of the fourth rectangular image, and max (src) is the maximum gray value of the fourth rectangular image;
And modifying the third gray level value of the current pixel to the fourth gray level value.
8. A processing apparatus for video watermarking, applied to a video receiving terminal, comprising:
the decoding module is used for receiving a first video sent by the video sending end, and decoding the first video to obtain a first image of each frame of the first video;
the generation module is used for generating watermark information of the video receiving end, wherein the watermark information comprises an equipment identification number of the video receiving end;
the embedding module is used for embedding the watermark information into a first image of each frame of the first video to obtain a second image corresponding to each frame;
and the encoding module is used for encoding all the second images to obtain a second video and playing the second video.
9. The processing device of the video watermark is characterized by being applied to a video tracing end and comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a third video, wherein the third video is obtained after a preset action is performed on a second video with watermark information embedded in each frame of image, the watermark information comprises an equipment identification number of a video receiving end for performing watermark information embedding operation on each frame of image, and the preset action comprises any one or more of screen recording, screenshot, shooting and forwarding;
The decoding module is used for decoding the third video to obtain a fourth image of each frame of the third video;
the extraction module is used for extracting watermark information in a target image, wherein the target image is any frame of image in all the fourth images;
and the identification module is used for identifying the watermark information through a character identification algorithm to obtain the equipment identification number of the video receiving end in the watermark information.
10. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the method of any one of claims 1 to 4 or 5 to 7.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 4 or 5 to 7 by means of the computer program.
CN202311798695.8A 2023-12-25 2023-12-25 Video watermark processing method and device, storage medium and electronic equipment Pending CN117812437A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311798695.8A CN117812437A (en) 2023-12-25 2023-12-25 Video watermark processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311798695.8A CN117812437A (en) 2023-12-25 2023-12-25 Video watermark processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117812437A true CN117812437A (en) 2024-04-02

Family

ID=90419156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311798695.8A Pending CN117812437A (en) 2023-12-25 2023-12-25 Video watermark processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117812437A (en)

Similar Documents

Publication Publication Date Title
Fang et al. Screen-shooting resilient watermarking
EP3308371B1 (en) System and method for digital watermarking
US11232598B2 (en) Distinct encoding and decoding of stable information and transient/stochastic information
US20230008085A1 (en) Method for embedding watermark in video data and apparatus, method for extracting watermark in video data and apparatus, device, and storage medium
CN112561766B (en) Image steganography and extraction method and device and electronic equipment
CN111932432B (en) Blind watermark implanting method, blind watermark detecting method, blind watermark implanting device, blind watermark detecting equipment and storage medium
US20160171639A1 (en) Chaotic watermarking for a digital image
Por et al. An enhanced mechanism for image steganography using sequential colour cycle algorithm.
Pizzolante et al. Copyright protection for images on mobile devices
CN116228507B (en) Digital text watermark tracing method and system
KR102637177B1 (en) Method and apparatus for verifying integrity of image based on watermark
Al-Otum et al. Copyright protection of color images for android-based smartphones using watermarking with quick-response code
Chung et al. Reversible data hiding for depth maps using the depth no-synthesis-error model
WO2017128788A1 (en) Sharing method and sharing system of wifi password
CN110248209B (en) Transmission method and system for bullet screen anti-shielding mask information
WO2012164361A1 (en) Frequency-modulated watermarking
Maiorana et al. Multi‐bit watermarking of high dynamic range images based on perceptual models
CN117812437A (en) Video watermark processing method and device, storage medium and electronic equipment
Verma Review of steganography techniques
US11809532B2 (en) Detection of modification of an item of content
CN113613015A (en) Tamper-resistant video generation method and device, electronic equipment and readable medium
CN111353133B (en) Image processing method, device and readable storage medium
Leung et al. Hardware realization of steganographic techniques
Hota et al. Embedding meta information into visualizations
Wu et al. JPEG image width estimation for file carving

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