Video watermark embedding method and device, equipment, medium and program product

By extracting keyframes from the video and adjusting the watermark embedding strength and area according to the static or dynamic scene type, the problem of watermark embedding affecting video quality is solved, achieving a balance between security and image quality, and is suitable for edge devices with lower performance.

CN121750878APending Publication Date: 2026-03-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610144770.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-02
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies struggle to balance watermark embedding strength with video quality when embedding watermarks in videos. This results in poor image quality when the embedding strength is high, and the watermark is easily lost when the embedding strength is low, affecting the security and traceability of the video.

Method used

By extracting keyframes from the target video as target frames, the watermark embedding strength and area are flexibly adjusted according to the static or dynamic scene type of the frame. Frequency domain transformation and inverse transformation techniques are used to perform differentiated watermark embedding for different scenes.

Benefits of technology

It improves video security and image quality, reduces the performance requirements of processing equipment, reduces data volume, reduces video retrieval latency, and enhances the robustness and concealment of watermarks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121750878A_ABST
    Figure CN121750878A_ABST
Patent Text Reader

Abstract

The invention discloses a video watermark embedding method, device and equipment, a medium and a program product, relates to the technical field of watermark embedding, can be applied to the field of financial science and technology, and comprises the following steps: obtaining a target video and watermark information to be embedded; extracting a plurality of key frames from the target video as target frames; determining a scene type of the first target frame according to the pixel information of the first target frame and the pixel information of the second target frame; the scene type comprises a static scene and a dynamic scene; the second target frame is a previous target frame of the first target frame; and embedding watermark information into the first target frame according to the scene type. According to the embodiment of the invention, the scene type of the first target frame is identified through the second target frame; therefore, watermark embedding is flexibly carried out for different scene types, and the image quality and safety of the video after watermark embedding are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video watermark embedding technology, and in particular to a video watermark embedding method, apparatus, device, medium, and program product. Background Technology

[0002] Due to the need for security monitoring and video management, financial institutions regularly review surveillance videos to check the operational security of their branches. Key areas such as vaults and armored trucks are subject to daily spot checks. To prevent the leakage of private data such as internal videos, financial institutions add dynamic watermarks to the video streams so that data that has been illegally captured or copied can be traced back to its source in a timely manner, thereby improving video security.

[0003] Existing technologies typically employ a uniform embedding strength to directly embed frequency-domain invisible watermarks into all video frames. If the watermark embedding strength is high, the resulting video quality will be poor; if the watermark embedding strength is low, the watermark is easily lost and difficult to extract, leading to poor video security and traceability. Summary of the Invention

[0004] This invention provides a method, apparatus, device, medium, and program product for embedding watermarks in videos, so as to achieve flexible watermark embedding for dynamic and static scenes in videos, balancing video quality and security.

[0005] In a first aspect, embodiments of the present invention provide a method for embedding a watermark in a video, comprising:

[0006] Obtain the target video and the watermark information to be embedded;

[0007] Multiple keyframes are extracted from the target video and used as target frames.

[0008] Based on the pixel information of the first target frame and the pixel information of the second target frame, the scene type of the first target frame is determined; the scene type includes static scene and dynamic scene; the second target frame is the target frame preceding the first target frame.

[0009] According to the scene type, the watermark information is embedded into the first target frame.

[0010] Secondly, embodiments of the present invention also provide a video watermark embedding device, comprising:

[0011] The acquisition module is used to acquire the target video and the watermark information to be embedded;

[0012] An extraction module is used to extract multiple keyframes from the target video as target frames.

[0013] The determining module is used to determine the scene type of the first target frame based on the pixel information of the first target frame and the pixel information of the second target frame; the scene type includes static scene and dynamic scene; the second target frame is the target frame preceding the first target frame;

[0014] An embedding module is used to embed watermark information into the first target frame according to the scene type.

[0015] Thirdly, embodiments of the present invention also provide an electronic device, comprising:

[0016] At least one processor; and

[0017] A memory that is communicatively connected to at least one processor; wherein

[0018] The memory stores instructions that can be executed by at least one processor, such that the at least one processor is able to perform the video watermark embedding method provided in any embodiment of the present invention.

[0019] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions for causing a processor to execute and implement the video watermark embedding method of any embodiment of the present invention.

[0020] Fifthly, embodiments of the present invention also provide a computer program product, characterized in that the computer program product includes a computer program, which, when executed by a processor, implements the video watermark embedding method of any embodiment of the present invention.

[0021] This invention extracts keyframes from the target video as the target frames for watermark embedding, avoiding watermark embedding on all video frames. This reduces the number of frames to be processed, thereby reducing the amount of data to be processed, improving watermark embedding efficiency, and lowering the performance requirements of the processing device, while ensuring watermark embedding and improving video security. This allows the technical solution of this invention to be executed by edge devices with lower performance. In real-time video viewing scenarios, reducing the amount of data and the time spent on watermark embedding reduces video viewing latency. By identifying the scene type of the first target frame, flexible watermark embedding can be performed for both static and dynamic scenes, improving the robustness of watermarks in static scenes and ensuring the security of the watermarked video. It also improves the concealment of watermarks in dynamic scenes, avoiding obvious watermark noise in dynamically changing images, thus improving the image quality of the watermarked video.

[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of a video watermark embedding method provided in Embodiment 1 of the present invention;

[0025] Figure 2 This is a flowchart of a video watermark embedding method provided in Embodiment 2 of the present invention;

[0026] Figure 3 This is a schematic diagram of the structure of a video watermark embedding device according to Embodiment 3 of the present invention;

[0027] Figure 4 This is a structural diagram of an electronic device that implements a video watermark embedding method according to an embodiment of the present invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first" and "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] The acquisition, storage, and application of target videos and watermark information involved in the technical solutions of this invention comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0031] Example 1

[0032] Figure 1 This is a flowchart of a video watermark embedding method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of embedding watermarks into videos. The method can be executed by a video watermark embedding device, which can be implemented in hardware and / or software and specifically configured in an electronic device.

[0033] See Figure 1 The watermark embedding method shown in the video includes:

[0034] S101. Obtain the target video and the watermark information to be embedded.

[0035] S102. Extract multiple keyframes from the target video and use them as target frames.

[0036] S103. Determine the scene type of the first target frame based on the pixel information of the first target frame and the pixel information of the second target frame; the scene type includes static scene and dynamic scene; the second target frame is the target frame preceding the first target frame.

[0037] S104. According to the scene type, embed the watermark information into the first target frame.

[0038] In this embodiment, the target video can be the video to which the watermark is to be embedded. The keyframe can be an I-frame. The target frame can be the keyframe involved in the watermark embedding process. A static scene can be used to represent that the corresponding first target frame is more stable than the second target frame; a dynamic scene can be used to represent that the corresponding first target frame moves compared to the second target frame. The watermark information can be a binary string, i.e., a string composed of 1s and 0s.

[0039] Specifically, the process involves acquiring the target video and the watermark information to be embedded; dividing the target video into video segments of a set duration, and extracting a keyframe from each video segment as the target frame; for example, the set duration could be 1 second, in which case the target video is divided into multiple 1-second video segments, and a keyframe is extracted from each video segment as the target frame; it should be noted that 1 second, 2 seconds, and 3 seconds are merely examples, and this application does not limit the specific value of the interval duration; based on the pixel information of the first target frame and the pixel information of the second target frame, the structural similarity between the first target frame and the second target frame is calculated. If the structural similarity is greater than a set similarity threshold, the scene type of the first target frame is determined to be a static scene; if the structural similarity is less than or equal to the set similarity threshold, the scene type of the first target frame is determined to be a dynamic scene. For example, the set similarity threshold can be 0.9, which can determine the scene type of the first target frame with a structural similarity greater than 0.9 as a static scene and the scene type of the first target frame with a structural similarity less than or equal to 0.9 as a dynamic scene. It should be noted that the set similarity threshold is only an example, and this application does not limit the specific value of the set similarity threshold. According to the scene type, the watermark information is embedded into the first target frame.

[0040] In an optional embodiment, while embedding the watermark information into the first target frame according to the scene type, the watermark information can also be embedded into the target frame with the earliest timestamp information.

[0041] In an optional embodiment, if there is a keyframe loss in the target video, that is, there is a video segment from which keyframes cannot be extracted, then a forward prediction frame is extracted from the video segment as the target frame.

[0042] Optionally, before obtaining the target video and the watermark information to be embedded, the method further includes: responding to a video access request initiated by a user, obtaining the user's identity identifier, requesting device identifier, and time identifier; concatenating the identity identifier, the requesting device identifier, the time identifier, and a locally configured key to obtain a concatenated string; performing a hash operation on the concatenated string to obtain a hash value corresponding to the concatenated string; and converting the hash value into a binary string as the watermark information to be embedded.

[0043] The video access request can be used to request the video storage terminal to transmit the watermarked video to it. The identity identifier can be used to uniquely identify the user initiating the video access request; the requesting device identifier can be used to uniquely identify the device initiating the video access request; the time identifier can be used to uniquely identify the time when the user initiated the video access request; the locally configured key can be a key configured in the apparatus or device that executes the video watermark embedding method provided in this embodiment of the invention, that is, the local device is the apparatus or device that executes the video watermark embedding method provided in this embodiment of the invention.

[0044] In one specific implementation, a string of a predetermined number of consecutive characters can be extracted from a binary string as the watermark information to be embedded.

[0045] Understandably, by adopting the above technical solution, watermark information can be generated using the user's identity identifier, requesting device identifier, time identifier, and locally configured key. This ensures that the watermark information changes with the user's device, requesting device, and time, improving the diversity and security of the watermark information. Furthermore, the locally configured key can further enhance the diversity and security of the watermark information, preventing the leakage of identity identifier, requesting device identifier, and time identifier due to rainbow table attacks on hash values, thus improving the security of user information.

[0046] In an optional embodiment, the hash value, identity identifier, requesting device identifier, and time identifier can also be associated and uploaded to the cloud for storage. The cloud also stores the locally configured key. The auxiliary hash value is calculated using the key, identity identifier, requesting device identifier, and time identifier stored in the cloud, and the auxiliary hash value is verified to be consistent with the uploaded hash value, thereby identifying forged watermarks or watermarks embedded in the device that have been tampered with.

[0047] In an optional embodiment, after obtaining each first target frame with embedded watermark information, the hash value can also be added as scrolling text to each frame of the target video to increase the real-time performance of the watermark.

[0048] In one specific implementation, each first target frame with embedded watermark information and other video frames in the target video can be encoded into a video stream and the video stream can be sent to the user.

[0049] In an optional embodiment, the video watermark embedding method provided by the present invention can be executed by an edge device, such as a video recording device, thereby avoiding the need to obtain the target video from the video recording device for watermark embedding and then send it to the client, reducing the latency for users to obtain the watermarked video and improving real-time performance.

[0050] This invention extracts keyframes from the target video as target frames for watermark embedding, avoiding watermark embedding on all video frames. This reduces the number of frames to be processed, thereby reducing the amount of data to be processed, improving watermark embedding efficiency, and lowering the performance requirements of the processing device. This allows the technical solution of this invention to be executed by lower-performance edge devices. In real-time video viewing scenarios, reducing the amount of data and the time spent on watermark embedding reduces video viewing latency. By identifying the scene type of the first target frame, flexible watermark embedding can be performed for both static and dynamic scenes, improving the robustness of watermarks in static scenes and ensuring the security of the watermarked video. It also improves the concealment of watermarks in dynamic scenes, avoiding obvious watermark noise in dynamically changing images, thus improving the image quality of the watermarked video.

[0051] Example 2

[0052] Figure 2 This is a flowchart of a video watermark embedding method provided in Embodiment 2 of the present invention. Based on the technical solution of the above embodiments, the watermark information embedding operation of the present invention has been optimized and improved.

[0053] Furthermore, the phrase "embedding watermark information into the first target frame according to the scene type" is refined to "querying the watermark embedding strength coefficient of the first target frame according to the scene type; the watermark embedding strength coefficient of the static scene is greater than the watermark embedding strength coefficient of the dynamic scene; determining the watermark region to be embedded in the first target frame according to the scene type; performing a frequency domain transformation on the watermark region to be embedded to obtain the frequency domain coefficient matrix of the watermark region to be embedded; embedding the watermark information into the frequency domain coefficient matrix according to the scene type and the watermark embedding strength coefficient to obtain the watermark embedding matrix; performing an inverse frequency domain transformation on the watermark embedding matrix to obtain the first target frame with embedded watermark information," thus improving the watermark information embedding operation.

[0054] It should be noted that for any parts not described in detail in the embodiments of the present invention, please refer to the description in the foregoing embodiments.

[0055] See Figure 2 The watermark embedding method shown in the video includes:

[0056] S201. Obtain the target video and the watermark information to be embedded.

[0057] S202. Extract multiple keyframes from the target video and use them as target frames.

[0058] S203. Based on the pixel information of the first target frame and the pixel information of the second target frame, determine the scene type of the first target frame; the scene type includes static scene and dynamic scene; the second target frame is the target frame preceding the first target frame.

[0059] S204. Based on the scene type, query the watermark embedding strength coefficient of the first target frame; the watermark embedding strength coefficient of the static scene is greater than the watermark embedding strength coefficient of the dynamic scene.

[0060] S205. Based on the scene type, determine the area to be embedded with watermark from the first target frame.

[0061] S206. Perform frequency domain transformation on the watermark region to be embedded to obtain the frequency domain coefficient matrix of the watermark region to be embedded.

[0062] S207. Based on the scene type and watermark embedding strength coefficient, embed the watermark information into the frequency domain coefficient matrix to obtain the watermark embedding matrix.

[0063] S208. Perform an inverse frequency domain transformation on the watermark embedding matrix to obtain the first target frame with embedded watermark information.

[0064] In this embodiment, the watermark embedding strength coefficient can be used to adjust the intensity of watermark embedding in the first target frame. The region to be embedded with watermark information can be the region in the first target frame where watermark information is to be embedded; the watermark embedding matrix can be the matrix obtained after embedding the watermark information into the frequency domain coefficient matrix. It should be noted that the present invention does not limit the watermark embedding strength coefficient corresponding to static scenes and dynamic scenes, as long as the watermark embedding strength coefficient corresponding to static scenes is greater than the watermark embedding strength coefficient corresponding to dynamic scenes. For example, the watermark embedding strength coefficient corresponding to static scenes is 0.1, and the watermark embedding strength coefficient corresponding to dynamic scenes is 0.05.

[0065] Specifically, the process involves querying the watermark embedding strength coefficient that matches the scene type of the first target frame; determining the watermark region to be embedded in the first target frame based on the scene type; performing a discrete cosine transform on the watermark region to be embedded to obtain the frequency domain coefficient matrix of the watermark region; embedding the watermark information into the frequency domain coefficient matrix based on the scene type and the watermark embedding strength coefficient to obtain the watermark embedding matrix; and performing an inverse discrete cosine transform on the watermark embedding matrix to obtain the first target frame with the embedded watermark information.

[0066] Optionally, determining the watermark region to be embedded in the first target frame according to the scene type includes: if the scene type is a static scene, then dividing the first target frame into blocks to obtain pixel regions of the first target frame; for each pixel region, calculating the texture intensity value of the pixel region based on the pixel information within the pixel region; selecting a first number of pixel regions with smaller texture intensity values ​​as the watermark region to be embedded; the first number is the same as the number of characters in the watermark information.

[0067] In this context, a pixel region refers to the region obtained by dividing the first target frame into blocks. Texture intensity values ​​can be used to characterize the texture intensity of a pixel region. Specifically, a preset block parameter can be used to divide the first target frame into multiple pixel regions of a predetermined size; preferably, the predetermined size is 4x4, meaning the pixel region is a square region with a length of 4 pixels and a width of 4 pixels. For each pixel region, the gradient value of each pixel within the pixel region is calculated; the average of the gradient values ​​of all pixels within the pixel region is determined as the texture intensity value; a first number of pixel regions with smaller texture intensity values ​​are selected as the regions to be embedded with the watermark.

[0068] It is understandable that by adopting the above technical solution, after dividing the first target frame into blocks to obtain each pixel region, the texture intensity value of each pixel region is calculated, and the pixel region with lower texture intensity value is determined as the watermark region to be embedded. This avoids embedding the watermark information into the region with higher texture intensity value in the first target frame image, thereby avoiding the loss of texture in the high texture region after watermark embedding, and thus improving the image quality of the first target frame after watermark embedding.

[0069] Optionally, determining the watermark region to be embedded in the first target frame according to the scene type includes: if the scene type is a dynamic scene, determining the pixel type of each pixel in the first target frame according to the first target frame and the second target frame; the pixel type includes moving pixels and static pixels; dividing the first target frame into blocks to obtain pixel regions of the first target frame; for each pixel region, calculating the proportion of moving pixels in the pixel region; performing motion estimation processing on the pixel region to obtain the horizontal motion vector and vertical motion vector of the pixel region; calculating the motion intensity value of the pixel region according to the horizontal motion vector and the vertical motion vector; selecting a first number of pixel regions as the watermark region to be embedded according to the proportion of moving pixels and the motion intensity value; the first number is the same as the number of characters in the watermark information.

[0070] Specifically, an inter-frame difference algorithm is used to calculate the grayscale difference image between the first target frame and the second target frame; pixel positions with grayscale values ​​greater than or equal to a set difference threshold in the grayscale difference image are determined as moving pixel positions; pixel positions with grayscale values ​​less than the set difference threshold in the grayscale difference image are determined as static pixel positions; pixels at moving pixel positions in the first target frame are determined as moving pixels, and pixels at static pixel positions in the first target frame are determined as static pixels; the first target frame is divided into blocks to obtain pixel regions of the first target frame; preferably, the size of the pixel region in a dynamic scene is the same as the size of the pixel region in a static scene; for each pixel region, the ratio between the number of moving pixels in the pixel region and the total number of pixels in the pixel region is determined as the proportion of moving pixels; a motion estimation algorithm is used to calculate the horizontal motion vector and the vertical motion vector of the pixel region; based on the horizontal motion vector and the vertical motion vector, the motion intensity value of the pixel region is calculated; for example, the motion intensity value can be determined by the following formula:

[0071] ;

[0072] in, Indicates the exercise intensity value; Represents the horizontal motion vector; This represents the vertical motion vector.

[0073] The proportion of moving pixels in each pixel region is normalized to obtain a first normalization result, and the motion intensity value of each pixel region is normalized to obtain a second normalization result; the first normalization result and the second normalization result are added together to obtain a normalized sum result; a first number of pixel regions with smaller normalized sum results are selected as the watermark to be embedded.

[0074] It is understandable that by adopting the above technical solution, the proportion of moving pixels and the motion intensity value of each pixel region can be determined separately, and after normalization, they are added together to obtain the sum. The first number of pixel regions with smaller sums are selected as the watermark regions to be embedded. Thus, pixel regions with lower motion intensity and lower proportion of moving pixels are selected from the first target frame of the dynamic scene as the watermark regions to be embedded. This avoids embedding watermark information into regions with higher motion intensity and higher proportion of moving pixels, which would result in obvious watermark noise when the image moves violently. This avoids affecting the video quality and improves the concealment of the watermark in dynamic motion scenes in the video with the embedded watermark.

[0075] Optionally, the step of embedding the watermark information into the frequency domain coefficient matrix according to the scene type and the watermark embedding strength coefficient to obtain the watermark embedding matrix includes: if the scene type is a static scene, then determining the main intermediate frequency coefficient and the secondary intermediate frequency coefficient from the frequency domain coefficient matrix; the frequency of the secondary intermediate frequency coefficient is greater than the frequency of the main intermediate frequency coefficient; the frequency is represented by the sum of the matrix row index and the matrix column index; fusing the watermark information with the main intermediate frequency coefficient according to the embedding weight of the watermark embedding strength coefficient and the main intermediate frequency coefficient, and fusing the watermark information with the secondary intermediate frequency coefficient according to the embedding weight of the watermark embedding strength coefficient and the secondary intermediate frequency coefficient to obtain the watermark embedding matrix.

[0076] The frequency domain coefficient matrix includes DC coefficients, low-frequency coefficients, mid-frequency coefficients, and high-frequency coefficients; the sum of the matrix row index and the matrix column index can be used to characterize the frequency; the frequency of the main mid-frequency coefficient is greater than the frequency of the secondary mid-frequency coefficient. For example, if the pixel region is 4x4 in size, then the frequency domain coefficient matrix is ​​a 4x4 matrix. In the frequency domain coefficient matrix, the element whose sum of the matrix row index and matrix column index is 0 is the DC coefficient, that is, the element at position (0,0) in the frequency domain coefficient matrix is ​​the DC coefficient. In the frequency domain coefficient matrix, the element whose sum of the matrix row index and matrix column index is 1 is the low-frequency coefficient, that is, the element at position (0,1) and (1,0) in the frequency domain coefficient matrix is ​​the low-frequency coefficient. In the frequency domain coefficient matrix, the element whose sum of the matrix row index and matrix column index is 2 or 3 is the mid-frequency coefficient, that is, the element at position (1,1), (0,2), (2,0), (1,2), (2,1), (0,3), and (3,0) in the frequency domain coefficient matrix is ​​the mid-frequency coefficient. The embedding weight of the primary mid-frequency coefficient is greater than the embedding weight of the secondary mid-frequency coefficient.

[0077] Specifically, if the scene type is a static scene, then from the frequency domain coefficient matrix, the intermediate frequency coefficient with the smallest frequency is determined as the main intermediate frequency coefficient; the intermediate frequency coefficient with the smallest frequency and the smallest row index, other than the main intermediate frequency coefficient, is determined as the secondary intermediate frequency coefficient; for example, for a 4x4 frequency domain coefficient matrix, the row index includes 0, 1, 2 and 3, the column index includes 0, 1, 2 and 3, the element at position (1, 1) is selected as the main intermediate frequency coefficient, and the element at position (0, 2) is selected as the secondary intermediate frequency coefficient.

[0078] Multiply the embedding weight of the primary intermediate frequency coefficient by the watermark embedding strength coefficient to obtain the primary watermark embedding strength coefficient; multiply the embedding weight of the secondary intermediate frequency coefficient by the watermark embedding strength coefficient to obtain the secondary watermark embedding strength coefficient; based on the primary watermark embedding strength coefficient, fuse the watermark information with the primary intermediate frequency coefficient, and based on the secondary watermark embedding strength coefficient, fuse the watermark information with the secondary intermediate frequency coefficient to obtain the watermark embedding matrix.

[0079] In one optional implementation, the average value of the corresponding values ​​of each character in the watermark information can be calculated; the average value is multiplied by the main watermark embedding strength coefficient, and the result of the multiplication is added to the value of the main intermediate frequency coefficient as the new value of the main intermediate frequency coefficient; the average value is multiplied by the secondary watermark embedding strength coefficient, and the result of the multiplication is added to the value of the secondary intermediate frequency coefficient as the new value of the secondary intermediate frequency coefficient, thereby obtaining a frequency domain coefficient matrix with updated values, so as to embed the watermark information into the frequency domain coefficient matrix.

[0080] In another optional implementation, the watermark character corresponding to the frequency domain coefficient matrix is ​​determined according to the order of the texture intensity values ​​of the watermark regions to be embedded in the frequency domain coefficient matrix and the order of each character in the watermark information. For example, the watermark character corresponding to the frequency domain coefficient matrix of the watermark region with the smallest texture intensity value is the first character in the watermark information; the watermark character corresponding to the frequency domain coefficient matrix of the watermark region with the largest texture intensity value is the last character in the watermark information. If the watermark character corresponding to the frequency domain coefficient matrix is ​​1, the values ​​of the main watermark embedding intensity coefficient and the main intermediate frequency coefficient are added together, and the values ​​of the secondary watermark embedding intensity coefficient and the secondary intermediate frequency coefficient are added together to embed the watermark information into the frequency domain coefficient matrix. If the watermark character corresponding to the frequency domain coefficient matrix is ​​0, the value of the main intermediate frequency coefficient is subtracted from the main watermark embedding intensity coefficient, and the value of the secondary intermediate frequency coefficient is subtracted from the secondary watermark embedding intensity coefficient to embed the watermark information into the frequency domain coefficient matrix.

[0081] Understandably, by adopting the above technical solution, watermark information can be embedded into the frequency domain coefficient matrix in static scenes, specifically into the mid-frequency coefficients representing subtle textures. This ensures that the embedded watermark information only affects subtle textures in pixel areas within static scenes. In static scenes, subtle textures are relatively stable and do not easily change in video. Embedding watermark information into subtle textures avoids significantly impacting the image quality after watermark embedding, thus ensuring the video quality after watermark embedding. Furthermore, by embedding watermark information into the main and secondary mid-frequency coefficients, redundancy of mid-frequency coefficients can prevent the loss of a single mid-frequency coefficient during transmission and storage, thus avoiding situations where traceability is impossible.

[0082] Optionally, the step of embedding the watermark information into the frequency domain coefficient matrix according to the scene type and the watermark embedding strength coefficient to obtain the watermark embedding matrix includes: if the scene type is a dynamic scene, then determining the main intermediate frequency coefficient from the frequency domain coefficient matrix; and fusing the watermark information with the main intermediate frequency coefficient according to the watermark embedding strength coefficient to obtain the watermark embedding matrix.

[0083] It should be noted that the process for determining the main intermediate frequency coefficient in dynamic scenarios is similar to that in static scenarios, and will not be repeated here.

[0084] In an optional embodiment, the average value of the corresponding values ​​of each character in the watermark information can be calculated; the average value is multiplied by the watermark embedding strength coefficient, and the multiplication result is added to the value of the main intermediate frequency coefficient as the new value of the main intermediate frequency coefficient, thereby obtaining a frequency domain coefficient matrix with updated values, so as to embed the watermark information into the frequency domain coefficient matrix.

[0085] In another optional embodiment, the watermark character corresponding to the frequency domain coefficient matrix is ​​determined according to the order of the normalized summation results of the watermark regions to be embedded in each watermark region, and the order of each character in the watermark information. For example, the watermark character corresponding to the frequency domain coefficient matrix of the watermark region with the smallest normalized summation result is the first character in the watermark information; the watermark character corresponding to the frequency domain coefficient matrix of the watermark region with the largest normalized summation result is the last character in the watermark information.

[0086] If the watermark character corresponding to the frequency domain coefficient matrix is ​​1, then the values ​​of the watermark embedding strength coefficient and the main intermediate frequency coefficient are added together to embed the watermark information into the frequency domain coefficient matrix; if the watermark character corresponding to the frequency domain coefficient matrix is ​​0, then the value of the main intermediate frequency coefficient is subtracted from the watermark embedding strength coefficient to embed the watermark information into the frequency domain coefficient matrix.

[0087] Understandably, by adopting the above technical solution, watermark information can be embedded into the main intermediate frequency coefficient in dynamic scenes. By leveraging the anti-blurring and anti-compression properties of the main intermediate frequency coefficient, the anti-blurring effect of the watermark can be improved. Embedding the watermark information into a single main intermediate frequency coefficient avoids dispersing the intensity of the watermark information across multiple intermediate frequency coefficients, ensuring the strength of the watermark information embedded in the main intermediate frequency coefficient. This further enhances the anti-motion blurring capability of the embedded watermark and also avoids dispersing the intensity of the watermark information across multiple intermediate frequency coefficients, which would cause more texture effects, thereby further improving the video quality in dynamic scenes.

[0088] This invention embodiment queries the watermark embedding strength coefficient of the first target frame according to the scene type; the watermark embedding strength coefficient of the static scene is greater than that of the dynamic scene; determines the watermark-to-be-embedded region from the first target frame according to the scene type; performs a frequency domain transformation on the watermark-to-be-embedded region to obtain a frequency domain coefficient matrix of the watermark-to-be-embedded region; embeds the watermark information into the frequency domain coefficient matrix according to the scene type and the watermark embedding strength coefficient to obtain a watermark embedding matrix; performs an inverse frequency domain transformation on the watermark embedding matrix to obtain the first target frame with embedded watermark information. For the first target frame of the static scene, the watermark information with higher embedding strength has better concealment in the stable static scene. Thus, while ensuring concealment, the traceability and anti-attack resistance of the video with embedded watermark information are improved by increasing the strength of the embedded watermark information, thereby improving the security of the video. For the first target frame of the dynamic scene, the watermark information with lower embedding strength avoids the appearance of more noise in the constantly moving scene of the embedded watermark information, thereby avoiding affecting the image quality.

[0089] Example 3

[0090] Figure 3 This is a schematic diagram of a video watermark embedding device according to Embodiment 3 of the present invention. This embodiment of the invention is applicable to situations where watermarks are embedded in videos. The device can perform a video watermark embedding method and can be implemented in hardware and / or software. The device can be configured in an electronic device.

[0091] See Figure 3 The watermark embedding device for the video shown includes an acquisition module 301, an extraction module 302, a determination module 303, and an embedding module 304, wherein...

[0092] The acquisition module is used to acquire the target video and the watermark information to be embedded;

[0093] An extraction module is used to extract multiple keyframes from the target video as target frames.

[0094] The determining module is used to determine the scene type of the first target frame based on the pixel information of the first target frame and the pixel information of the second target frame; the scene type includes static scene and dynamic scene; the second target frame is the target frame preceding the first target frame;

[0095] An embedding module is used to embed watermark information into the first target frame according to the scene type.

[0096] This invention extracts keyframes from the target video as target frames for watermark embedding, avoiding watermark embedding on all video frames. This reduces the number of frames to be processed, thereby reducing the amount of data to be processed, improving watermark embedding efficiency, and lowering the performance requirements of the processing device. This allows the technical solution of this invention to be executed by lower-performance edge devices. In real-time video viewing scenarios, reducing the amount of data and the time spent on watermark embedding reduces video viewing latency. By identifying the scene type of the first target frame, flexible watermark embedding can be performed for both static and dynamic scenes, improving the robustness of watermarks in static scenes and ensuring the security of the watermarked video. It also improves the concealment of watermarks in dynamic scenes, avoiding obvious watermark noise in dynamically changing images, thus improving the image quality of the watermarked video.

[0097] Optional, embedded modules include:

[0098] The coefficient determination unit is used to query the watermark embedding strength coefficient of the first target frame according to the scene type; the watermark embedding strength coefficient of the static scene is greater than the watermark embedding strength coefficient of the dynamic scene;

[0099] The region determination unit is used to determine the region to be embedded with watermark from the first target frame according to the scene type;

[0100] The first transformation unit is used to perform frequency domain transformation on the watermark region to be embedded to obtain the frequency domain coefficient matrix of the watermark region to be embedded.

[0101] An embedding unit is used to embed watermark information into the frequency domain coefficient matrix according to the scene type and watermark embedding strength coefficient to obtain a watermark embedding matrix.

[0102] The second transformation unit is used to perform an inverse frequency domain transformation on the watermark embedding matrix to obtain a first target frame with embedded watermark information.

[0103] Optional, region definition unit, specifically used for:

[0104] If the scene type is a static scene, the first target frame is divided into blocks to obtain the pixel region of the first target frame;

[0105] For each pixel region, the texture intensity value of the pixel region is calculated based on the pixel information within the pixel region;

[0106] A first number of pixel regions with smaller texture intensity values ​​are selected as the watermark regions to be embedded; the first number is the same as the number of characters in the watermark information.

[0107] Optional, region definition unit, specifically used for:

[0108] If the scene type is a dynamic scene, then the pixel type of each pixel in the first target frame is determined based on the first target frame and the second target frame; the pixel type includes moving pixels and static pixels.

[0109] The first target frame is divided into blocks to obtain the pixel regions of the first target frame;

[0110] For each pixel region, the percentage of moving pixels within that pixel region is calculated.

[0111] Motion estimation processing is performed on the pixel region to obtain the horizontal motion vector and the vertical motion vector of the pixel region;

[0112] Calculate the motion intensity value of the pixel region based on the horizontal motion vector and the vertical motion vector;

[0113] Based on the percentage of moving pixels and the motion intensity value, a first number of pixel regions are selected as the watermark region to be embedded; the first number is the same as the number of characters in the watermark information.

[0114] Optionally, the embedding unit is specifically used for:

[0115] If the scene type is a static scene, then the primary intermediate frequency coefficient and the secondary intermediate frequency coefficient are determined from the frequency domain coefficient matrix; the frequency of the secondary intermediate frequency coefficient is greater than the frequency of the primary intermediate frequency coefficient; the frequency is represented by the sum of the matrix row index and the matrix column index;

[0116] Based on the embedding weights of the watermark embedding strength coefficient and the primary intermediate frequency coefficient, the watermark information is fused with the primary intermediate frequency coefficient, and based on the embedding weights of the watermark embedding strength coefficient and the secondary intermediate frequency coefficient, the watermark information is fused with the secondary intermediate frequency coefficient to obtain the watermark embedding matrix.

[0117] Optionally, the embedding unit is specifically used for:

[0118] If the scene type is a dynamic scene, then the main intermediate frequency coefficients are determined from the frequency domain coefficient matrix;

[0119] Based on the watermark embedding strength coefficient, the watermark information is fused with the main intermediate frequency coefficient to obtain the watermark embedding matrix.

[0120] Optionally, the device further includes:

[0121] The identifier acquisition unit is used to acquire the user's identity identifier, requesting device identifier, and time identifier in response to a video access request initiated by the user.

[0122] The splicing unit is used to splice the identity identifier, the requesting device identifier, the time identifier, and the locally configured key to obtain a spliced ​​string;

[0123] A hash operation unit is used to perform a hash operation on the concatenated string to obtain the hash value corresponding to the concatenated string;

[0124] A conversion unit is used to convert the hash value into a binary string, which is used as the watermark information to be embedded.

[0125] The video watermark embedding device provided in the embodiments of the present invention can execute the video watermark embedding method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the video watermark embedding method.

[0126] Example 4

[0127] Figure 4 A schematic diagram of a video watermarking embedding device 410, which can be used to implement embodiments of the present invention, is shown. The video watermarking embedding device is intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The video watermarking embedding device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0128] like Figure 4 As shown, the video watermark embedding device 410 includes at least one processor 411 and a memory, such as a read-only memory (ROM) 412 or a random access memory (RAM) 413, communicatively connected to the at least one processor 411. The memory stores computer programs executable by the at least one processor. The processor 411 can perform various appropriate actions and processes based on the computer program stored in the ROM 412 or loaded from storage unit 418 into the RAM 413. The RAM 413 may also store various programs and data required for the operation of the video watermark embedding device 410. The processor 411, ROM 412, and RAM 413 are interconnected via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0129] Multiple components in the video watermark embedding device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, optical disk, etc.; and a communication unit 419, such as a network card, modem, wireless transceiver, etc. The communication unit 419 allows the video watermark embedding device 410 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0130] Processor 411 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 411 performs the various methods and processes described above, such as video watermark embedding methods.

[0131] In some embodiments, the video watermarking embedding method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed onto the video watermarking embedding device 410 via ROM 412 and / or communication unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the video watermarking embedding method described above may be performed. Alternatively, in other embodiments, processor 411 may be configured to perform the video watermarking embedding method by any other suitable means (e.g., by means of firmware).

[0132] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0133] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable video watermarking embedding device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0134] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0135] To provide user interaction, the systems and techniques described herein can be implemented on a video watermarking embedding device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the video watermarking embedding device. Other types of devices can also be used to provide user interaction; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0136] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0137] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability.

[0138] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0139] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method of watermark embedding for a video, characterized by, The method comprises: acquiring a target video and watermark information to be embedded; extracting a plurality of key frames from the target video as target frames respectively; determining a scene type of a first target frame according to pixel information of the first target frame and pixel information of a second target frame; the scene type comprises a static scene and a dynamic scene; the second target frame is a previous target frame of the first target frame; embedding the watermark information into the first target frame according to the scene type.

2. The method of claim 1, wherein, The embedding of the watermark information into the first target frame according to the scene type comprises: inquiring a watermark embedding intensity coefficient of the first target frame according to the scene type; the watermark embedding intensity coefficient of the static scene is greater than that of the dynamic scene; determining a watermark embedding region from the first target frame according to the scene type; performing frequency domain transformation on the watermark embedding region to obtain a frequency domain coefficient matrix of the watermark embedding region; embedding the watermark information into the frequency domain coefficient matrix according to the scene type and the watermark embedding intensity coefficient to obtain a watermark embedding matrix; performing inverse frequency domain transformation on the watermark embedding matrix to obtain the first target frame with the embedded watermark information.

3. The method of claim 2, wherein, The determination of the watermark embedding region from the first target frame according to the scene type comprises: if the scene type is the static scene, performing block processing on the first target frame to obtain pixel regions of the first target frame; calculating a texture intensity value of each pixel region according to pixel information in the pixel region; selecting a first number of pixel regions with smaller texture intensity values as the watermark embedding region; the first number is the same as a character number in the watermark information.

4. The method of claim 2, wherein, The determination of the watermark embedding region from the first target frame according to the scene type comprises: if the scene type is the dynamic scene, determining pixel types of pixels in the first target frame according to the first target frame and the second target frame; the pixel types comprise moving pixels and static pixels; performing block processing on the first target frame to obtain pixel regions of the first target frame; calculating a moving pixel proportion in each pixel region; performing motion estimation processing on the pixel region to obtain a horizontal motion vector and a vertical motion vector of the pixel region; calculating a motion intensity value of the pixel region according to the horizontal motion vector and the vertical motion vector; selecting a first number of pixel regions as the watermark embedding region according to the moving pixel proportion and the motion intensity value; the first number is the same as a character number in the watermark information.

5. The method of claim 2, wherein, The embedding of the watermark information into the frequency domain coefficient matrix according to the scene type and the watermark embedding intensity coefficient to obtain the watermark embedding matrix comprises: if the scene type is the static scene, determining a main intermediate frequency coefficient and a secondary intermediate frequency coefficient from the frequency domain coefficient matrix; a frequency of the secondary intermediate frequency coefficient is greater than that of the main intermediate frequency coefficient; the frequency is represented by a sum of a matrix row index and a matrix column index. According to the embedding weight of the watermark embedding intensity coefficient and the main intermediate frequency coefficient, the watermark information is fused with the main intermediate frequency coefficient, and according to the embedding weight of the watermark embedding intensity coefficient and the secondary intermediate frequency coefficient, the watermark information is fused with the secondary intermediate frequency coefficient, to obtain a watermark embedding matrix.

6. The method of claim 2, wherein, The embedding of the watermark information into the frequency domain coefficient matrix according to the scene type and the watermark embedding intensity coefficient to obtain the watermark embedding matrix comprises: If the scene type is a dynamic scene, a main intermediate frequency coefficient is determined from the frequency domain coefficient matrix; According to the watermark embedding intensity coefficient, the watermark information is fused with the main intermediate frequency coefficient to obtain a watermark embedding matrix.

7. The method of claim 1, wherein, Before the target video and the watermark information to be embedded are acquired, the method further comprises: In response to a video browsing request initiated by a user, an identity of the user, a request device identifier and a time identifier are acquired; The identity, the request device identifier, the time identifier and a locally configured key are spliced to obtain a spliced string; A hash operation is performed on the spliced string to obtain a hash value corresponding to the spliced string; The hash value is converted into a binary string as the watermark information to be embedded.

8. An apparatus for watermark embedding of a video, characterized by The apparatus comprises: An acquisition module is configured to acquire a target video and watermark information to be embedded; An extraction module is configured to extract a plurality of key frames from the target video as target frames respectively; A determination module is configured to determine a scene type of a first target frame according to pixel information of the first target frame and pixel information of a second target frame; the scene type comprises a static scene and a dynamic scene; the second target frame is a previous target frame of the first target frame; An embedding module is configured to embed watermark information into the first target frame according to the scene type.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to cause the processor to implement the watermark embedding method of the video according to any one of claims 1-6 when executed.

10. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is used to implement the watermark embedding method of the video according to any one of claims 1-6 when executed by the processor. The computer program product comprises a computer program, and the computer program is used to implement the watermark embedding method of the video according to any one of claims 1-6 when executed by the processor.