A Digital Watermarking Video Stream Verification and Protection System and Method Based on DCT Domain
By embedding complex watermark information within the DCT domain and dynamically adjusting the watermark strength, the problem of insufficient robustness and security of digital watermarks in video streams is solved, and the effectiveness of video source tracing and copyright protection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNICOM (BEIJING) IND INTERNET CO LTD
- Filing Date
- 2025-09-02
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, digital watermarks lack robustness and security in video streams, making them vulnerable to video editing and compression operations. This results in watermark information being easily lost or tampered with, affecting the effectiveness of video traceability and copyright protection.
A digital watermarking video stream verification and protection system based on the DCT domain is adopted. By adding watermark information in the DCT domain, using two-level DCT transformation and repeated watermark data, more complex and secure watermark data is embedded. By dynamically adjusting the watermark strength k, the concealment and tamper resistance of the watermark information are ensured.
It improves the robustness and security of watermarks, ensuring that watermark information is not easily damaged or tampered with in the video stream, enabling more accurate video source tracing and copyright protection, and effectively resisting video editing and compression operations.
Smart Images

Figure CN121037576B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of watermarked video streams, and specifically to a digital watermarked video stream verification and protection system and method based on the DCT domain. Background Technology
[0002] The Discrete Cosine Transform (DCT) expands a function into a real even function, then discretizes it again, resulting in the Discrete Cosine Transform (DCT). It's a special case of the Fourier Transform, widely used in image processing. After passing through the DCT, the signal is transformed from the spatial domain to the frequency domain. It's an orthogonal transformation method. Like the Fourier Transform, there are two types: forward and inverse. Forward DCT: transforms from the spatial domain to the frequency domain. Inverse DCT: transforms from the frequency domain to the spatial domain. In DCT-based transform coding, the image is first divided into blocks (8×8 or 16×16) before undergoing DCT. This transformation is local, reflecting only a portion of the image's information. While it can also be applied to the entire image, the computation speed is slower than block-based DCT. The resulting DCT image has three characteristics: first, all coefficient values are concentrated near 0 (in terms of histogram statistics), indicating a very small dynamic range. This means that a smaller number of quantization bits is needed to represent the DCT coefficients. Second, after DCT transformation, the image energy is concentrated in the low-frequency part of the image, meaning that most of the non-zero coefficients in the DCT image are concentrated in one area (the upper left corner), resulting in high coding efficiency. Third, it does not retain the fine structure of the original image blocks, failing to reflect information such as edges and contours. This characteristic is caused by the lack of temporal locality in DCT; after DCT transformation, most parameters are close to zero, with only the low-frequency part in the upper left corner having relatively large values, the mid-frequency parameter values being relatively small, and most high-frequency parameter values being very small, close to zero.
[0003] In the field of digital media protection and traceability, watermarking technology is widely used for copyright protection and tracing the source of videos. Reference patent CN112468715A discloses a video tracing system and method. This method embeds the camera ID as a watermark into video frames to achieve video source tracing. However, this method may lose or destroy the watermark information when the video is maliciously edited or modified, thus affecting the effectiveness of video tracing. Another reference patent CN110099239A provides a video tagging method that overlays watermark data onto the most valuable video segment, thus avoiding the problem of watermark loss due to video cropping. However, this method does not fully consider the robustness and security of watermarks in the video stream, especially after the video undergoes multiple format conversions or compression processes, the integrity of the watermark may not be effectively guaranteed.
[0004] To address the aforementioned issues, a digital watermarking video stream verification and protection system based on the DCT domain is proposed. This system aims to improve the robustness and security of the watermark, ensuring that the watermark information is not easily damaged or tampered with in the video stream. It can also effectively resist video editing, compression, and other operations, enabling more accurate video source tracing and copyright protection. Summary of the Invention
[0005] The technical problem this invention aims to solve is how to improve the robustness and security of watermarks, ensuring that watermark information is not easily damaged or tampered with in video streams, while effectively resisting video editing, compression, and other operations, and achieving more accurate video source tracing and copyright protection. The purpose is to provide a digital watermark video stream verification and protection system and method based on the DCT domain. By adding watermark information in the DCT domain, not only can more complex and secure watermark data be embedded in the video stream, but the concealment and tamper resistance of the watermark information can also be ensured, thereby maintaining the integrity and validity of the watermark information during video transmission, storage, and playback.
[0006] This invention is achieved through the following technical solution:
[0007] A digital watermarking video stream verification and protection system based on the DCT domain includes: a watermarking layer, specifically comprising: a video file image frame and audio extraction module, which decodes the original video file to obtain image frame data and audio data; a watermark information encryption module, which performs symmetric encryption on the original watermark information to obtain encrypted watermark data, and verifies the encrypted watermark data to obtain verified watermark data; dividing each extracted image frame data into an 8*8 block matrix on the Y component; repeating the encrypted watermark data and the verified watermark data to obtain 32400 bits of watermark data for each frame's block matrix; adding 1 bit of the watermark data to each block of the block matrix in each frame; and a video frame DCT first-level transformation module, which performs two-dimensional 8*8 transformation on the block matrix of each frame. The DCT transformation of 8*8 is used to obtain the first-level DCT transformation data. The second-level DCT transformation module of the video frame takes the 4*4 data from the upper left corner of each 8*8 coefficient matrix and performs a two-dimensional 4*4 DCT transformation to obtain the second-level DCT transformation data. The watermark encryption information addition module takes the coefficient data from the upper right and lower left corners of the above second-level DCT transformation data and modifies the above coefficient data according to the watermark data to be embedded. Specifically, in the above second-level DCT transformation data, according to the energy of each coefficient in the matrix, the four non-DC coefficients with the energy in the middle are selected as the embedding positions of the watermark data. The four non-DC coefficients are represented as d14, d41, d13, and d31 respectively. The embedded watermark strength is represented as k. When the watermark is 1: d14 = (d14 + d41) / 2 + k. ;d13=d13+k / 2; The video frame DCT second-level inverse transform module replaces the modified coefficient data in the original position of the second-level DCT transform data and performs a 2D 4*4 DCT inverse transform to obtain the second-level DCT inverse transform data. The video frame DCT first-level inverse transform module replaces the second-level DCT inverse transform data in the upper right corner of the first-level DCT transform data and performs a 2D 8*8 DCT inverse transform to obtain the first-level DCT inverse transform data. After rounding, the first-level DCT transform data is replaced. The video frame and audio synthesis video file module sequentially adds the corresponding watermark data to the replaced first-level DCT transform data of each frame to obtain the image frame encrypted data. The image frame encrypted data and the audio data are then re-encoded and synthesized to obtain the watermarked video file.
[0008] The aforementioned digital watermarking video stream verification and protection system based on the DCT domain further includes a watermark detection layer, specifically comprising: a signal stream image frame extraction module, which extracts image frame data from the watermarked video file; converts the pixel resolution of the image frame data to 1920*1080; divides each frame of the image frame data into 8*8 small pixel matrices on the Y component; wherein each frame's small pixel matrix contains 32400 bits of watermark data; and an image frame DCT first-level transformation module, which performs a two-dimensional 8*8 DCT transformation on the 8*8 small pixel matrix of each frame to obtain a first-level DCT system. The image frame DCT secondary transformation module takes the 4*4 data from the top left corner of the first-level DCT coefficient matrix and performs a 2D 4*4 DCT transformation to obtain the second-level DCT coefficient matrix. The watermark information extraction module takes the data from the top right and bottom left corners of the second-level DCT coefficient matrix. If the data from the top right corner is greater than the data from the bottom left corner, the extracted watermark information is 1; otherwise, the extracted watermark information is 0. After the watermark information for each frame is extracted, it is grouped into 225 groups of 144 bits each. The number of times each bit in each group of watermark information is 1 is counted, and then divided by... With a total of 255 groups, the probability value of each bit in each group of watermark information being 1 is obtained. The average of the 144 probability values in each group is calculated. These 144 probability values are iterated over; if any value is greater than the average, it represents a 1; otherwise, it is 0, resulting in 144 bits of watermark extraction information. Verification data of the corresponding length is obtained from the extracted watermark information. The verification data from each group of watermark information is compared; if they are equal, the watermark extraction is successful; otherwise, the extraction fails. The watermark decryption module decrypts the watermark information if extraction is successful, obtaining the original watermark information. Watermark information; Watermark information extraction error statistics module, repeatedly extracts the above successfully extracted watermark information, and reconstructs the 32400-bit watermark data of the above small block matrix for each frame; compares the reconstructed watermark data of each group of the above watermark information, if they are equal, it is recorded as 0, and if they are not equal, it is recorded as 1, and constructs a data matrix to determine whether the extraction of each block of watermark information is correct; Image frame anti-tampering verification module, compares the number of 1s in each data in the above data matrix of each group of watermark information according to the variance and mean of the number of 1s in each data in the above data matrix of each group of watermark information, so as to determine whether the corresponding watermarked image frame has been tampered with.
[0009] The aforementioned DCT-based digital watermarking video stream verification and protection system further includes a server platform, specifically comprising: a video file upload module for receiving the original video file uploaded by the user; a watermarking layer calling module for sending the original video file and original watermark information to the video file image frame and audio extraction module; a watermarked video file distribution module for distributing the watermarked video file synthesized by the video frame and audio synthesis video file module to the user; a watermark detection communication module for receiving the original watermark information extracted by the watermark detection layer and the result of whether each frame of the watermarked image has been tampered with; and an abnormal video image detection alarm module for receiving the original watermark information extracted by the watermark detection layer and the result of whether each frame of the watermarked image has been tampered with, and issuing an early warning when tampering occurs.
[0010] The aforementioned watermark detection layer also includes: a platform real-time communication module, which communicates in real time with the aforementioned watermark detection communication module to send the original watermark information extracted by the aforementioned watermark detection layer, as well as the result of whether each frame of the image with the added watermark has been tampered with, to the aforementioned server platform.
[0011] The aforementioned digital watermarking video stream verification and protection system based on the DCT domain further includes: a public screen for receiving and displaying the watermarked video file sent by the video frame and audio-to-video file synthesis module; and sending the watermarked video file to the signal stream image frame extraction module.
[0012] The aforementioned watermark detection layer also includes: enabling or disabling the public screen signal stream display module; if watermark information extraction fails or each frame of image is detected to be tampered with, then cutting off the aforementioned video frame and audio-to-video file synthesis module and sending the watermark video file to the aforementioned public screen.
[0013] The aforementioned server platform also includes a video file review module, which manually reviews the original video files uploaded by users and sends the manually approved original video files to the watermark addition layer calling module.
[0014] The aforementioned digital watermarking video stream verification and protection system based on the DCT domain further includes: dynamically adjusting the intensity of the watermark according to the gradient magnitude change of the first-level DCT transform data of each frame.
[0015] The above-mentioned dynamic adjustment of the watermark intensity based on the gradient magnitude change of the first-level DCT transform data in each frame is expressed as follows:
[0016] ;
[0017] G represents the average gradient change magnitude; Gmin represents the minimum gradient change magnitude; and Gmax represents the maximum gradient change magnitude.
[0018] A digital watermarking video stream verification and protection method based on the DCT domain includes: decoding the original video file to obtain image frame data and audio data; symmetrically encrypting the original watermark information to obtain encrypted watermark data; verifying the encrypted watermark data to obtain verified watermark data; dividing each extracted image frame data into an 8*8 block matrix on the Y component; repeating the encrypted watermark data and the verified watermark data to obtain 32400 bits of watermark data for each frame's block matrix; adding 1 bit of the watermark data to each block of the block matrix in each frame; and performing a two-dimensional 8*8 DCT transformation on the block matrix in each frame to obtain a first-order... DCT transform data; take the 4*4 data from the top left corner of each 8*8 coefficient matrix, perform a two-dimensional 4*4 DCT transform to obtain the second-level DCT transform data; take the coefficient data from the top right and bottom left corners of the above second-level DCT transform data, and modify the above coefficient data according to the watermark data to be embedded, specifically including: in the above second-level DCT transform data, according to the energy of each coefficient in the matrix; select the four non-DC coefficients with energy in the middle as the embedding position of the watermark data; the four above non-DC coefficients are represented as d14, d41, d13, and d31 respectively; the embedded watermark intensity is represented as k; when the watermark is 1: d14=(d14+d41) / 2+k; ;d13=d13+k / 2; The modified coefficient data is then replaced in its original position with the secondary DCT transform data, and a 2D 4*4 DCT inverse transform is performed to obtain the secondary DCT inverse transform data. The secondary DCT inverse transform data is then replaced in the upper right corner of the primary DCT transform data, and a 2D 8*8 DCT inverse transform is performed to obtain the primary DCT inverse transform data. This primary DCT transform data is then replaced after rounding. The corresponding watermark data is added sequentially to each frame of the replaced primary DCT transform data to obtain the image frame encryption data. Finally, the image frame encryption data and the audio data are re-encoded and synthesized to obtain the watermarked video file.
[0019] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0020] This invention provides a digital watermarking video stream verification and protection system based on the DCT domain. The system uses a video file image frame and audio extraction module to decode the original video file, obtaining image frame data and audio data. A watermark information encryption module performs symmetric encryption on the original watermark information to obtain encrypted watermark data, and verifies the encrypted watermark data to obtain verified watermark data. Each extracted image frame data is divided into an 8*8 block matrix on the Y component. The encrypted watermark data and verified watermark data are repeated to obtain 32400 bits of watermark data for each frame's block matrix. One bit of watermark data is added to each block of each frame's block matrix. A video frame DCT first-level transformation module performs a two-dimensional 8*8 DCT transformation on each frame's block matrix to obtain first-level DCT transformation data. A video frame DCT second-level transformation module takes the 4*4 data from the top left corner of each 8*8 coefficient matrix and performs a two-dimensional 4*... A 4x4 DCT transform is performed to obtain secondary DCT transform data. The watermark encryption information adding module takes the coefficients from the upper right and lower left corners of the 4x4 secondary DCT transform data and modifies them according to the watermark data to be embedded. The video frame DCT secondary inverse transform module replaces the modified coefficients in their original positions with the secondary DCT transform data, then performs a 2D 4x4 DCT inverse transform to obtain secondary DCT inverse transform data. The video frame DCT primary inverse transform module replaces the inverse transform data in the upper right corner of the primary DCT transform data, performs a 2D 8x8 DCT inverse transform, rounds it, and replaces the primary DCT transform data. The video frame and audio file synthesis module sequentially adds the corresponding watermark data to the replaced primary DCT transform data in each frame to obtain image frame encryption data. The image frame encryption data and the aforementioned audio data are then re-encoded and synthesized to obtain the watermarked video file. This invention adds watermark encryption information to the DCT second-order transform coefficients of an image, which not only embeds more complex and secure watermark data into the video stream, but also ensures the concealment and tamper resistance of the watermark information. This maintains the integrity and effectiveness of the watermark information during video transmission, storage, and playback, improving the robustness and security of the watermark and ensuring that the watermark information is not easily damaged or tampered with in the video stream, thus achieving more accurate video source tracing and copyright protection.Compared to the existing patent CN112468715A, which embeds the camera ID as a watermark into the video frame, this system achieves redundant watermark storage through "two-level DCT transformation + repeated watermark data," which can restore the complete watermark even if there is partial tampering, thus solving the problem of watermark loss. Compared to the existing patent CN110099239A, which overlays watermark data onto the most valuable video segment, this application also modifies the coefficient data according to the watermark data to be embedded, which can achieve better robustness, security, and watermark invisibility. Through "dynamically adjusting the watermark intensity k" (based on gradient amplitude) and "four-coefficient embedding (d14, d41, d13, d31)," the digital watermark's resistance to damage from video compression and editing is further enhanced. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0022] Figure 1 This is a schematic diagram of a digital watermarking video stream verification and protection system based on the DCT domain, as described in this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are only for explaining this invention and are not intended to limit this invention.
[0024] Example
[0025] like Figure 1As shown, this application embodiment provides a digital watermarking video stream verification and protection system based on the DCT domain, including: a watermarking layer, specifically including: a video file image frame and audio extraction module, which decodes the original video file to obtain image frame data and audio data; a watermark information encryption module, which performs symmetric encryption on the original watermark information to obtain watermark encrypted data, and verifies the watermark encrypted data to obtain watermark verification data; dividing each extracted image frame data into an 8*8 block matrix on the Y component; repeating the watermark encrypted data and the watermark verification data to obtain 32400 bits of watermark data for each frame's block matrix; adding 1 bit of the watermark data to each block of each frame's block matrix; a video frame DCT first-level transformation module, which performs a two-dimensional 8*8 DCT transformation on each frame's block matrix to obtain first-level DCT transformation data; and a video frame DCT second-level transformation module, which takes the 4*4 data from the upper left corner of each 8*8 coefficient matrix and performs a two-dimensional 4*4 transformation. The DCT transformation process yields secondary DCT transformation data. A watermark encryption information addition module takes the coefficients from the upper right and lower left corners of the 4x4 secondary DCT transformation data and modifies them according to the watermark data to be embedded. A video frame DCT secondary inverse transformation module replaces the modified coefficients in their original positions with the secondary DCT transformation data and performs a 2D 4x4 DCT inverse transformation to obtain secondary DCT inverse transformation data. A video frame DCT primary inverse transformation module replaces the secondary DCT inverse transformation data with the upper right corner of the primary DCT transformation data and performs a 2D 8x8 DCT inverse transformation to obtain primary DCT inverse transformation data, rounds it, and then replaces the primary DCT transformation data. A video frame and audio synthesis video file module sequentially adds the corresponding watermark data to the replaced primary DCT transformation data in each frame to obtain image frame encryption data. The image frame encryption data and the audio data are then re-encoded and synthesized to obtain a watermarked video file.
[0026] The above-mentioned coefficient data is modified according to the watermark data to be embedded, specifically including: the upper right corner of the above-mentioned second-level DCT transform data is represented as d14, and the lower left corner data is represented as d41; the embedded watermark intensity is represented as k; if the watermark data is 0, then d14 = (d14 + d41) / 2 - k; d41 = (d14 + d41) / 2 + k; if the watermark data is 1, then d14 = (d14 + d41) / 2 + k; d41 = (d14 + d41) / 2 - k.
[0027] The aforementioned digital watermarking video stream verification and protection system based on the DCT domain further includes a watermark detection layer, specifically comprising: a signal stream image frame extraction module, which extracts image frame data from the watermarked video file; converts the pixel resolution of the image frame data to 1920*1080; divides each frame of the image frame data into 8*8 small pixel matrices on the Y component; wherein each frame's small pixel matrix contains 32400 bits of watermark data; and an image frame DCT first-level transformation module, which performs a two-dimensional 8*8 DCT transformation on the 8*8 small pixel matrix of each frame to obtain a first-level DCT system. The image frame DCT secondary transformation module takes the 4*4 data from the top left corner of the first-level DCT coefficient matrix and performs a 2D 4*4 DCT transformation to obtain the second-level DCT coefficient matrix. The watermark information extraction module takes the data from the top right and bottom left corners of the second-level DCT coefficient matrix. If the data from the top right corner is greater than the data from the bottom left corner, the extracted watermark information is 1; otherwise, the extracted watermark information is 0. After the watermark information for each frame is extracted, it is grouped into 225 groups of 144 bits each. The number of times each bit in each group of watermark information is 1 is counted, and then divided by... With a total of 255 groups, the probability value of each bit in each group of watermark information being 1 is obtained. The average of the 144 probability values in each group is calculated. These 144 probability values are iterated over; if any value is greater than the average, it represents a 1; otherwise, it is 0, resulting in 144 bits of watermark extraction information. Verification data of the corresponding length is obtained from the extracted watermark information. The verification data from each group of watermark information is compared; if they are equal, the watermark extraction is successful; otherwise, the extraction fails. The watermark decryption module decrypts the watermark information if extraction is successful, obtaining the original watermark information. Watermark information; Watermark information extraction error statistics module, repeatedly extracts the above successfully extracted watermark information, and reconstructs the 32400-bit watermark data of the above small block matrix for each frame; compares the reconstructed watermark data of each group of the above watermark information, if they are equal, it is recorded as 0, and if they are not equal, it is recorded as 1, and constructs a data matrix to determine whether the extraction of each block of watermark information is correct; Image frame anti-tampering verification module, compares the number of 1s in each data in the above data matrix of each group of watermark information according to the variance and mean of the number of 1s in each data in the above data matrix of each group of watermark information, so as to determine whether the corresponding watermarked image frame has been tampered with.
[0028] The aforementioned DCT-based digital watermarking video stream verification and protection system further includes a server platform, specifically comprising: a video file upload module for receiving the original video file uploaded by the user; a watermarking layer calling module for sending the original video file and original watermark information to the video file image frame and audio extraction module; a watermarked video file distribution module for distributing the watermarked video file synthesized by the video frame and audio synthesis video file module to the user; a watermark detection communication module for receiving the original watermark information extracted by the watermark detection layer and the result of whether each frame of the watermarked image has been tampered with; and an abnormal video image detection alarm module for receiving the original watermark information extracted by the watermark detection layer and the result of whether each frame of the watermarked image has been tampered with, and issuing an early warning when tampering occurs.
[0029] The aforementioned watermark detection layer also includes: a platform real-time communication module, which communicates in real time with the aforementioned watermark detection communication module to send the original watermark information extracted by the aforementioned watermark detection layer, as well as the result of whether each frame of the image with the added watermark has been tampered with, to the aforementioned server platform.
[0030] The aforementioned DCT-based digital watermarking video stream verification and protection system further includes: a public screen that receives and displays the watermarked video file sent by the video frame and audio-to-video file synthesis module; and a system that sends the watermarked video file to the signal stream image frame extraction module. Optionally, the platform's real-time communication module can also send the watermarked video file played on the public screen to the signal stream image frame extraction module. Optionally, the watermark detection layer also includes an anomaly handling module; when the video signal stream of the public screen is interrupted, the watermark detection layer will buffer undetected frames and re-verify them after the signal stream is restored.
[0031] The aforementioned watermark detection layer also includes: enabling or disabling the public screen signal stream display module; if watermark information extraction fails or each frame of image is detected to be tampered with, then cutting off the aforementioned video frame and audio-to-video file synthesis module and sending the watermark video file to the aforementioned public screen.
[0032] The aforementioned server platform also includes a video file review module, which manually reviews the original video files uploaded by users and sends the manually approved original video files to the watermark addition layer calling module.
[0033] The aforementioned digital watermarking video stream verification and protection system based on the DCT domain further includes: dynamically adjusting the intensity of the watermark according to the gradient magnitude change of the first-level DCT transform data of each frame.
[0034] The adaptive mechanism for watermark intensity k can be based on a two-dimensional adjustment of block complexity and frequency domain energy. For example, the mean gradient change magnitude G of each 8×8 image block in a frame can be calculated to dynamically map the value of k.
[0035] ;
[0036] Gmin is the minimum gradient change magnitude of the image patch; Gmax is the maximum gradient change magnitude of the image patch. For complex textured patches (such as edge regions), the k value is automatically increased (maximum 5), while for smooth patches, the k value is decreased (minimum 1), balancing invisibility and robustness. Optionally, the coefficient modification amount is adjusted after rounding the k value to ensure that the pixel value after the inverse transformation is within the range [0, 255].
[0037] The above modification of the coefficient data based on the watermark data to be embedded specifically includes: in the above two-level DCT transform data, based on the energy of each coefficient in the matrix; selecting the four non-DC coefficients with the middle energy as the embedding positions of the watermark data; the four non-DC coefficients are respectively represented as d14, d41, d13, and d31; the embedded watermark intensity is represented as k; when the watermark is 1: d14 = (d14 + d41) / 2 + k; ;d13=d13+k / 2; .
[0038] In the 4×4 DCT coefficient matrix, the energy of each coefficient is calculated and expressed as follows:
[0039] ;
[0040] By selecting four non-DC coefficients in the middle of the energy matrix as embedding locations, the high-frequency vulnerable and low-frequency distortion-prone regions are effectively avoided. This ensures the energy conservation of the coefficient matrix, resists attacks such as median filtering and geometric distortion, and maintains the visual quality of the image, achieving an optimal balance between robustness and invisibility.
[0041] Users upload unwatermarked original video files to the server platform. The video file review module manually identifies and reviews the content to ensure its legality. The server platform sends the approved original video file, along with the watermark information to be added, to the watermarking layer through its interface. The watermark information can be directly uploaded by the user, obtained from uploaded user information, or preset by the platform. After adding the watermark, the watermarking layer returns the watermarked video file to the platform via a video frame and audio synthesis module. The platform then distributes the watermarked video file to the user. The user can then play the watermarked video file freely. The watermark detection layer checks for image frame tampering. The platform receives information from the watermark detection layer in real time. Upon receiving a watermark detection failure or information indicating image tampering, the platform sends an alert to the user to facilitate further processing.
[0042] Optionally, the video file image frame and audio extraction module for the watermarking layer includes a video frame extraction module and a YUV format Y component segmentation module; it can handle images of different resolutions, including but not limited to 1920×1080 (1K), 3840×2160 (2K), 7680×4320 (4K), and 15360×8640 (8K); the watermark data length is proportional to the square of the image resolution, for example, 1K resolution corresponds to 32400 bits, 2K corresponds to 129600 bits (32400×4), 4K corresponds to 518400 bits (32400×16), and 8K corresponds to 2073600 bits (32400×64), and the watermark embedding / detection algorithm remains unchanged.
[0043] After receiving the original video file and original watermark information from the platform, the video frame extraction module for watermark addition receives the original video file and watermark information. It then decodes the video file using the YUV format Y component block module to obtain YUV format image frame data and audio data. The initial image frame pixel resolution is tentatively set at 1920*1080. This resolution can be transformed using a specific algorithm. The watermark information length is tentatively set at 128 bits (binary). The watermark information is symmetrically encrypted using the SM4 national cryptographic standard, resulting in an encrypted information length of 128 bits. CRC verification is then performed on the encrypted information to obtain watermark verification data, which is 16 bits long. The encrypted watermark data and watermark verification data are combined, totaling 128 + 16 = 144 bits. This 144-bit data is then copied 225 times to obtain the final watermark data to be added, totaling 144 * 225 = 32400 bits of binary data.
[0044] Each extracted frame of video YUV image data is divided into 8*8 blocks on the Y component. A 1920*1080 image has 1920*1080 pixels in the Y component, which can be divided into 1920*1080 / 8 / 8 = 32400 blocks. One bit of watermark data can then be added to each block sequentially. A two-dimensional 8*8 DCT transform is performed on each 8*8 block matrix of each frame to obtain an 8*8 DCT coefficient matrix, which is the first-level DCT transform data. Then, the top-left 4*4 data of this 8*8 coefficient matrix is taken and subjected to a two-dimensional 4*4 DCT transform to obtain a 4*4 DCT coefficient matrix, which is the second-level DCT transform data. The top-right and bottom-left data of this 4*4 DCT coefficient matrix are taken and denoted as d14 and d41, respectively. These two values are modified according to the watermark data to be embedded. Optionally, the modification method is as follows: The watermark strength to be embedded is k. If the watermark data is 1, then the value of d14 is modified to (d14+d41) / 2+k, and d41 is (d14+d41) / 2-k; if the watermark data is 0, then the value of d14 is modified to (d14+d41) / 2-k, and d41 is (d14+d41) / 2+k. The modified coefficient data is placed in its original position, and a 2D 4*4 DCT inverse transform is performed to obtain 4*4 inverse transform data, which is the second-level DCT inverse transform data. This data is then placed in the upper right corner of the original first-level DCT transform data, and a 2D 8*8 DCT inverse transform is performed to obtain 8*8 matrix data, which is the first-level DCT inverse transform data. Finally, the data is rounded down. If the value is greater than 255, it is set to 255; otherwise, it is set to 0, replacing the original 8*8 small block of data. The video frame DCT second-level inverse transform module and the video frame DCT first-level inverse transform module correspond to the order of the DCT transform. After adding watermark data to the 32,400 small data blocks of the Y component in each frame, the watermarked YUV data for each frame is saved (U and V components remain unchanged). The watermarked image frame data and the extracted audio data are then used to re-encode and synthesize the watermarked video file, which is then returned to the platform.
[0045] The public screen is a separately configured display device, which can also be displayed through both user terminals and servers. The watermark detection layer extracts the YUV format data of image frames from the signal stream displayed on the public screen. The extracted image pixel resolution is tentatively converted to 1920*1080. For each frame of image YUV data, the Y component is divided into 8*8 blocks, totaling 1920*1080 / 8 / 8 = 32400 blocks. One bit of watermark information can be extracted from each block, therefore 32400 bits of watermark information can be extracted from each frame. A two-dimensional 8*8 DCT transformation is performed on each 8*8 pixel data matrix of each frame to obtain an 8*8 first-level DCT coefficient matrix. Next, take the top-left 4x4 data from this 8x8 coefficient matrix and perform a 2D 4x4 DCT transform to obtain a 4x4 second-level DCT coefficient matrix. Take the top-right and bottom-left data from this 4x4 DCT coefficient matrix, denoted as d14 and d41. If d14 is less than or equal to d41, the extracted watermark information is 0; if d14 is greater than d41, the extracted watermark information is 1. After the watermark information of each frame is extracted, divide the 32400 bits of data into groups of 144 bits each, for a total of 32400 / 144 = 225 groups. Then count the number of times the data at each position in each group is 1, and divide by the total number of groups, 255, to obtain the probability of each position being 1 in each group, for a total of 144 probability values. The average of these 144 probability values is taken, and then these 144 probability values are iterated through. If any value is greater than the average, it represents a value of 1; otherwise, it is 0. This yields the encrypted and CRC-verified watermark extraction information, totaling 144 bits. CRC verification is performed on 128 bits of the watermark encryption information to obtain verification data. This verification data is then compared with the verification data extracted from each frame. If they are equal, the watermark extraction was successful; otherwise, it failed. If the watermark extraction was successful, the watermark information is decrypted using SM4 to obtain the original watermark information to be added. Based on the successfully extracted encrypted and CRC-verified watermark information (144 bits), it is copied 225 times to reconstruct the final original watermark data, totaling 32400 bits. This is then compared sequentially with each extracted watermark data block. If they are equal, it is recorded as 0; otherwise, it is recorded as 1, constructing a data matrix (E) indicating whether the watermark information extraction for each block is correct, totaling 32400 bits. The matrix E is divided into groups, and the number of data points with a value of 1 in each group is calculated. Then, the variance and mean of each group are calculated. Since the original watermarked image, when it is not tampered with, has watermark error data distribution that resembles a state of random noise, when the watermarked image is tampered with, the watermark error data distribution will be concentrated in a certain local area. Thus, the calculated variance and mean will increase. Based on this comparison, it is determined whether the watermarked image has been tampered with.If watermark extraction fails or image tampering is detected, the screen display signal output to the public screen is cut off. Conversely, if watermark extraction is successful and image tampering is detected, the public screen display signal is restored. The extracted original watermark information, along with information on whether the image has been tampered with, is transmitted to the platform in real time.
[0046] Optionally, when repeating the above watermark encryption data and watermark verification data to obtain 32400 bits of watermark data for each frame of the above small block matrix, error correction coding and grouping strategies can be combined for optimization. After SM4 encryption and CRC verification, a low-density parity-check code (LDPC) is added to the 144-bit data to improve the data recovery capability after transmission or tampering and avoid the overall watermark failure due to local errors. The specific process of LDPC error correction, for example, involves adding 32 check bits to the 144-bit watermark data to form a 176-bit code to improve anti-interference capability.
[0047] Optionally, a dynamic key can be used. Every 100 frames, the SM4 watermark encryption and decryption key is updated. The dynamic key can be generated using a pseudo-random number based on the frame sequence number to enhance security. For example, every 100 frames, a pseudo-random number (such as one based on SHA-256) is generated using the frame sequence number to update the SM4 key, avoiding key synchronization issues.
[0048] Optionally, the DCT second-order transformation of video frames and images can be accelerated by FPGA (such as Xilinx K7 series) hardware to meet the requirements of real-time video processing (30fps); the computational complexity of the dynamic watermark intensity adjustment algorithm can be adapted to the computing power limitations of embedded devices (such as edge gateways).
[0049] Experiments show that, under the same compression rate (such as H.265 50% compression) or editing attacks, the watermark extraction success rate of this system (95%) is significantly higher than that of the existing technology CN112468715A (60%). After adjusting the dynamic watermark strength, the video subjective quality score (PSNR) is improved by 3-5dB, taking into account both invisibility and robustness.
[0050] In summary, this application provides a digital watermarking video stream verification and protection system based on the DCT domain: The system uses a video file image frame and audio extraction module to decode the original video file, obtaining image frame data and audio data; a watermark information encryption module performs symmetric encryption on the original watermark information to obtain encrypted watermark data, and verifies the encrypted watermark data to obtain verified watermark data; each extracted image frame data is divided into an 8*8 block matrix on the Y component; the encrypted watermark data and verified watermark data are repeated to obtain 32400 bits of watermark data for each frame's block matrix; 1 bit of watermark data is added to each block of each frame's block matrix; a video frame DCT first-level transformation module performs a two-dimensional 8*8 DCT transformation on each frame's block matrix to obtain first-level DCT transformation data; and a video frame DCT second-level transformation module takes the 4*4 data from the upper left corner of each 8*8 coefficient matrix and performs a second... A 4x4 DCT transform is performed to obtain secondary DCT transform data. The watermark encryption information adding module takes the coefficients from the upper right and lower left corners of the 4x4 secondary DCT transform data and modifies them according to the watermark data to be embedded. The video frame DCT secondary inverse transform module replaces the modified coefficients in their original positions with the secondary DCT transform data, then performs a 4x4 DCT inverse transform to obtain secondary DCT inverse transform data. The video frame DCT primary inverse transform module replaces the inverse transform data in the upper right corner of the primary DCT transform data, performs a 8x8 DCT inverse transform, rounds it, and replaces the primary DCT transform data. The video frame and audio file synthesis module sequentially adds the corresponding watermark data to the replaced primary DCT transform data in each frame to obtain image frame encryption data. The image frame encryption data and the aforementioned audio data are then re-encoded and synthesized to obtain the watermarked video file. This invention adds watermark encryption information to the DCT second-order transform coefficients of an image, which not only embeds more complex and secure watermark data into the video stream, but also ensures the concealment and tamper resistance of the watermark information. This maintains the integrity and effectiveness of the watermark information during video transmission, storage, and playback, improving the robustness and security of the watermark and ensuring that the watermark information is not easily damaged or tampered with in the video stream, thus achieving more accurate video source tracing and copyright protection.
[0051] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A digital watermarking video stream verification and protection system based on the DCT domain, characterized in that, include: The watermark addition layer specifically includes: The video file image frame and audio extraction module decodes the original video file to obtain image frame data and audio data; The watermark information encryption module performs symmetric encryption on the original watermark information to obtain encrypted watermark data, and verifies the encrypted watermark data to obtain verified watermark data. Each extracted image frame data is divided into an 8*8 block matrix on the Y component. The encrypted watermark data and the verified watermark data are repeated to obtain 32400 bits of watermark data for each frame's block matrix. One bit of the watermark data is added to each block of the block matrix in each frame. The video frame DCT first-level transformation module performs a two-dimensional 8*8 DCT transformation on the small block matrix of each frame to obtain first-level DCT transformation data. The video frame DCT secondary transformation module takes the 4*4 data from the top left corner of each 8*8 coefficient matrix, performs a two-dimensional 4*4 DCT transformation, and obtains the secondary DCT transformation data. The watermark encryption information adding module takes the coefficient data from the upper right and lower left corners of the 4*4 secondary DCT transform data and modifies the coefficient data according to the watermark data to be embedded. Specifically, it includes: in the secondary DCT transform data, based on the energy of each coefficient in the matrix; selecting four non-DC coefficients with energy in the middle as the embedding positions of the watermark data; the four non-DC coefficients are represented as d14, d41, d13, and d31 respectively; the embedded watermark intensity is represented as k; the watermark intensity is dynamically adjusted according to the gradient magnitude change of the primary DCT transform data of each frame, and the adaptive mechanism of the watermark intensity is based on the dual-dimensional adjustment of block complexity and frequency domain energy; d14=(d14+d41) / 2+k; ;d13=d13+k / 2; d31=d31-k / 2; The video frame DCT second-level inverse transform module replaces the modified coefficient data in the original position of the second-level DCT transform data and performs a two-dimensional 4*4 DCT inverse transform to obtain the second-level DCT inverse transform data. The video frame DCT first-level inverse transform module replaces the second-level DCT inverse transform data with the upper right corner of the first-level DCT transform data, performs a two-dimensional 8*8 DCT inverse transform to obtain the first-level DCT inverse transform data, and then replaces the first-level DCT transform data after rounding. The video frame and audio synthesis video file module sequentially adds the corresponding watermark data to the first-level DCT transform data after each frame is replaced to obtain image frame encrypted data; the image frame encrypted data and the audio data are then re-encoded and synthesized to obtain a watermarked video file.
2. The digital watermarking video stream verification and protection system based on the DCT domain according to claim 1, characterized in that, It also includes a watermark detection layer, specifically including: The signal stream image frame extraction module extracts image frame data from the watermarked video file; converts the pixel resolution of the image frame data to 1920*1080; divides each frame of the image frame data into an 8*8 small pixel matrix on the Y component; wherein, each frame's small pixel matrix contains 32400 bits of watermark data. The image frame DCT first-level transformation module performs a two-dimensional 8*8 DCT transformation on the 8*8 small pixel block matrix of each frame to obtain a first-level DCT coefficient matrix. Image frame DCT secondary transformation module: Take the 4*4 data from the upper left corner of the first-level DCT coefficient matrix and perform a two-dimensional 4*4 DCT transformation to obtain the secondary DCT coefficient matrix; The watermark information extraction module takes the data from the upper right and lower left corners of the second-level DCT coefficient matrix. If the data from the upper right corner is greater than the data from the lower left corner, the extracted watermark information is 1; otherwise, the extracted watermark information is 0. After the watermark information of each frame is extracted, it is grouped into 225 groups of watermark information, each consisting of 144 bits. The number of times each bit of each group of watermark information is 1 is counted, and then divided by the total number of groups, 255, to obtain the probability value of each bit of each group of watermark information being 1. The average of the probability values of each group of 144 bits is taken, and these 144 probability values are iterated. If any value is greater than the average, it represents a value of 1; otherwise, it is 0, finally obtaining 144 bits of watermark extraction information. The corresponding length of verification data of the watermark extraction information is obtained, and the verification data of each group of watermark information is compared. If they are equal, the watermark information extraction is successful; otherwise, the extraction fails. The watermark information decryption module, if the watermark information is successfully extracted, decrypts the watermark information to obtain the original watermark information; The watermark information extraction error statistics module repeatedly extracts the successfully extracted watermark information and reconstructs the 32400-bit watermark data of the small block matrix in each frame; compares the reconstructed watermark data of each group of watermark information, and records 0 if they are equal and 1 if they are not equal, and constructs a data matrix to determine whether the watermark information extraction of each block is correct. The image frame anti-tampering verification module compares the number of 1s in each data set of the data matrix of each watermark information set with the variance and mean of the number of 1s in each data set of the data matrix of each watermark information set, thereby determining whether each image frame with the corresponding watermark has been tampered with.
3. The digital watermarking video stream verification and protection system based on the DCT domain according to claim 2, characterized in that, It also includes server platforms, specifically: The video file upload module receives the original video file uploaded by the user; The watermark addition layer calling module sends the original video file and the original watermark information to the video file image frame and audio extraction module; The watermarked video file distribution module distributes the watermarked video file, which is synthesized by the video frame and the audio-to-video file synthesis module, to the user. The watermark detection communication module receives the original watermark information extracted by the watermark detection layer, as well as the result of whether each frame of the image with the added watermark has been tampered with. The abnormal video image detection alarm module receives the original watermark information extracted by the watermark detection layer, as well as the result of whether each frame of the image with the added watermark has been tampered with, and issues an early warning when tampering occurs.
4. The digital watermarking video stream verification and protection system based on the DCT domain according to claim 3, characterized in that, The watermark detection layer also includes: The platform's real-time communication module communicates in real time with the watermark detection communication module to send the original watermark information extracted by the watermark detection layer, as well as the result of whether each frame of the image with the added watermark has been tampered with, to the server platform.
5. A digital watermarking video stream verification and protection system based on the DCT domain according to claim 3, characterized in that, It also includes: a public screen that receives and displays the watermarked video file sent by the video frame and audio synthesis video file module; and sends the watermarked video file to the signal stream image frame extraction module.
6. A digital watermarking video stream verification and protection system based on the DCT domain according to claim 5, characterized in that, The watermark detection layer also includes: The public screen signal stream display module is turned on or off. If watermark information extraction fails or each frame of the image is detected to be tampered with, the video frame and audio synthesis video file module is cut off and the watermark video file is sent to the public screen.
7. A digital watermarking video stream verification and protection system based on the DCT domain according to claim 3, characterized in that, The server platform also includes: The video file review module manually reviews the original video files uploaded by the user and sends the original video files that have passed the manual review to the watermark addition layer calling module.
8. A digital watermarking video stream verification and protection system based on the DCT domain according to claim 1, characterized in that, Also includes: The intensity of the watermark is dynamically adjusted based on the gradient magnitude change of the first-level DCT transform data in each frame.
9. A digital watermarking video stream verification and protection system based on the DCT domain according to claim 8, characterized in that, The dynamic adjustment of the watermark intensity based on the gradient magnitude change of the first-level DCT transform data in each frame is expressed as follows: ; G represents the average gradient change magnitude; Gmin represents the minimum gradient change magnitude; and Gmax represents the maximum gradient change magnitude.
10. A method for verifying and protecting digital watermarked video streams based on the DCT domain, characterized in that, include: The original video file is decoded to obtain image frame data and audio data; The original watermark information is symmetrically encrypted to obtain watermark encrypted data, and the watermark encrypted data is verified to obtain watermark verification data. Each extracted image frame data is divided into an 8*8 block matrix on the Y component. The watermark encrypted data and the watermark verification data are repeated to obtain 32400 bits of watermark data for each frame's block matrix. 1 bit of the watermark data is added to each block of the block matrix for each frame. Perform a two-dimensional 8*8 DCT transformation on the small block matrix of each frame to obtain first-level DCT transformation data; Take the 4*4 data from the top left corner of each 8*8 coefficient matrix, perform a two-dimensional 4*4 DCT transformation, and obtain the second-level DCT transformation data; Take the coefficients from the upper right and lower left corners of the 4*4 second-level DCT transform data, and modify the coefficients according to the watermark data to be embedded, specifically including: In the second-level DCT transform data, based on the energy of each coefficient in the matrix, four non-DC coefficients with the middle energy are selected as the embedding positions of the watermark data; the four non-DC coefficients are represented as d14, d41, d13, and d31, respectively; the embedded watermark intensity is represented as k; the watermark intensity is dynamically adjusted according to the gradient magnitude change of the first-level DCT transform data of each frame, and the adaptive mechanism of the watermark intensity is based on the dual-dimensional adjustment of block complexity and frequency domain energy; d14=(d14+d41) / 2+k; ;d13=d13+k / 2; d31=d31-k / 2; The modified coefficient data is replaced in the original position of the second-level DCT transform data, and a two-dimensional 4*4 DCT inverse transform is performed to obtain the second-level DCT inverse transform data. Replace the second-level DCT inverse transform data with the upper right corner of the first-level DCT transform data, and perform a two-dimensional 8*8 DCT inverse transform to obtain the first-level DCT inverse transform data. After rounding, replace the first-level DCT transform data. The corresponding watermark data is added sequentially to the first-level DCT transform data after each frame is replaced to obtain image frame encrypted data; the image frame encrypted data and the audio data are then re-encoded and synthesized to obtain a watermarked video file.