Video watermarking method, watermark video playback control method, device, electronic device and storage medium
By determining multiple watermark addition areas in each image frame of the video, and modifying the attribute parameter values of pixel points in these areas to generate watermark video, the watermark information is solved. The loss of watermark information during the encoding, decoding and broadcasting link transmission is solved. Problem, improving the accuracy of video playback control.
Patent Information
- Application Number
- CN202411657930.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-19
AI Technical Summary
In the prior art, the watermark information of the video is easily lost during the encoding and decoding process and the broadcast control link transmission process, resulting in the impact of the accuracy of the video playback judgment.
By determining multiple watermark addition areas in each original image frame of the original video, performing binary conversion processing based on the first watermark ciphertext, obtaining the first watermark binary code, and each target pixel point in each watermark addition area is used. Modify the attribute parameter value according to the original binary content corresponding to the watermark addition area to generate a watermark video.
By adding watermark information to multiple areas, information redundancy is achieved, effectively resisting noise damage during video encoding, decoding and broadcasting link transmission, reducing the watermark loss of watermark videos, and improving the accuracy of video playback control.
Smart Images

Figure CN119182973B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video playback technology, and in particular to a method for adding a watermark to a video, a method and device for controlling playback of a watermarked video, an electronic device, and a storage medium. Background Art
[0002] With the rapid development of technology, watching videos has gradually become a common form of entertainment for people. The display screen can receive the video signal transmitted by the broadcast control host to play the video on the display screen. In order to ensure the security of the video playback, a watermark is often embedded in the video. Only the video content with the watermark that has passed the verification can be played.
[0003] However, watermark information is easily lost during the video encoding and decoding process and the transmission process of the broadcast control link, resulting in misjudgment of the video and affecting the accuracy of video playback judgment. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a method for adding a watermark to a video, a method and device for controlling the playback of a watermarked video, an electronic device, and a storage medium.
[0005] The present disclosure provides a method for adding a watermark to a video, which is applied to a watermark adding end. The method includes:
[0006] Obtaining an original video, watermark configuration information, and a first watermark ciphertext; the watermark configuration information includes an added area and an added strength;
[0007] Performing binary conversion processing based on the first watermark ciphertext to obtain a first watermark binary code, and decoding the original video to obtain multiple original image frames;
[0008] For each of the original image frames, based on the added area, a plurality of watermark adding areas are determined from the original image frame; the number of the plurality of watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one;
[0009] For each of the watermarked areas of each of the original image frames, based on the adding intensity and the original binary content corresponding to the watermarked area, the current attribute parameter value of each target pixel point in the watermarked area is modified to obtain an image frame after the watermark is added;
[0010] The plurality of watermarked image frames are encoded to obtain a watermarked video, and the watermarked video is sent to a watermark verification end.
[0011] In an optional implementation manner, the watermark configuration information further includes an added dimension, and the added dimension includes a spatial domain dimension or a frequency domain dimension; and the modifying of the current attribute parameter value of each target pixel point in the watermark addition area includes:
[0012] In a case where the adding dimension indicated by the watermark configuration information is a spatial dimension, modifying the pixel value of the target channel of each target pixel point in the watermark adding area;
[0013] In the case where the adding dimension indicated by the watermark configuration information is the frequency domain dimension, the frequency value of the target frequency domain of each target pixel point in the watermark adding area is modified.
[0014] In an optional implementation manner, the modifying of the current attribute parameter value of each target pixel in the watermark adding area based on the adding intensity and the original binary content corresponding to the watermark adding area includes:
[0015] For each of the target pixels, determine a rounding result according to a current attribute parameter value of the target pixel and the added intensity, wherein the rounding result is a maximum integer less than or equal to a ratio between the current attribute parameter and the added intensity;
[0016] Determine the target modification offset corresponding to the target pixel point based on the mapping relationship between the binary content and the modification offset and the original binary content corresponding to the watermark addition area to which the target pixel point belongs;
[0017] The rounding result and the target modification offset are summed to obtain a sum result;
[0018] The product of the summation result and the added intensity is determined as the modified attribute parameter value of the target pixel.
[0019] In an optional implementation, when the binary content is 0, the corresponding modification offset is greater than the first target value and less than the second target value; when the binary content is 1, the corresponding modification offset is greater than the second target value and less than the third target value.
[0020] In an optional implementation manner, the binary conversion processing based on the first watermark ciphertext includes:
[0021] Decrypting the first watermark ciphertext to obtain the first watermark original text, and performing binary conversion on the first watermark original text; or
[0022] The first watermark ciphertext is subjected to binary conversion processing.
[0023] In an optional implementation manner, sending the watermarked video to a watermark verification end includes:
[0024] The watermarked video is converted into a watermarked video signal, and the watermarked video signal is sent to the watermark verification end.
[0025] The present disclosure provides a method for controlling the playback of a watermarked video, which is applied to a watermark verification terminal. The method includes:
[0026] Receive a watermarked video sent by a watermark adding end, and decode the watermarked video to obtain a plurality of watermarked image frames; the watermarked image frames are obtained by modifying the attribute parameter values of all target pixels in a plurality of watermark adding regions in the original image frame according to the first watermark ciphertext; the number of the plurality of watermark adding regions is the same as the number of bits of the first watermark binary code obtained based on the first watermark ciphertext, and the number of the plurality of watermark adding regions is one-to-one corresponding to the number of bits of the first watermark binary code obtained based on the first watermark ciphertext;
[0027] Acquire watermark configuration information and a second watermark ciphertext, where the second watermark ciphertext and the first watermark ciphertext correspond to the same watermark original text;
[0028] Based on the watermark configuration information and the second watermark ciphertext, a watermark verification process is performed on each of the watermark image frames, and when the watermark verification passes, the watermark image frame is played.
[0029] In an optional implementation manner, performing watermark verification processing on each of the watermark image frames based on the watermark configuration information and the second watermark ciphertext includes:
[0030] For each of the watermark image frames, based on the watermark configuration information, extract the watermark of the watermark image frame to obtain a second watermark binary code of the watermark image frame;
[0031] The second watermark binary code is compared with the watermark original binary code corresponding to the second watermark ciphertext, and when the similarity between the second watermark binary code and the watermark original binary code corresponding to the second watermark ciphertext is greater than a preset threshold, it is determined that the watermark verification of the watermark image frame has passed.
[0032] In an optional implementation manner, the watermark configuration information includes an added area and an added strength; and the watermark extraction is performed on the watermark image frame based on the watermark configuration information to obtain a second watermark binary code of the watermark image frame, including:
[0033] Based on the adding area, determining a plurality of watermark adding areas from the watermark image frame;
[0034] For each of the watermark adding regions, based on the adding intensity and the current attribute parameter value of each of the target pixel points in the watermark adding region, determining the extracted binary content corresponding to each of the target pixel points, and determining the extracted binary content corresponding to the watermark adding region based on the extracted binary content corresponding to each of the target pixel points;
[0035] Based on the extracted binary contents corresponding to each of the watermark adding areas, a second watermark binary code of the watermark image frame is determined.
[0036] In an optional implementation manner, determining the extracted binary content corresponding to each target pixel point based on the adding intensity and the current attribute parameter value of each target pixel point in the watermark adding area includes:
[0037] For each of the target pixel points, based on the added intensity, a remainder process is performed on the current attribute parameter value of the target pixel point to obtain a remainder result;
[0038] Based on the mapping relationship between the adding strength and the changing offset and the adding strength, determining the target changing offset corresponding to the adding strength; the changing offset is used to indicate the changing range of the attribute parameter value of the watermarked image frame compared with the original image frame;
[0039] The remainder result is compared with the target change offset, and the extracted binary content corresponding to the target pixel point is determined according to the comparison result between the remainder result and the target change offset.
[0040] In an optional implementation, determining the extracted binary content corresponding to the target pixel point according to a comparison result between the remainder result and the target change offset includes:
[0041] When the remainder result is greater than the target change offset, the extracted binary content corresponding to the target pixel point is determined to be 1; otherwise, the extracted binary content corresponding to the target pixel point is determined to be 0.
[0042] In an optional implementation, the determining the extracted binary content corresponding to the watermark adding area based on the extracted binary content corresponding to each of the target pixels includes:
[0043] Determine the number of two extracted binary content bits corresponding to each target pixel point included in the watermark adding area;
[0044] The extracted binary contents with a larger number are determined as the extracted binary contents corresponding to the watermark adding area.
[0045] In an optional implementation manner, the receiving of the watermarked video sent by the watermark adding end includes:
[0046] A watermark video signal is received which is sent in real time by the watermark adding end, wherein the watermark video signal is obtained by the watermark adding end converting the watermark video.
[0047] The present disclosure also provides a video watermark adding device, which is applied to a watermark adding end, and the device includes:
[0048] A first data acquisition module is used to acquire the original video, watermark configuration information and a first watermark ciphertext; the watermark configuration information includes an added area and an added strength;
[0049] A data conversion module, configured to perform binary conversion processing based on the first watermark ciphertext to obtain a first watermark binary code, and decode the original video to obtain a plurality of original image frames;
[0050] A region positioning module, for determining, for each of the original image frames, a plurality of watermark adding regions from the original image frame based on the adding region; the number of the plurality of watermark adding regions is the same as the number of bits of the first watermark binary code, and the watermark adding regions correspond one to one;
[0051] a watermark adding module, configured to modify, for each watermark adding region of each original image frame, a current attribute parameter value of each target pixel point in the watermark adding region based on the adding intensity and the original binary content corresponding to the watermark adding region, so as to obtain an image frame after adding a watermark;
[0052] The video sending module is used to encode multiple image frames with watermarks added to obtain watermarked videos, and send the watermarked videos to the watermark verification end.
[0053] In an optional implementation manner, the watermark configuration information further includes an added dimension, and the added dimension includes a spatial domain dimension or a frequency domain dimension; when the watermark adding module is used to modify the current attribute parameter value of each target pixel point in the watermark adding area, it is specifically used to:
[0054] In a case where the adding dimension indicated by the watermark configuration information is a spatial dimension, modifying the pixel value of the target channel of each target pixel point in the watermark adding area;
[0055] In the case where the adding dimension indicated by the watermark configuration information is the frequency domain dimension, the frequency value of the target frequency domain of each target pixel point in the watermark adding area is modified.
[0056] In an optional implementation manner, when the watermark adding module is used to modify the current attribute parameter value of each target pixel in the watermark adding area based on the adding intensity and the original binary content corresponding to the watermark adding area, it is specifically used to:
[0057] For each of the target pixels, determine a rounding result according to a current attribute parameter value of the target pixel and the added intensity, wherein the rounding result is a maximum integer less than or equal to a ratio between the current attribute parameter and the added intensity;
[0058] Determine the target modification offset corresponding to the target pixel point based on the mapping relationship between the binary content and the modification offset and the original binary content corresponding to the watermark addition area to which the target pixel point belongs;
[0059] The rounding result and the target modification offset are summed to obtain a sum result;
[0060] The product of the summation result and the added intensity is determined as the modified attribute parameter value of the target pixel.
[0061] In an optional implementation, when the binary content is 0, the corresponding modification offset is greater than the first target value and less than the second target value; when the binary content is 1, the corresponding modification offset is greater than the second target value and less than the third target value.
[0062] In an optional implementation manner, when the data conversion module is used for performing binary conversion processing based on the first watermark ciphertext, it is specifically used to:
[0063] Decrypting the first watermark ciphertext to obtain the first watermark original text, and performing binary conversion on the first watermark original text; or
[0064] The first watermark ciphertext is subjected to binary conversion processing.
[0065] In an optional implementation manner, when the video sending module is used to send the watermarked video to the watermark verification end, it is specifically used to:
[0066] The watermarked video is converted into a watermarked video signal, and the watermarked video signal is sent to the watermark verification end.
[0067] The present disclosure also provides a watermark video playback control device, which is applied to a watermark verification terminal. The device includes:
[0068] A video receiving module is used to receive a watermarked video sent by a watermark adding end, and decode the watermarked video to obtain a plurality of watermarked image frames; the watermarked image frames are obtained by modifying the attribute parameter values of all target pixels in a plurality of watermark adding regions in an original image frame according to a first watermark ciphertext; the number of the plurality of watermark adding regions is the same as the number of bits of a first watermark binary code obtained based on the first watermark ciphertext, and the number of the plurality of watermark adding regions is one-to-one corresponding to the number of bits of a first watermark binary code obtained based on the first watermark ciphertext;
[0069] A second data acquisition module is used to acquire watermark configuration information and a second watermark ciphertext, where the second watermark ciphertext and the first watermark ciphertext correspond to the same watermark original text;
[0070] The watermark verification module is used to perform watermark verification processing on each watermark image frame based on the watermark configuration information and the second watermark ciphertext, and play the watermark image frame if the watermark verification passes.
[0071] In an optional implementation manner, when the watermark verification module is used to perform watermark verification processing on each watermark image frame based on the watermark configuration information and the second watermark ciphertext, it is specifically used to:
[0072] For each of the watermark image frames, based on the watermark configuration information, extract the watermark of the watermark image frame to obtain a second watermark binary code of the watermark image frame;
[0073] The second watermark binary code is compared with the watermark original binary code corresponding to the second watermark ciphertext, and when the similarity between the second watermark binary code and the watermark original binary code corresponding to the second watermark ciphertext is greater than a preset threshold, it is determined that the watermark verification of the watermark image frame has passed.
[0074] In an optional implementation manner, the watermark configuration information includes an added area and an added strength; when the watermark verification module is used to extract the watermark from the watermark image frame based on the watermark configuration information to obtain the second watermark binary code of the watermark image frame, it is specifically used to:
[0075] Based on the adding area, determining a plurality of watermark adding areas from the watermark image frame;
[0076] For each of the watermark adding regions, based on the adding intensity and the current attribute parameter value of each of the target pixel points in the watermark adding region, determining the extracted binary content corresponding to each of the target pixel points, and determining the extracted binary content corresponding to the watermark adding region based on the extracted binary content corresponding to each of the target pixel points;
[0077] Based on the extracted binary contents corresponding to each of the watermark adding areas, a second watermark binary code of the watermark image frame is determined.
[0078] In an optional implementation manner, when the watermark verification module is used to determine the extracted binary content corresponding to each target pixel based on the adding intensity and the current attribute parameter value of each target pixel in the watermark adding area, it is specifically used to:
[0079] For each of the target pixel points, based on the added intensity, a remainder process is performed on the current attribute parameter value of the target pixel point to obtain a remainder result;
[0080] Based on the mapping relationship between the adding strength and the changing offset and the adding strength, determining the target changing offset corresponding to the adding strength; the changing offset is used to indicate the changing range of the attribute parameter value of the watermarked image frame compared with the original image frame;
[0081] The remainder result is compared with the target change offset, and the extracted binary content corresponding to the target pixel point is determined according to the comparison result between the remainder result and the target change offset.
[0082] In an optional implementation manner, when the watermark verification module is used to determine the extracted binary content corresponding to the target pixel point according to the comparison result between the remainder result and the target change offset, it is specifically used to:
[0083] When the remainder result is greater than the target change offset, the extracted binary content corresponding to the target pixel point is determined to be 1; otherwise, the extracted binary content corresponding to the target pixel point is determined to be 0.
[0084] In an optional implementation manner, when the watermark verification module is used to determine the extracted binary content corresponding to the watermark adding area based on the extracted binary content corresponding to each of the target pixels, it is specifically used to:
[0085] Determine the number of two extracted binary content bits corresponding to each target pixel point included in the watermark adding area;
[0086] The extracted binary contents with a larger number are determined as the extracted binary contents corresponding to the watermark adding area.
[0087] In an optional implementation manner, when the video receiving module is used for receiving the watermarked video sent by the watermark adding end, it is specifically used for:
[0088] A watermark video signal is received which is sent in real time by the watermark adding end, wherein the watermark video signal is obtained by the watermark adding end converting the watermark video.
[0089] The present disclosure also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the watermark adding method for the video or the playback control method for the watermarked video are performed.
[0090] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the watermark adding method for the video or the playback control method for the watermarked video are executed.
[0091] The video watermarking method, watermark video playback control method, device, electronic device and storage medium provided by the embodiments of the present disclosure, when adding a watermark to a video, binary conversion processing is performed based on the first watermark ciphertext to obtain a first watermark binary code, and multiple watermark adding areas are determined in each original image frame of the original video, the number of the multiple watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one, and each target pixel point in each watermark adding area has its attribute parameter value modified according to the original binary content corresponding to the watermark adding area, so that by adding each bit content of the first watermark binary code to multiple areas, and all pixels in each watermark adding area have the same original binary content added, information redundancy is performed when the watermark is added, thereby effectively resisting the damage to the watermark caused by noise in the video encoding and decoding and broadcast control link transmission process, reducing the watermark loss of the watermarked video, reducing the risk of misjudgment of the watermarked video, and improving the accuracy of video playback control.
[0092] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure.
[0093] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0095] Figure 1 A schematic diagram of a process of generating and playing a watermarked video provided by an embodiment of the present disclosure is shown;
[0096] Figure 2 A flow chart of a method for adding a watermark to a video provided by an embodiment of the present disclosure is shown;
[0097] Figure 3 A schematic diagram of a process for generating a watermarked video provided by an embodiment of the present disclosure is shown;
[0098] Figure 4 A flow chart of a method for controlling the playback of a watermarked video provided by an embodiment of the present disclosure is shown;
[0099] Figure 5 A schematic diagram of a video watermark adding device provided by an embodiment of the present disclosure is shown;
[0100] Figure 6 A schematic diagram of a watermark video playback control device provided by an embodiment of the present disclosure is shown;
[0101] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0102] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0103] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0104] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0105] Research has found that when playing videos, especially when playing videos on public display screens, in order to prevent the playback content from being tampered with, resulting in the playback of illegal content (such as uncivilized content, unhealthy content, etc.) causing adverse effects, the following methods are often used to protect the playback of video content: Method 1, content review based on image recognition technology, through deep learning, image feature engineering and other methods, to identify whether the video / image content contains illegal content; Method 2, system authentication based on encrypted communication, encrypting the video content as communication data to prevent tampering by intermediate nodes, and allowing playback only after successful decryption; Method 3, content authentication based on whitelist, pre-define the content allowed to be played (such as a group of pictures, or extract all frames of the video allowed to be played) and save it as a whitelist library. During playback, each frame of the image to be played is compared with the whitelist library, and playback is allowed only after the comparison is successful.
[0106] However, for method one, image recognition based on deep learning models or image feature engineering has false positives and missed negatives, and its accuracy is low. In addition, due to the unexplainable nature of deep learning, it is difficult to directly solve the problem after a false positive or missed negative case occurs, and it is necessary to iteratively train the model, which is costly and time-consuming to solve the problem. For method two, since most videos are directly transmitted to the display screen through a video cable for playback, but the video signal cannot be encrypted or decrypted, this method cannot be implemented in most terminal video playback and control scenarios. For method three, each time the video is changed, the changed video frame needs to be added to the whitelist library and updated to the verification device. As time goes by, the whitelist library will continue to grow, resulting in a linear increase in the review time, a long review time, and it is not applicable to scenarios where the playback content can be changed at any time.
[0107] Based on this, most people currently use method 4, watermark-based content protection, to protect the playback of video content. The watermark information is embedded in the original video, the video watermark information is parsed before playback, and playback is allowed after verification.
[0108] However, the video encoding and decoding process and the broadcast control link transmission process may damage the watermark, causing misjudgment of the video and affecting the accuracy of video playback judgment.
[0109] Based on the above research, the present disclosure provides a method for adding watermarks to videos and a method for controlling the playback of watermarked videos. When adding watermarks to videos, multiple watermark adding areas are determined in each original image frame of the original video. By adding each bit content of a first watermark binary code in multiple areas, and adding the same original binary content to all pixels in each watermark adding area, information redundancy is performed when adding watermarks, thereby effectively resisting the damage to the watermark caused by noise during video encoding and decoding and broadcast control link transmission. When verifying the watermarked video, the watermark loss of the watermarked video is reduced, the misjudgment of the watermarked video is avoided, and the accuracy of video playback control is improved.
[0110] The following describes a method for adding a watermark to a video and a method for controlling the playback of a watermarked video provided by an embodiment of the present disclosure in conjunction with the accompanying drawings.
[0111] See also Figure 1 , is a schematic diagram of a process of generating and playing a watermarked video provided by an embodiment of the present disclosure. Figure 1 As shown in , the process of watermark video generation and playback involves a watermark adding end and a watermark verification end. The watermark adding end is used to add a watermark to the original video based on a first watermark ciphertext to obtain a watermarked video. The watermark verification end is used to verify the watermarked video based on a second watermark ciphertext. If the watermark verification passes, the watermarked video is played. Otherwise, if the watermark verification fails, the watermarked video is not played.
[0112] Here, the first watermark ciphertext used by the watermark adding end and the second watermark ciphertext used by the watermark verification end correspond to the same watermark original text, so that the watermark protocol between the watermark adding end and the watermark verification end is aligned, which helps to ensure the effect of watermark verification.
[0113] To facilitate understanding of this embodiment, a video watermarking method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the video watermarking method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities. In this embodiment, the electronic device can be a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data and artificial intelligence platforms.
[0114] In other implementations, the electronic device may also be a terminal device or other processing device, and the terminal device may be a mobile device, a user terminal, a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. Other processing devices may be devices including a processor and a memory, which are not limited here. In some possible implementations, the video watermarking method may be implemented by a processor calling a computer-readable instruction stored in a memory.
[0115] The method for adding watermark to a video provided by an embodiment of the present disclosure is described below in conjunction with the accompanying drawings.
[0116] See also Figure 2 As shown, it is a flow chart of a method for adding watermark to a video provided by an embodiment of the present disclosure, such as Figure 2 As shown in , the video watermarking method provided by the embodiment of the present disclosure includes steps S201 to S205, wherein:
[0117] S201: Acquire original video, watermark configuration information and first watermark ciphertext; the watermark configuration information includes an adding area and an adding strength.
[0118] Here, the first watermark ciphertext can be obtained by encrypting the watermark original text through symmetric encryption technology, which helps to improve the efficiency of obtaining the first watermark ciphertext.
[0119] Optionally, the first watermark ciphertext can also be obtained by encrypting the watermark original text through asymmetric encryption technology. Under the asymmetric encryption technology, an authenticated public key ukey is used for encryption. The generated ciphertext can only be decrypted into the watermark original text by the private key stored inside the ukey. Each ukey is unique, so each device using the watermark ciphertext (watermark adding end and watermark verification end) needs to be bound to a pairing of ukey and ciphertext to achieve the uniqueness of the watermark ciphertext, avoid watermark leakage, and ensure the security of watermark video transmission.
[0120] The added area is used to indicate the position, size and shape of the area where the watermark is added. The added area can be determined according to the actual need for adding the watermark, and no specific limitation is made here.
[0121] For example, each watermark adding area can be evenly located around the original image frame or only set in the top row of the original image frame, etc. Each watermark adding area can be rectangular, such as a rectangle, a square, etc.
[0122] The added intensity is used to indicate the visibility of the watermark. Here, the specific value of the added intensity is a multiple of 16, with a maximum of 256. It can be understood that if the value of the added intensity is too large, it may affect the viewing effect of the naked eye, and if the value of the added intensity is too small, it may be offset during the video encoding and decoding and the broadcast control link transmission process. By setting a suitable added intensity, the color change of the watermark area block can be made insensitive to the naked eye while adding the watermark. The value of the added intensity can be determined according to the actual need for watermarking, and no specific restrictions are made here.
[0123] S202: performing binary conversion processing based on the first watermark ciphertext to obtain a first watermark binary code, and decoding the original video to obtain multiple original image frames.
[0124] In this step, binary conversion processing can be performed based on the first watermark ciphertext to obtain a first watermark binary code, and the original video can be decoded to obtain multiple original image frames, and then the first watermark binary code can be added to each of the original image frames.
[0125] When embedding digital watermarks on videos / images, an explicit watermarking mode is generally used, where the pixels of the watermarked image (e.g., copyright logo image) are directly overlaid on the original image. The watermarked content can be clearly seen by the naked eye, affecting the video viewing experience. The disclosed embodiment adopts an implicit watermarking mode, which makes it difficult to clearly see the watermarked information with the naked eye, and the quality of the original image frame is preserved as much as possible.
[0126] Here, when adding a watermark, according to the specific needs of adding the watermark, the original text of the watermark can be added, or the ciphertext of the watermark can be added.
[0127] In some possible implementations, the performing binary conversion processing based on the first watermark ciphertext includes:
[0128] Decrypting the first watermark ciphertext to obtain the first watermark original text, and performing binary conversion on the first watermark original text; or
[0129] The first watermark ciphertext is subjected to binary conversion processing.
[0130] In the above steps, the first watermark ciphertext can be first decrypted by the ukey corresponding to the watermark adding end to obtain the first watermark original text, and the first watermark original text can be binary converted to obtain the first watermark binary code, thereby adding the watermark original text. Alternatively, the first watermark ciphertext can be directly binary converted to obtain the first watermark binary code, thereby adding the watermark ciphertext.
[0131] In this way, when adding a watermark, you can add the original watermark text or the ciphertext of the watermark, which helps to improve the flexibility of adding watermarks.
[0132] S203: for each of the original image frames, based on the added area, determine a plurality of watermark adding areas from the original image frame; the number of the plurality of watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one.
[0133] Here, the first watermark binary code is composed of multiple 0s and 1s, the number of multiple watermark adding areas in the original image frame is the same as the number of bits of the first watermark binary code, and each watermark adding area corresponds to one bit of the first watermark binary code, that is, each watermark adding area corresponds to adding one bit (one bit) of the first watermark binary code.
[0134] S204: For each of the watermarked areas of each of the original image frames, based on the adding intensity and the original binary content corresponding to the watermarked area, modify the current attribute parameter value of each target pixel in the watermarked area to obtain an image frame with a watermark added.
[0135] Here, the original binary content corresponding to the watermark adding area is the content of a bit corresponding to the watermark adding area, specifically 0 or 1.
[0136] In some possible implementations, the watermark configuration information further includes an added dimension, where the added dimension includes a spatial domain dimension or a frequency domain dimension; and modifying the current attribute parameter value of each target pixel point in the watermark addition area includes:
[0137] In a case where the adding dimension indicated by the watermark configuration information is a spatial dimension, modifying the pixel value of the target channel of each target pixel point in the watermark adding area;
[0138] In the case where the adding dimension indicated by the watermark configuration information is the frequency domain dimension, the frequency value of the target frequency domain of each target pixel point in the watermark adding area is modified.
[0139] In the above steps, when the added dimension indicated by the watermark configuration information is a spatial dimension, the target channel may be at least one of the R channel, the G channel, and the B channel. When the added dimension indicated by the watermark configuration information is a frequency domain dimension, the target frequency domain may be at least one of the DC component, the low frequency component, the intermediate frequency component, and the high frequency component.
[0140] The target channel and the target frequency domain may be determined according to actual watermark adding requirements, and are not specifically limited here.
[0141] Exemplarily, in order to make the watermarked video less impactful to the naked eye, when the adding dimension indicated by the watermark configuration information is the spatial dimension, the target channel can be the B channel; when the adding dimension indicated by the watermark configuration information is the frequency domain dimension, the target frequency domain can be a DC component or an intermediate frequency component.
[0142] In this way, when adding a watermark, the parameter attribute values in the spatial dimension can be modified, and the parameter attribute values in the frequency domain dimension can also be modified, which helps to improve the flexibility of watermark adding. In addition, not all attributes are modified, but only specific target channels or target frequency domains are modified, which helps to reduce the amount of data processing. After quantization coding modulation, the watermark information will not cause obvious visual changes, which helps to improve the viewing effect of the watermarked video.
[0143] In some possible implementations, modifying the current attribute parameter value of each target pixel in the watermark adding area based on the adding intensity and the original binary content corresponding to the watermark adding area includes:
[0144] For each of the target pixels, determine a rounding result according to a current attribute parameter value of the target pixel and the added intensity, wherein the rounding result is a maximum integer less than or equal to a ratio between the current attribute parameter and the added intensity;
[0145] Determine the target modification offset corresponding to the target pixel point based on the mapping relationship between the binary content and the modification offset and the original binary content corresponding to the watermark addition area to which the target pixel point belongs;
[0146] The rounding result and the target modification offset are summed to obtain a sum result;
[0147] The product of the summation result and the added intensity is determined as the modified attribute parameter value of the target pixel.
[0148] In the above steps, by determining the rounding result, the parameter range corresponding to the attribute parameter is segmented according to the value of the added intensity, and the target segment corresponding to the current attribute parameter value is located.
[0149] Exemplarily, taking the modification of pixel values as an example, the parameter range 0 to 255 corresponding to the pixel is segmented according to the value of the added intensity, and located at the target segment corresponding to the current attribute parameter value.
[0150] Here, each segment is divided into two half areas, upper and lower, and the target half area corresponding to the original binary content is determined by determining the target modification offset.
[0151] In some possible implementations, when the binary content is 0, the corresponding modification offset is greater than the first target value and less than the second target value; when the binary content is 1, the corresponding modification offset is greater than the second target value and less than the third target value.
[0152] Among them, in order to evenly divide the two half areas, the first target value is 0, the second target value is 1 / 2, and the third target value is 1. In this way, when the binary content is 0, the corresponding modified offset is greater than 0 and less than 1 / 2, which corresponds to the lower half of the target segment. When the binary content is 1, the corresponding modified offset is greater than 1 / 2 and less than 1, which corresponds to the upper half of the target segment.
[0153] In order to better distinguish different binary contents, when the binary content is 0, the corresponding modification offset may be 1 / 4, and when the binary content is 1, the corresponding modification offset may be 3 / 4.
[0154] In this way, by setting the mapping relationship between the above-mentioned binary content and the modified offset, the change in the modified attribute parameter value of the target pixel relative to the attribute parameter value before the modification is determined, thereby ensuring that different binary contents can correspond to different partitions. Not only can different binary contents be distinguished, but the deviation between the modified offsets corresponding to different binary contents is small, so that the watermark information will not cause obvious visual changes, which helps to improve the viewing effect of the watermarked video.
[0155] After determining the target modification offset, the rounding result and the target modification offset are summed to obtain a sum result; and the product of the sum result and the added intensity is determined as the modified attribute parameter value of the target pixel.
[0156] Specifically, the calculation formula for the modified attribute parameter value of the target pixel is shown in the following formula (1):
[0157]
[0158] in, is the modified attribute parameter value of the target pixel, is the current attribute parameter value of the target pixel, To add strength to the is the rounding result, The original binary content corresponding to the watermark adding area to which the target pixel belongs, Modify the offset for the target. When it is 0, the corresponding target modification offset is ,exist When it is 1, the corresponding target modification offset is .
[0159] In this way, by modifying the current attribute parameter value of each target pixel point in the above manner, not only the watermark information is effectively added, but also the watermark is not sensitive to the naked eye, which helps to ensure the image quality of the watermarked video.
[0160] S205: Encode the multiple watermarked image frames to obtain a watermarked video, and send the watermarked video to a watermark verification end.
[0161] In this step, multiple watermarked image frames can be encoded to obtain a watermarked video, which can then be sent to a watermark verification end so that the watermark verification end can perform watermark verification on the watermarked video and play the watermarked video when the watermark verification passes.
[0162] In some possible implementations, sending the watermarked video to a watermark verification end includes:
[0163] The watermarked video is converted into a watermarked video signal, and the watermarked video signal is sent to the watermark verification end.
[0164] In this step, the watermarked video may be converted into a watermarked video signal, and the watermarked video signal may be sent to the watermark verification end in real time.
[0165] In this way, the watermark verification end can receive the watermarked video signal in real time, and thus directly verify the watermarked video signal played in real time, rather than verifying the video source, thereby achieving real-time protection of the video broadcast control content without affecting the real-time playback of the video.
[0166] Optionally, when the watermark adding end is a broadcast control host with a watermark adding function, the watermark adding end can pass the watermark video through a video signal channel, such as a High-Definition Multimedia Interface (HDMI) channel, a display interface (DisplayPort, DP) channel, etc., to obtain a corresponding watermark video signal, such as an HDMI signal, DP, etc.
[0167] Alternatively, if the watermark adding end and the broadcast control host are two different devices, the watermark adding end can send the watermarked video to the broadcast control host, and the broadcast control host converts the watermarked video into a watermarked video signal and sends the watermarked video signal to the watermark verification end.
[0168] It can be understood that the watermarked video is decoded by the broadcast control host, and the decoded video stream becomes a universal image signal stream (such as YUV420 signal, or RGB signal), that is, the watermarked video signal. This image signal stream can be projected onto the display screen of the broadcast control host via the HDMI cable, and can also be transmitted to a remote display screen (i.e., the display screen that plays the watermarked video) via the HDMI cable.
[0169] In the case where the watermark adding end and the broadcast control host are two different devices, the watermark verification terminal is located on the HDMI playback link between the broadcast control host and the remote display screen, and the received data is a YUV420 signal (rather than the H264 code stream corresponding to the original video). Since the video encoding and decoding and transmission process are not controllable by the watermark verification end, intensity redundancy is used when adding watermarks to reduce information loss when the watermark verification end receives content.
[0170] To clearly demonstrate the video watermarking process, please refer to Figure 3 , Figure 3 The following is a schematic diagram of a process for generating a watermarked video provided by an embodiment of the present disclosure. Figure 3 As shown in, the original video, watermark configuration information and the first watermark ciphertext are obtained; the watermark configuration information includes an added area, an added strength and an added dimension; the original video is decoded to obtain multiple original image frames, and binary conversion is performed based on the first watermark ciphertext to obtain a first watermark binary code; for each of the original image frames, based on the added area, multiple watermark addition areas are determined from the original image frame; the number of the multiple watermark addition areas is the same as the number of bits of the first watermark binary code, and they correspond one to one; for each of the watermark addition areas of each of the original image frames, based on the added strength, the added dimension and the original binary content corresponding to the watermark addition area, the current attribute parameter value of each target pixel point in the watermark addition area is modified to obtain an image frame after adding a watermark; multiple image frames after adding a watermark are encoded to obtain a watermarked video, and the watermarked video is sent to the watermark verification end. Wherein, the specific steps refer to the aforementioned embodiment and will not be repeated here.
[0171] The video watermarking method provided by the embodiment of the present disclosure performs binary conversion processing based on the first watermark ciphertext to obtain the first watermark binary code when adding a watermark to the video, and determines multiple watermark adding areas in each original image frame of the original video, the number of the multiple watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one, and each target pixel point in each watermark adding area has its attribute parameter value modified according to the original binary content corresponding to the watermark adding area, so that by adding each bit content of the first watermark binary code in multiple areas, and adding the same original binary content to all pixels in each watermark adding area, information redundancy is performed when adding the watermark, thereby effectively resisting the damage to the watermark caused by noise in the video encoding and decoding and broadcast control link transmission process, reducing the watermark loss of the watermarked video, reducing the risk of misjudgment of the watermarked video, and improving the accuracy of video playback control.
[0172] Correspondingly, after the watermark video is generated, it is necessary to verify the watermark video and determine whether to play it based on the verification result. Therefore, the embodiment of the present disclosure also provides a method for controlling the playback of the watermark video. Next, a method for controlling the playback of a watermark video disclosed in the embodiment of the present disclosure is introduced in detail. The executor of the method for controlling the playback of a watermark video provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities. In this embodiment, the electronic device can be a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data and artificial intelligence platforms.
[0173] In other implementations, the electronic device may also be a terminal device or other processing device, and the terminal device may be a mobile device, a user terminal, a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. Other processing devices may be devices including a processor and a memory, which are not limited here. In some possible implementations, the playback control method of the watermarked video may be implemented by a processor calling a computer-readable instruction stored in a memory.
[0174] The following describes the playback control method of the watermarked video provided by the embodiment of the present disclosure in conjunction with the accompanying drawings.
[0175] See also Figure 4 As shown, it is a flow chart of a method for controlling the playback of a watermarked video provided by an embodiment of the present disclosure, such as Figure 4 As shown in , the playback control method of the watermarked video provided by the embodiment of the present disclosure includes steps S401 to S403, wherein:
[0176] S401: Receive a watermarked video sent by a watermark adding end, and decode the watermarked video to obtain multiple watermarked image frames; the watermarked image frames are obtained by modifying the attribute parameter values of all target pixels in multiple watermark adding areas in the original image frame according to a first watermark ciphertext; the number of the multiple watermark adding areas is the same as the number of bits of the first watermark binary code obtained based on the first watermark ciphertext, and they correspond one to one.
[0177] In this step, the watermark video sent by the watermark adding end can be received, and the video can be decoded to obtain multiple watermark image frames. The generation process of the watermark video is specifically referred to the above embodiment, which will not be repeated here.
[0178] In some possible implementations, the receiving a watermarked video sent by a watermark adding end includes:
[0179] A watermark video signal is received which is sent in real time by the watermark adding end, wherein the watermark video signal is obtained by the watermark adding end converting the watermark video.
[0180] Referring to the above embodiments, it can be known that the watermark adding end can be a broadcast control host with a watermark adding function, so that after the watermark adding end adds a watermark to the original video, the watermark adding end converts the watermark video into a watermark video signal and sends the watermark video signal to the watermark verification end; or the watermark adding end and the broadcast control host can be two different devices, the watermark adding end can send the watermark video to the broadcast control host, and the broadcast control host converts the watermark video into a watermark video signal and sends the watermark video signal to the watermark verification end.
[0181] In this step, a watermark video signal, such as an HDMI signal, DP, etc., which is obtained by converting the watermark video and is sent in real time by the watermark adding end, can be received, so as to convert the watermark video signal to obtain multiple watermark image frames.
[0182] In this way, the watermark verification end can receive the watermarked video signal in real time, and thus directly verify the watermarked video signal played in real time, rather than verifying the video source, thereby achieving real-time protection of the video broadcast control content without affecting the real-time playback of the video.
[0183] S402: Acquire watermark configuration information and a second watermark ciphertext, where the second watermark ciphertext and the first watermark ciphertext correspond to the same watermark original text.
[0184] The process of determining the second watermark ciphertext is the same as the process of obtaining the first watermark ciphertext, which will not be repeated here.
[0185] S403: Performing watermark verification processing on each of the watermark image frames based on the watermark configuration information and the second watermark ciphertext, and playing the watermark image frame if the watermark verification passes.
[0186] In this step, based on the watermark configuration information and the second watermark ciphertext, watermark verification processing is performed on each of the watermark image frames to obtain a watermark verification result, wherein the watermark verification result includes a watermark verification pass or a watermark verification fail; when the watermark verification result indicates that the watermark verification has passed, the watermark image frame is played, for example, the watermark image frame is output to a display screen for playback; when the watermark verification result indicates that the watermark verification has failed, the playback signal is cut off and the watermark image frame is not played.
[0187] Optionally, if the watermark verification of any of the watermark image frames fails, the watermark image frame and the watermark image frame after the watermark image frame corresponding to the watermark video will not be played until the next watermark video is received, thereby ensuring the security of video playback.
[0188] Also optionally, if the watermark verification of any of the watermarked image frames fails, then the watermarked image frame will not be played; if the watermark verification of the watermarked image frame after any of the watermarked image frames passes, then the watermarked image frame after any of the watermarked image frames will be played, thereby ensuring the stability of video playback.
[0189] In some possible implementations, performing watermark verification processing on each watermark image frame based on the watermark configuration information and the second watermark ciphertext includes:
[0190] For each of the watermark image frames, based on the watermark configuration information, extract the watermark of the watermark image frame to obtain a second watermark binary code of the watermark image frame;
[0191] The second watermark binary code is compared with the watermark original binary code corresponding to the second watermark ciphertext, and when the similarity between the second watermark binary code and the watermark original binary code corresponding to the second watermark ciphertext is greater than a preset threshold, it is determined that the watermark verification of the watermark image frame has passed.
[0192] In the above steps, based on the watermark configuration information, watermark extraction can be performed on each watermark image frame to obtain the second watermark binary code of each watermark image frame, and the second watermark ciphertext can be decrypted through the ukey corresponding to the watermark verification end to obtain the second watermark original text, and the second watermark original text can be binary converted to obtain the watermark original binary code, and then the second watermark binary code of each watermark image frame can be compared with the watermark original binary code.
[0193] According to the above content, when adding a watermark, the original watermark text or the ciphertext of the watermark can be added. Here, in the case of adding the original watermark text, the second watermark binary code can be directly compared with the original watermark binary code; in the case of adding the ciphertext of the watermark, the second watermark binary code can be subjected to inverse binary conversion processing to obtain the extracted watermark ciphertext corresponding to the second watermark binary code, and then the extracted watermark ciphertext can be decrypted to obtain the extracted watermark original text corresponding to the extracted watermark ciphertext, and then the extracted watermark original text can be subjected to binary conversion processing to obtain the extracted watermark original text binary code, and the extracted watermark original text binary code can be compared with the watermark original text binary code to obtain the similarity.
[0194] The specific value of the preset threshold value may be determined according to the actual watermark verification requirements, and is not specifically limited here. For example, the preset threshold value may be 90%.
[0195] In this way, the similarity can be obtained by comparing the second watermark binary code of each watermark image frame with the watermark original binary code corresponding to the second watermark ciphertext. Based on the comparison between the similarity and the preset threshold, it is determined whether the watermark verification passes, which helps to ensure the accuracy of the watermark video playback control.
[0196] In some possible implementations, the watermark configuration information includes an added area and an added strength; and extracting a watermark from the watermark image frame based on the watermark configuration information to obtain a second watermark binary code of the watermark image frame includes:
[0197] Based on the adding area, determining a plurality of watermark adding areas from the watermark image frame;
[0198] For each of the watermark adding regions, based on the adding intensity and the current attribute parameter value of each of the target pixel points in the watermark adding region, determining the extracted binary content corresponding to each of the target pixel points, and determining the extracted binary content corresponding to the watermark adding region based on the extracted binary content corresponding to each of the target pixel points;
[0199] Based on the extracted binary contents corresponding to each of the watermark adding areas, a second watermark binary code of the watermark image frame is determined.
[0200] In the above steps, multiple watermark adding areas can be first determined from the watermark image frame according to the adding areas, and then for each of the watermark adding areas, the extracted binary content corresponding to each of the target pixel points can be determined according to the adding intensity and the current attribute parameter value of each of the target pixel points in the watermark adding area, and then based on the extracted binary content corresponding to each of the target pixel points, the extracted binary content corresponding to the watermark adding area can be determined, and the extracted binary contents corresponding to each of the watermark adding areas can be combined to obtain the second watermark binary code of the watermark image frame.
[0201] In this way, multiple watermark adding areas can be located from the watermark image frame first. For each watermark adding area, the extracted binary contents corresponding to all the target pixels therein are first determined, and then the extracted binary content corresponding to the watermark adding area is determined, thereby obtaining the second watermark binary code of the watermark image frame, thereby effectively resisting the damage to the watermark caused by noise in the video encoding and decoding and broadcast control link transmission process.
[0202] In some possible implementations, determining the extracted binary content corresponding to each target pixel point based on the adding intensity and the current attribute parameter value of each target pixel point in the watermark adding area includes:
[0203] For each of the target pixel points, based on the added intensity, a remainder process is performed on the current attribute parameter value of the target pixel point to obtain a remainder result;
[0204] Based on the mapping relationship between the adding strength and the changing offset and the adding strength, determining the target changing offset corresponding to the adding strength; the changing offset is used to indicate the changing range of the attribute parameter value of the watermarked image frame compared with the original image frame;
[0205] The remainder result is compared with the target change offset, and the extracted binary content corresponding to the target pixel point is determined according to the comparison result between the remainder result and the target change offset.
[0206] Here, extracting the watermark is equivalent to the inverse process of adding the watermark. Accordingly, relative to the rounding result determined when the watermark is added, the remainder result is determined in this step, so that the degree of change of the current attribute parameter value of the target pixel in the watermark image frame compared with the original image frame can be determined.
[0207] The change offset may be half of the corresponding value of the added intensity.
[0208] In this way, the extracted binary content corresponding to the target pixel point is determined in the above manner, the steps are simple, the amount of data processing is small, and it is helpful to improve the efficiency of watermark extraction.
[0209] In some possible implementations, determining the extracted binary content corresponding to the target pixel point according to a comparison result between the remainder result and the target change offset includes:
[0210] When the remainder result is greater than the target change offset, the extracted binary content corresponding to the target pixel point is determined to be 1; otherwise, the extracted binary content corresponding to the target pixel point is determined to be 0.
[0211] In this way, the extracted binary content corresponding to the target pixel point can be quickly determined by comparing the remainder result with the target change offset. The steps are simple and help improve the efficiency of watermark extraction.
[0212] Specifically, the calculation formula for extracting the binary content corresponding to the target pixel point is shown in the following formula (2):
[0213]
[0214]
[0215] in, Extract binary content corresponding to the target pixel point, is the current attribute parameter value of the target pixel, To add strength to the is the remainder result, The target change offset.
[0216] In some possible implementations, determining the extracted binary content corresponding to the watermark adding area based on the extracted binary content corresponding to each of the target pixels includes:
[0217] Determine the number of two extracted binary content bits corresponding to each target pixel point included in the watermark adding area;
[0218] The extracted binary contents with a larger number are determined as the extracted binary contents corresponding to the watermark adding area.
[0219] In this way, since information redundancy is performed when adding watermarks, a larger number of extracted binary contents are determined as the extracted binary contents corresponding to the watermark adding area when extracting the watermark, which helps to ensure the accuracy of watermark extraction, thereby effectively resisting the damage to the watermark caused by noise in the video encoding and decoding and broadcast control link transmission process. When verifying the watermarked video, the risk of misjudgment of the watermarked video is reduced, and the accuracy of video playback control is improved.
[0220] The watermark video playback control method provided by the embodiment of the present disclosure, when the watermark video is played back, multiple watermark adding areas in each watermark image frame of the watermark video are added with a first watermark binary code obtained based on a first watermark ciphertext, the number of the multiple watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one, each target pixel point in each watermark adding area is modified in attribute parameter value according to the original binary content corresponding to the watermark adding area, and each watermark video frame is watermark verified according to the second watermark ciphertext corresponding to the same watermark original text as the first watermark ciphertext, and the watermark image frame is played when the watermark verification passes, so that when the watermark is added, each bit content of the first watermark binary code is added to multiple areas, and all the pixels in each watermark adding area are added with the same original binary content, so that information redundancy of watermark addition is achieved, thereby effectively resisting the damage of the watermark to the watermark caused by noise in the video encoding and decoding and the broadcast control link transmission process, reducing the watermark loss of the watermark video, reducing the risk of misjudgment of the watermark video when the watermark is verified, and improving the accuracy of video playback control.
[0221] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0222] Based on the same inventive concept, the embodiments of the present disclosure also provide a video watermark adding device corresponding to the video watermark adding method. Since the principle of solving the problem by the video watermark adding device in the embodiments of the present disclosure is similar to the video watermark adding method mentioned above in the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0223] See also Figure 5 , Figure 5 Schematic diagram of a video watermark adding device provided by an embodiment of the present disclosure, the video watermark adding device is applied to a watermark adding end. Figure 5 As shown in FIG. , the video watermark adding device 500 provided by the embodiment of the present disclosure includes:
[0224] The first data acquisition module 510 is used to acquire the original video, watermark configuration information and the first watermark ciphertext; the watermark configuration information includes the adding area and the adding strength;
[0225] A data conversion module 520 is used to perform binary conversion processing based on the first watermark ciphertext to obtain a first watermark binary code, and decode the original video to obtain multiple original image frames;
[0226] A region positioning module 530 is used to determine, for each of the original image frames, a plurality of watermark adding regions from the original image frame based on the adding region; the number of the plurality of watermark adding regions is the same as the number of bits of the first watermark binary code and corresponds one to one;
[0227] The watermark adding module 540 is used to modify the current attribute parameter value of each target pixel point in the watermark adding area for each watermark adding area of each original image frame based on the adding intensity and the original binary content corresponding to the watermark adding area to obtain the image frame after adding the watermark;
[0228] The video sending module 550 is used to encode a plurality of watermarked image frames to obtain a watermarked video, and send the watermarked video to a watermark verification end.
[0229] In an optional implementation manner, the watermark configuration information further includes an added dimension, and the added dimension includes a spatial dimension or a frequency domain dimension; when the watermark adding module 540 is used to modify the current attribute parameter value of each target pixel point in the watermark adding area, it is specifically used to:
[0230] In a case where the adding dimension indicated by the watermark configuration information is a spatial dimension, modifying the pixel value of the target channel of each target pixel point in the watermark adding area;
[0231] In the case where the adding dimension indicated by the watermark configuration information is the frequency domain dimension, the frequency value of the target frequency domain of each target pixel point in the watermark adding area is modified.
[0232] In an optional implementation manner, when the watermark adding module 540 is used to modify the current attribute parameter value of each target pixel in the watermark adding area based on the adding intensity and the original binary content corresponding to the watermark adding area, it is specifically used to:
[0233] For each of the target pixels, determine a rounding result according to a current attribute parameter value of the target pixel and the added intensity, wherein the rounding result is a maximum integer less than or equal to a ratio between the current attribute parameter and the added intensity;
[0234] Determine the target modification offset corresponding to the target pixel point based on the mapping relationship between the binary content and the modification offset and the original binary content corresponding to the watermark addition area to which the target pixel point belongs;
[0235] The rounding result and the target modification offset are summed to obtain a sum result;
[0236] The product of the summation result and the added intensity is determined as the modified attribute parameter value of the target pixel.
[0237] In an optional implementation, when the binary content is 0, the corresponding modification offset is greater than the first target value and less than the second target value; when the binary content is 1, the corresponding modification offset is greater than the second target value and less than the third target value.
[0238] In an optional implementation manner, when the data conversion module 520 is used for the binary conversion processing based on the first watermark ciphertext, it is specifically used to:
[0239] Decrypting the first watermark ciphertext to obtain the first watermark original text, and performing binary conversion on the first watermark original text; or
[0240] The first watermark ciphertext is subjected to binary conversion processing.
[0241] In an optional implementation manner, when the video sending module 550 is used to send the watermarked video to the watermark verification end, it is specifically used to:
[0242] The watermarked video is converted into a watermarked video signal, and the watermarked video signal is sent to the watermark verification end.
[0243] The video watermark adding device provided by the embodiment of the present disclosure performs binary conversion processing based on the first watermark ciphertext to obtain the first watermark binary code when adding a watermark to the video, and determines multiple watermark adding areas in each original image frame of the original video, the number of the multiple watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one, and each target pixel point in each watermark adding area has its attribute parameter value modified according to the original binary content corresponding to the watermark adding area. In this way, by adding each bit content of the first watermark binary code in multiple areas, and adding the same original binary content to all pixels in each watermark adding area, information redundancy is performed when adding the watermark, thereby effectively resisting the damage to the watermark caused by noise in the video encoding and decoding and broadcast control link transmission process, reducing the watermark loss of the watermarked video, reducing the risk of misjudgment of the watermarked video, and improving the accuracy of video playback control.
[0244] Based on the same inventive concept, the embodiments of the present disclosure also provide a playback control device for a watermarked video corresponding to the playback control method for a watermarked video. Since the principle of solving the problem by the playback control device for a watermarked video in the embodiments of the present disclosure is similar to the playback control method for a watermarked video in the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0245] See also Figure 6 , Figure 6 Schematic diagram of a watermark video playback control device provided by an embodiment of the present disclosure, the watermark video playback control device is applied to a watermark verification end. Figure 6 As shown in , the watermark video playback control device 600 provided by the embodiment of the present disclosure includes:
[0246] The video receiving module 610 is used to receive the watermarked video sent by the watermark adding end, and decode the watermarked video to obtain multiple watermarked image frames; the watermarked image frames are obtained by modifying the attribute parameter values of all target pixels in multiple watermark adding areas in the original image frame according to the first watermark ciphertext; the number of the multiple watermark adding areas is the same as the number of bits of the first watermark binary code obtained based on the first watermark ciphertext, and they correspond one to one;
[0247] A second data acquisition module 620 is used to acquire watermark configuration information and a second watermark ciphertext, where the second watermark ciphertext and the first watermark ciphertext correspond to the same watermark original text;
[0248] The watermark verification module 630 is used to perform watermark verification processing on each of the watermark image frames based on the watermark configuration information and the second watermark ciphertext, and play the watermark image frame if the watermark verification passes.
[0249] In an optional implementation manner, when the watermark verification module 630 is used to perform watermark verification processing on each watermark image frame based on the watermark configuration information and the second watermark ciphertext, it is specifically used to:
[0250] For each of the watermark image frames, based on the watermark configuration information, extract the watermark of the watermark image frame to obtain a second watermark binary code of the watermark image frame;
[0251] The second watermark binary code is compared with the watermark original binary code corresponding to the second watermark ciphertext, and when the similarity between the second watermark binary code and the watermark original binary code corresponding to the second watermark ciphertext is greater than a preset threshold, it is determined that the watermark verification of the watermark image frame has passed.
[0252] In an optional implementation manner, the watermark configuration information includes an added area and an added strength; when the watermark verification module 630 is used to extract the watermark from the watermark image frame based on the watermark configuration information to obtain the second watermark binary code of the watermark image frame, it is specifically used to:
[0253] Based on the adding area, determining a plurality of watermark adding areas from the watermark image frame;
[0254] For each of the watermark adding regions, based on the adding intensity and the current attribute parameter value of each of the target pixel points in the watermark adding region, determining the extracted binary content corresponding to each of the target pixel points, and determining the extracted binary content corresponding to the watermark adding region based on the extracted binary content corresponding to each of the target pixel points;
[0255] Based on the extracted binary contents corresponding to each of the watermark adding areas, a second watermark binary code of the watermark image frame is determined.
[0256] In an optional implementation manner, the watermark verification module 630, when used to determine the extracted binary content corresponding to each target pixel based on the adding intensity and the current attribute parameter value of each target pixel in the watermark adding area, is specifically used to:
[0257] For each of the target pixel points, based on the added intensity, a remainder process is performed on the current attribute parameter value of the target pixel point to obtain a remainder result;
[0258] Based on the mapping relationship between the adding strength and the changing offset and the adding strength, determining the target changing offset corresponding to the adding strength; the changing offset is used to indicate the changing range of the attribute parameter value of the watermarked image frame compared with the original image frame;
[0259] The remainder result is compared with the target change offset, and the extracted binary content corresponding to the target pixel point is determined according to the comparison result between the remainder result and the target change offset.
[0260] In an optional implementation manner, when the watermark verification module 630 is used to determine the extracted binary content corresponding to the target pixel point according to the comparison result between the remainder result and the target change offset, it is specifically used to:
[0261] When the remainder result is greater than the target change offset, the extracted binary content corresponding to the target pixel point is determined to be 1; otherwise, the extracted binary content corresponding to the target pixel point is determined to be 0.
[0262] In an optional implementation manner, when the watermark verification module 630 is used to determine the extracted binary content corresponding to the watermark adding area based on the extracted binary content corresponding to each of the target pixels, it is specifically used to:
[0263] Determine the number of two extracted binary content bits corresponding to each target pixel point included in the watermark adding area;
[0264] The extracted binary contents with a larger number are determined as the extracted binary contents corresponding to the watermark adding area.
[0265] In an optional implementation manner, when the video receiving module 610 is used for receiving the watermarked video sent by the watermark adding end, it is specifically used for:
[0266] A watermark video signal is received which is sent in real time by the watermark adding end, wherein the watermark video signal is obtained by the watermark adding end converting the watermark video.
[0267] The watermark video playback control device provided by the embodiment of the present disclosure, when playing and controlling the watermark video, multiple watermark adding areas in each watermark image frame of the watermark video are added with a first watermark binary code obtained based on a first watermark ciphertext, the number of the multiple watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one, each target pixel point in each watermark adding area is modified in attribute parameter value according to the original binary content corresponding to the watermark adding area, and each watermark video frame is watermark verified according to the second watermark ciphertext corresponding to the same watermark original text as the first watermark ciphertext, and the watermark image frame is played when the watermark verification passes, so that, when the watermark is added, each bit content of the first watermark binary code is added to multiple areas, and all the pixels in each watermark adding area are added with the same original binary content, so that information redundancy of watermark addition is achieved, thereby effectively resisting the damage of the watermark to the watermark caused by noise in the video encoding and decoding and the broadcast control link transmission process, reducing the watermark loss of the watermark video, reducing the risk of misjudgment of the watermark video when the watermark is verified, and improving the accuracy of video playback control.
[0268] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0269] Corresponding to the above-mentioned video watermarking method and watermark video playback control method, the present disclosure embodiment also provides an electronic device 700, such as Figure 7 As shown in FIG. , it is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present disclosure, including:
[0270] Processor 710, memory 720, and bus 730. The memory 720 is used to store execution instructions, including internal memory 721 and external memory 722; the internal memory 721 is also called internal memory, which is used to temporarily store the operation data in the processor 710 and the data exchanged with the external memory 722 such as a hard disk. The processor 710 exchanges data with the external memory 722 through the internal memory 721.
[0271] In the embodiment of the present application, the memory 720 is specifically used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 710. That is, when the electronic device 700 is running, the processor 710 communicates with the memory 720 through the bus 730, so that the processor 710 executes the application code stored in the memory 720, and then executes the steps of the video watermarking method or the watermark video playback control method described in any of the above embodiments.
[0272] Among them, the memory 720 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0273] The processor 710 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0274] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0275] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the video watermarking method or the watermark video playback control method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0276] The present disclosure also provides a computer program product, which includes computer instructions. When the computer instructions are executed by a processor, the steps of the video watermarking method or the watermark video playback control method described in the above method embodiment can be executed. For details, please refer to the above method embodiment, which will not be repeated here.
[0277] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0278] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment and devices can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0279] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.
[0280] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0281] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0282] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A method for adding a watermark to a video, characterized in that: Applied to the watermark adding end, the method includes: Obtaining an original video, watermark configuration information, and a first watermark ciphertext; the watermark configuration information includes an added area and an added strength; Performing binary conversion processing based on the first watermark ciphertext to obtain a first watermark binary code, and decoding the original video to obtain multiple original image frames; For each of the original image frames, based on the added area, a plurality of watermark adding areas are determined from the original image frame; the number of the plurality of watermark adding areas is the same as the number of bits of the first watermark binary code, and they correspond one to one; For each of the watermarked areas of each of the original image frames, based on the adding intensity and the original binary content corresponding to the watermarked area, the current attribute parameter value of each target pixel point in the watermarked area is modified to obtain an image frame after the watermark is added; Encoding multiple watermarked image frames to obtain a watermarked video, and sending the watermarked video to a watermark verification end; The step of modifying the current attribute parameter value of each target pixel in the watermark adding area based on the adding intensity and the original binary content corresponding to the watermark adding area includes: For each of the target pixels, determine a rounding result according to a current attribute parameter value of the target pixel and the added intensity, wherein the rounding result is a maximum integer less than or equal to a ratio between the current attribute parameter and the added intensity; Determine the target modification offset corresponding to the target pixel point based on the mapping relationship between the binary content and the modification offset and the original binary content corresponding to the watermark addition area to which the target pixel point belongs; The rounding result and the target modification offset are summed to obtain a sum result; The product of the summation result and the added intensity is determined as the modified attribute parameter value of the target pixel.
2. The method according to claim 1, characterized in that The watermark configuration information further includes an added dimension, wherein the added dimension includes a spatial domain dimension or a frequency domain dimension; and the modifying of the current attribute parameter value of each target pixel point in the watermark adding area includes: In a case where the adding dimension indicated by the watermark configuration information is a spatial dimension, modifying the pixel value of the target channel of each target pixel point in the watermark adding area; In the case where the adding dimension indicated by the watermark configuration information is the frequency domain dimension, the frequency value of the target frequency domain of each target pixel point in the watermark adding area is modified.
3. The method according to claim 1, characterized in that When the binary content is 0, the corresponding modification offset is greater than the first target value and less than the second target value; when the binary content is 1, the corresponding modification offset is greater than the second target value and less than the third target value.
4. The method according to claim 1, characterized in that: The binary conversion process based on the first watermark ciphertext includes: Decrypting the first watermark ciphertext to obtain the first watermark original text, and performing binary conversion on the first watermark original text; or The first watermark ciphertext is subjected to binary conversion processing.
5. The method according to claim 1, characterized in that The step of sending the watermarked video to a watermark verification terminal includes: The watermarked video is converted into a watermarked video signal, and the watermarked video signal is sent to the watermark verification end.
6. A method for controlling the playback of a watermarked video, characterized in that: Applied to a watermark verification end, the method comprises: Receive a watermarked video sent by a watermark adding end, and decode the watermarked video to obtain a plurality of watermarked image frames; the watermarked image frames are obtained by modifying the attribute parameter values of all target pixels in a plurality of watermark adding regions in the original image frame according to the first watermark ciphertext; the number of the plurality of watermark adding regions is the same as the number of bits of the first watermark binary code obtained based on the first watermark ciphertext, and the number of the plurality of watermark adding regions is one-to-one corresponding to the number of bits of the first watermark binary code obtained based on the first watermark ciphertext; Acquire watermark configuration information and a second watermark ciphertext, where the second watermark ciphertext and the first watermark ciphertext correspond to the same watermark original text; Based on the watermark configuration information and the second watermark ciphertext, perform watermark verification processing on each of the watermark image frames, and play the watermark image frame if the watermark verification passes; The step of performing watermark verification processing on each watermark image frame based on the watermark configuration information and the second watermark ciphertext includes: For each of the watermark image frames, based on the watermark configuration information, extract the watermark of the watermark image frame to obtain a second watermark binary code of the watermark image frame; Comparing the second watermark binary code with the watermark original binary code corresponding to the second watermark ciphertext, and determining that the watermark image frame watermark verification has passed when the similarity between the second watermark binary code and the watermark original binary code corresponding to the second watermark ciphertext is greater than a preset threshold; The watermark configuration information includes an added area and an added strength; and based on the watermark configuration information, extracting a watermark from the watermark image frame to obtain a second watermark binary code of the watermark image frame includes: Based on the adding area, determining a plurality of watermark adding areas from the watermark image frame; For each of the watermark adding regions, based on the adding intensity and the current attribute parameter value of each of the target pixel points in the watermark adding region, determining the extracted binary content corresponding to each of the target pixel points, and determining the extracted binary content corresponding to the watermark adding region based on the extracted binary content corresponding to each of the target pixel points; Determining a second watermark binary code of the watermark image frame based on the extracted binary content corresponding to each of the watermark added areas; The step of determining the extracted binary content corresponding to each target pixel point based on the adding intensity and the current attribute parameter value of each target pixel point in the watermark adding area includes: For each of the target pixel points, based on the added intensity, a remainder process is performed on the current attribute parameter value of the target pixel point to obtain a remainder result; Based on the mapping relationship between the adding strength and the change offset and the adding strength, determining the target change offset corresponding to the adding strength; the change offset is used to indicate the change range of the attribute parameter value of the watermark image frame compared with the original image frame; The remainder result is compared with the target change offset, and the extracted binary content corresponding to the target pixel point is determined according to the comparison result between the remainder result and the target change offset.
7. The method according to claim 6, characterized in that The step of determining the extracted binary content corresponding to the target pixel point according to a comparison result between the remainder result and the target change offset includes: When the remainder result is greater than the target change offset, the extracted binary content corresponding to the target pixel point is determined to be 1; otherwise, the extracted binary content corresponding to the target pixel point is determined to be 0.
8. The method according to claim 6, characterized in that The step of determining the extracted binary content corresponding to the watermark adding area based on the extracted binary content corresponding to each of the target pixel points comprises: Determine the number of two extracted binary content bits corresponding to each target pixel point included in the watermark adding area; The extracted binary contents with a larger number are determined as the extracted binary contents corresponding to the watermark adding area.
9. The method according to claim 6, characterized in that The receiving watermark video sent by the watermark adding end includes: A watermark video signal is received which is sent in real time by the watermark adding end, wherein the watermark video signal is obtained by the watermark adding end converting the watermark video.
10. A video watermarking device, characterized in that: Applied to a watermark adding end, the device comprises: A first data acquisition module is used to acquire the original video, watermark configuration information and a first watermark ciphertext; the watermark configuration information includes an added area and an added strength; A data conversion module, configured to perform binary conversion processing based on the first watermark ciphertext to obtain a first watermark binary code, and decode the original video to obtain a plurality of original image frames; A region positioning module, for determining, for each of the original image frames, a plurality of watermark adding regions from the original image frame based on the adding region; the number of the plurality of watermark adding regions is the same as the number of bits of the first watermark binary code, and the watermark adding regions correspond one to one; a watermark adding module, configured to modify, for each watermark adding region of each original image frame, a current attribute parameter value of each target pixel point in the watermark adding region based on the adding intensity and the original binary content corresponding to the watermark adding region, so as to obtain an image frame after adding a watermark; A video sending module is used to encode a plurality of watermarked image frames to obtain a watermarked video, and send the watermarked video to a watermark verification end; Wherein, when the watermark adding module is used to modify the current attribute parameter value of each target pixel point in the watermark adding area based on the adding intensity and the original binary content corresponding to the watermark adding area, it is specifically used to: For each of the target pixels, determine a rounding result according to a current attribute parameter value of the target pixel and the added intensity, wherein the rounding result is a maximum integer less than or equal to a ratio between the current attribute parameter and the added intensity; Determine the target modification offset corresponding to the target pixel point based on the mapping relationship between the binary content and the modification offset and the original binary content corresponding to the watermark addition area to which the target pixel point belongs; The rounding result and the target modification offset are summed to obtain a sum result; The product of the summation result and the added intensity is determined as the modified attribute parameter value of the target pixel.
11. A watermark video playback control device, characterized in that: Applied to a watermark verification end, the device comprises: A video receiving module is used to receive a watermarked video sent by a watermark adding end, and decode the watermarked video to obtain a plurality of watermarked image frames; the watermarked image frames are obtained by modifying the attribute parameter values of all target pixels in a plurality of watermark adding regions in an original image frame according to a first watermark ciphertext; the number of the plurality of watermark adding regions is the same as the number of bits of a first watermark binary code obtained based on the first watermark ciphertext, and the number of the plurality of watermark adding regions is one-to-one corresponding to the number of bits of a first watermark binary code obtained based on the first watermark ciphertext; A second data acquisition module is used to acquire watermark configuration information and a second watermark ciphertext, where the second watermark ciphertext and the first watermark ciphertext correspond to the same watermark original text; A watermark verification module, configured to perform watermark verification processing on each of the watermark image frames based on the watermark configuration information and the second watermark ciphertext, and to play the watermark image frame if the watermark verification passes; Wherein, when the watermark verification module is used to perform watermark verification processing on each watermark image frame based on the watermark configuration information and the second watermark ciphertext, it is specifically used to: For each of the watermark image frames, based on the watermark configuration information, extract the watermark of the watermark image frame to obtain a second watermark binary code of the watermark image frame; comparing the second watermark binary code with the watermark original binary code corresponding to the second watermark ciphertext, and determining that the watermark image frame watermark verification has passed when the similarity between the second watermark binary code and the watermark original binary code corresponding to the second watermark ciphertext is greater than a preset threshold; The watermark configuration information includes an added area and an added strength; when the watermark verification module is used to extract the watermark from the watermark image frame based on the watermark configuration information to obtain the second watermark binary code of the watermark image frame, it is specifically used to: Based on the adding area, determining a plurality of watermark adding areas from the watermark image frame; For each of the watermark adding regions, based on the adding intensity and the current attribute parameter value of each of the target pixel points in the watermark adding region, determining the extracted binary content corresponding to each of the target pixel points, and determining the extracted binary content corresponding to the watermark adding region based on the extracted binary content corresponding to each of the target pixel points; Determining a second watermark binary code of the watermark image frame based on the extracted binary content corresponding to each of the watermark added areas; Wherein, when the watermark verification module is used to determine the extracted binary content corresponding to each target pixel based on the adding intensity and the current attribute parameter value of each target pixel in the watermark adding area, it is specifically used to: For each of the target pixel points, based on the added intensity, a remainder process is performed on the current attribute parameter value of the target pixel point to obtain a remainder result; Based on the mapping relationship between the adding strength and the changing offset and the adding strength, determining the target changing offset corresponding to the adding strength; the changing offset is used to indicate the changing range of the attribute parameter value of the watermarked image frame compared with the original image frame; The remainder result is compared with the target change offset, and the extracted binary content corresponding to the target pixel point is determined according to the comparison result between the remainder result and the target change offset.
12. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for adding a watermark to a video as described in any one of claims 1 to 5 or the method for controlling the playback of a watermarked video as described in any one of claims 6 to 9 are performed.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the video watermarking method according to any one of claims 1 to 5 or the watermark video playback control method according to any one of claims 6 to 9.
Citation Information
Patent Citations
Video watermark adding method and device, electronic equipment and storage medium
CN110971931A
Video watermark processing method and device, electronic equipment and storage medium
CN117061768A