Real-time reversible data hiding transmission method suitable for video stream
By performing real-time analysis of video streams and building dynamic mapping tables, combining pixel difference value expansion and bit plane replacement algorithms, the problem of insufficient real-time and capacity in the data hiding transmission of video streams is solved, and efficient and reliable data hiding and complete restoration of video streams is achieved.
Patent Information
- Application Number
- CN202510021689.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-15
AI Technical Summary
Traditional data hiding technology has shortcomings under the requirements of real-time, large capacity and high reliability of video streams, making it difficult to ensure the accuracy and real-timeness of data embedding and extraction. The data embedding capacity is limited, which cannot meet the hidden needs of a large amount of auxiliary information in video streams.
By performing real-time analysis of the video stream, we accurately distinguish keyframes and non-keyframes, and construct a dynamic mapping table based on the pixel value distribution and frequency to achieve reasonable allocation of data embedding capacity and priority, using pixel difference expansion algorithm and bit plane replacement algorithm for data embedding, and data extraction and complete restoration of video streams are performed on the receiving end.
It improves data embedding efficiency and video stream processing performance, ensures real-time and reliability of data hiding transmission, can embed more secret information without affecting smooth video playback, and improves attack resistance.
Smart Images

Figure CN119835495A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of multimedia information security communication, in particular to a real-time reversible data hiding and transmission method suitable for video streams. Background Art
[0002] In today's era of rapid development of digital information, the transmission and application of video data are becoming more and more extensive, covering many fields such as video surveillance, online video conferencing, and video streaming services. With the continuous growth of data security needs, achieving efficient and reliable data hiding and transmission in video streams has become a key technical challenge. In the field of video surveillance, it is necessary to securely transmit important data such as the identity information, timestamp, and geographic location of the monitoring equipment without affecting the normal viewing of the video; in video conferencing, sensitive information such as user permissions and conference encryption keys must be embedded; streaming services also have the need to hide and transmit data such as copyright information and user preferences. However, traditional data hiding technology has exposed many defects when dealing with the real-time, large-capacity, and high-reliability requirements of video streams.
[0003] Traditional data hiding technology solutions mainly focus on static images or general data files, and do not take into account the dynamic characteristics of video streams and the real-time transmission requirements. For example, some simple replacement algorithms based on image spatial domain, when applied in videos, will lead to poor stability of hidden data due to the continuous changes in video frames, and data loss or errors are prone to occur during video playback. Its advantages are simple algorithms and low computational complexity, but its disadvantages are obvious. It lacks targeted optimization of video streams, cannot adapt to changes in video frame rates, differences between key frames and non-key frames, and dynamic fluctuations in the network environment, and is difficult to ensure the accuracy and real-time performance of data embedding and extraction. In addition, the data embedding capacity is limited and cannot meet the needs of hiding a large amount of auxiliary information in video streams.
[0004] Although existing video data processing technologies have made progress in video encoding, compression, and transmission optimization, they are still insufficient in the reversibility and security of data hiding and transmission. After embedding data, some technologies find it difficult to completely restore the original video stream, resulting in irreversible loss of video quality; and in terms of security, it is difficult to effectively protect hidden data in the face of network attacks and data theft. When processing video streams, these technologies usually do not fully utilize the structural characteristics of video frames and the distribution of pixel values to reasonably allocate data embedding resources, resulting in low data embedding efficiency. In addition, when network bandwidth is limited or transmission delays increase, data embedding and transmission strategies cannot be dynamically adjusted, which seriously affects the transmission performance of video streams and data hiding effects.
[0005] In summary, the present application provides a real-time reversible data hiding and transmission method suitable for video streams. Through real-time analysis of video streams, key frames and non-key frames are accurately distinguished, and a dynamic mapping table is constructed according to pixel value distribution and frequency, thereby achieving a reasonable allocation of data embedding capacity and priority, and effectively improving data embedding efficiency and video stream processing performance. Summary of the invention
[0006] The present invention provides a real-time reversible data hiding transmission method applicable to video streams, comprising:
[0007] S1: parse the video stream in real time, extract key frames and non-key frames, divide the video stream into video segments of equal length according to preset rules, and count the distribution range and frequency information of pixel values in each video segment;
[0008] S2: construct a dynamic mapping table of pixel value intervals according to the pixel value distribution and frequency of the video clips, and determine the embeddable data capacity and embedding priority corresponding to different pixel value intervals;
[0009] S3: During the video stream transmission process, the network bandwidth and transmission delay are dynamically monitored at set time intervals, and the data embedding amount and transmission time slot are allocated to each video segment based on the embedding priority of the video segment;
[0010] S4: embedding the data into the corresponding pixel value interval according to the dynamic mapping table, the key frame is embedded using the embedding algorithm of pixel difference expansion, and the non-key frame is embedded using the embedding algorithm of bit plane replacement;
[0011] S5: at the receiving end, synchronously parse the received video stream, extract the hidden data according to the embedding rules and dynamic mapping table of the sending end, and perform preliminary recovery of the video stream;
[0012] S6: Perform integrity check on the initially recovered video stream. If data error or loss is found, use the redundant information and error correction code of the video stream to repair the data and restore the video stream, completing the real-time reversible data hiding transmission of the video stream.
[0013] Preferably, the S1 specifically comprises the following steps:
[0014] S1.1: Use the video stream parsing module to read the input video stream frame by frame, and parse the specific encoding format identification field contained in the header information of each frame in the video stream to identify the encoding type of each frame in the video stream and distinguish between key frames and non-key frames;
[0015] S1.2: according to the frame rate information of the video stream, a fixed time length is set as the segmentation standard, and the video stream is evenly divided into video segments of equal length in the time dimension according to the unit of time length;
[0016] S1.3: traverse each video clip pixel by pixel in order from left to right and from top to bottom, extract the pixel value of each pixel, and store the pixel value in a temporary array, and sort the pixel values in the temporary array by a sorting algorithm to form a pixel value sequence of the video clip;
[0017] S1.4: Based on the generated pixel value sequence, by setting the hash table data statistical structure, the number of times each different pixel value appears in the video clip is counted to determine the frequency information of the pixel value, and the first value in the sorted pixel value sequence is obtained as the minimum value and the last value as the maximum value to obtain the distribution range of the pixel values in the video clip.
[0018] Preferably, in S1.1, the encoding type of each frame in the video stream is identified to distinguish key frames from non-key frames; the key frames have complete image information and serve as independent reference units in the video sequence, and do not rely on other frames for decoding and restoration; the non-key frames are frames containing partial image information generated by using motion compensated prediction and interpolation algorithms based on key frames.
[0019] Preferably, Figure 3 As shown, S2 specifically includes the following steps:
[0020] S2.1, dividing the video clip into continuous non-overlapping initial pixel value intervals according to the pixel value distribution range of the video clip;
[0021] S2.2, for each initial pixel value interval, the proportion of the number of pixels falling within the interval to the total number of pixels in the video clip is counted as the frequency weight of the interval, and the theoretical capacity of data that can be embedded in each initial pixel value interval is calculated based on a pre-set capacity evaluation function related to the characteristics of the video stream, combined with the frequency weight of the interval and the distribution characteristics of the pixel value;
[0022] S2.3, based on the real-time requirements of the video stream and the importance of the data, the embedding priority of each interval is initially set;
[0023] S2.4. During the transmission process, the dynamic changes in the pixel value distribution and the frequency fluctuations of the video stream are continuously monitored, the division of the pixel value interval, the embeddable data capacity of each interval and the embedding priority are adjusted, and a dynamic mapping table of the pixel value intervals of the video stream is constructed.
[0024] Preferably, the interval division is adaptively performed by equal spacing or density of pixel value frequency distribution. The pixel values are relatively evenly distributed within the set range, and equal spacing is used for division; if there is an obvious clustering area of the pixel values, the clustering area is used to divide the interval.
[0025] Preferably, in S2.2, the total number of pixels of the video clip is set to P T , for the i-th initial pixel value interval, the number of pixels falling into this interval is P i , calculate the frequency weight W i , the frequency weight W i The calculation formula is W i =P i / P T ; Set the video stream resolution to R s , color depth is C d , the distribution variance of pixel values is V D , the capacity evaluation function formula related to the video stream characteristics is pre-set as: Where k1 is the video stream resolution coefficient, k2 is the color depth coefficient, and k3 is the pixel value distribution variance coefficient. The theoretical capacity of data that can be embedded in each initial pixel value interval is calculated using the capacity evaluation function formula.
[0026] Preferably, in S3, the time interval is set to T. During the video stream transmission, the network monitoring tool is used to obtain the available bandwidth B of the current network at every time T. d and the average transmission delay D y , by embedding the video segments according to the priority P y Sorting is performed, with high-priority video clips at the front, and bandwidth and data volume are allocated; the bandwidth allocation formula is: Among them B z is the total available bandwidth, n is the total number of video clips, P yi is the priority of the i-th video clip, is the sum of the priorities of all video clips, B di is the bandwidth allocation for the i-th video segment; the amount of data Q that can be embedded in the video segment is calculated based on the allocated bandwidth yi , the calculation formula is: Where r is the time resource required for data embedding per bit. According to the time sequence of the video stream and the time window mechanism of network transmission, a corresponding transmission time slot is allocated to each video clip to embed and transmit data in an orderly manner.
[0027] Preferably, in S4, data is embedded into the corresponding pixel value interval according to the dynamic mapping table, and the key frame is embedded using the embedding algorithm of pixel difference expansion, and the non-key frame is embedded using the embedding algorithm of bit plane replacement; the pixel difference expansion embedding algorithm of the key frame sets a certain pixel pair in the key frame as (p1, p2), calculates the original difference d=p2-p1, sets the embedded data as m, and if the expansion multiple of the data embedding is k c, when d is an even number, the new difference d′=d+k×m; when d is an odd number, d′=d+2k×m, the calculated p′2=p1+d′, embed the data m into the key frame; the non-key frame bit plane replacement embedding algorithm sets the non-key frame pixel value p g Convert to binary bit plane representation as b l-1 b l-2 …b0, where l is the number of pixel bit planes, and the rth bit plane is determined according to the dynamic mapping table. i The amount of data that can be embedded in a bit plane is Take out the bits from the data to be embedded M Bit data is recorded as The bit plane after replacement becomes The modified bit planes are reconverted into pixel values to complete the data embedding into non-keyframes.
[0028] Preferably, in S5, the received video stream is synchronously parsed by the receiving end, hidden data is extracted according to the embedding rules and dynamic mapping table of the sending end, and the video stream is preliminarily restored; the received video stream is synchronously parsed by the clock signal and frame identification information synchronized by the sending end to ensure that the order of the received video frames is consistent with that of the sending end and the timestamps match; the key frame extracts the hidden data through the inverse process of pixel difference expansion, and calculates the difference d′=p′2-p1 by reading the pixel pair (p1, p′2) after the embedded data. When d′ is an even number, m=(d′-d) / k c , where d is the original difference, k c is the expansion multiple when embedded; when d′ is an odd number, m=(d′-d) / (2k c )), extract the hidden data and restore the original pixel pair; the non-key frame performs the inverse operation of bit plane replacement, converts the received pixel value into a binary bit plane, determines the bit plane position and length of the embedded data according to the dynamic mapping table, replaces the embedded data bit back to the original bit, extracts the hidden data and restores the original pixel value.
[0029] Preferably, in S6, an integrity check is performed on the preliminarily recovered video stream, by calculating the checksum of the video stream, and comparing the calculated checksum with the standard checksum pre-stored at the sending end or attached to the video stream. If the two are inconsistent, it is determined that the data is erroneous or lost, and data repair is performed; the data repair performs difference calculation and compensation on redundant information in the video stream, and corrects the erroneous data according to the error correction code embedded in the video stream using the decoding algorithm of the error correction code, and restores the original data according to the location and degree of the data error or loss, combining the redundant information and the error correction code, and undergoes multiple iterative repair and verification processes until the checksum is consistent with the standard checksum, and the restoration of the video stream is completed.
[0030] Compared with the prior art, the technical solution of this application has the following technical effects:
[0031] The present invention solves the problem that the traditional data hiding method is difficult to simultaneously meet the requirements of efficient data embedding and video quality maintenance by constructing a dynamic mapping table of pixel value intervals and combining it with a real-time analysis technical solution for video streams. On the basis of real-time analysis of video streams, the present invention accurately determines the embeddable data capacity and priority corresponding to different pixel value intervals according to the pixel value distribution and frequency in the video clips, and can dynamically adjust to adapt to changes in video content. The technical effect obtained thereby is that high-capacity and lossless embedding of data is achieved while ensuring the video viewing experience, and the hidden data can be accurately extracted at the receiving end to complete the complete restoration of the video.
[0032] The present invention solves the problem of unstable data hiding transmission caused by changes in network conditions in the prior art by monitoring network bandwidth and transmission delay and combining the embedding priority allocation technical solution of video clips. It can dynamically monitor the network status according to the set time interval during the video stream transmission process, and reasonably allocate the data embedding amount and transmission time slot of each video clip accordingly, thereby ensuring the stability of video stream transmission and data security. Therefore, the technical effect of maintaining good video quality and data hiding performance even in a poor network environment is obtained, and the robustness and scope of application of the system are enhanced.
[0033] The present invention adopts a data embedding technical solution of using a pixel difference expansion algorithm for key frames and a bit plane replacement algorithm for non-key frames, thereby solving the problem of low efficiency of traditional methods in processing different types of video frames. The pixel difference characteristics in key frames are used to increase the amount of embedded data, while non-key frames are replaced with their redundant information for bit plane replacement, which does not affect the visual quality of the video and can effectively improve the data embedding rate. This technical effect allows more secret information to be embedded more efficiently without affecting the smooth playback of the video, while improving the anti-attack capability, because the modified video frames are almost visually imperceptible.
[0034] The present invention solves the problem of data error or loss in the transmission process of video streams in the prior art by performing integrity check on the initially recovered video stream and using redundant information and error correction codes to repair data. It can not only parse the video stream synchronously at the receiving end and extract hidden data, but also effectively detect and repair existing data errors or losses. In this way, a more reliable data transmission mechanism is obtained, which can ensure the integrity of data even in a complex and changeable network environment, and provides a highly reliable real-time reversible data hiding transmission method, which greatly improves user experience and data security.
[0035] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application so that it can be implemented in accordance with the contents of the specification, and to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings as follows.
[0036] Based on the detailed description of the specific embodiments of the present application in combination with the accompanying drawings below, those skilled in the art will become more aware of the above and other objects, advantages and features of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings without creative work. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, each element or part is not necessarily drawn according to the actual scale.
[0038] Figure 1 A flow chart of a real-time reversible data hiding transmission method applicable to video streams according to the present invention;
[0039] Figure 2 The present invention is a flowchart of a real-time reversible data hiding transmission method applicable to video streams;
[0040] Figure 3 A flow chart for constructing a dynamic mapping table of a real-time reversible data hiding transmission method applicable to a video stream of the present invention;
[0041] Figure 4 A flow chart of distinguishing key frames from non-key frames in a real-time reversible data hiding transmission method applicable to video streams of the present invention;
[0042] Figure 5 The present invention is a verification flow chart of a real-time reversible data hiding transmission method applicable to video streams. DETAILED DESCRIPTION
[0043] To make the purpose, technical scheme and advantages of the embodiment of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the present application. Obviously, the described embodiment is a part of the embodiment of the present application, rather than all of the embodiments. In the following description, specific details such as specific configuration and components are provided only to help fully understand the embodiments of the present application. Therefore, it should be clear to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. In addition, for clarity and brevity, the description of known functions and structures is omitted in the embodiment.
[0044] It should be understood that the references to "one embodiment" or "this embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "one embodiment" or "this embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0045] In addition, the present application may repeat reference numerals and / or letters in different examples. This repetition is for the purpose of simplicity and clarity, and does not in itself indicate the relationship between the various embodiments and / or settings discussed.
[0046] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" in this article describes another type of association object relationship, indicating that there can be two relationships. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship.
[0047] The term "at least one" in this article is merely a description of the association relationship of associated objects, indicating that there may be three relationships. For example, at least one of A and B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0048] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusions.
[0049] Example 1
[0050] This embodiment mainly describes a real-time reversible data hiding transmission method applicable to video streams, such as Figure 1 As shown, including:
[0051] S1: parse the video stream in real time, extract key frames and non-key frames, divide the video stream into video segments of equal length according to preset rules, and count the distribution range and frequency information of pixel values in each video segment;
[0052] S2: construct a dynamic mapping table of pixel value intervals according to the pixel value distribution and frequency of the video clips, and determine the embeddable data capacity and embedding priority corresponding to different pixel value intervals;
[0053] S3: During the video stream transmission process, the network bandwidth and transmission delay are dynamically monitored at set time intervals, and the data embedding amount and transmission time slot are allocated to each video segment based on the embedding priority of the video segment;
[0054] S4: embedding the data into the corresponding pixel value interval according to the dynamic mapping table, the key frame is embedded using the embedding algorithm of pixel difference expansion, and the non-key frame is embedded using the embedding algorithm of bit plane replacement;
[0055] S5: at the receiving end, synchronously parse the received video stream, extract the hidden data according to the embedding rules and dynamic mapping table of the sending end, and perform preliminary recovery of the video stream;
[0056] S6: Perform integrity check on the initially recovered video stream. If data error or loss is found, use the redundant information and error correction code of the video stream to repair the data and restore the video stream, completing the real-time reversible data hiding transmission of the video stream.
[0057] Further, if Figure 2 As shown, S1 specifically includes the following steps:
[0058] S1.1: Use the video stream parsing module to read the input video stream frame by frame, and parse the specific encoding format identification field contained in the header information of each frame in the video stream to identify the encoding type of each frame in the video stream and distinguish between key frames and non-key frames;
[0059] S1.2: according to the frame rate information of the video stream, a fixed time length is set as the segmentation standard, and the video stream is evenly divided into video segments of equal length in the time dimension according to the unit of time length;
[0060] Assuming the video stream frame rate is 30fps, set 1 / 30 second as a basic time unit, and evenly divide the video stream into video segments of equal length in the time dimension according to this unit to ensure the consistency of each video segment in the time scale;
[0061] S1.3: traverse each video clip pixel by pixel in order from left to right and from top to bottom, extract the pixel value of each pixel, and store the pixel value in a temporary array, and sort the pixel values in the temporary array by a sorting algorithm to form a pixel value sequence of the video clip;
[0062] S1.4: Based on the generated pixel value sequence, by setting the hash table data statistical structure, the number of times each different pixel value appears in the video clip is counted to determine the frequency information of the pixel value, and the first value in the sorted pixel value sequence is obtained as the minimum value and the last value as the maximum value to obtain the distribution range of the pixel values in the video clip.
[0063] Furthermore, in S1.1, the encoding type of each frame in the video stream is identified to distinguish key frames from non-key frames; key frames have complete image information and serve as independent reference units in the video sequence, and do not rely on other frames for decoding and restoration; non-key frames are frames containing partial image information generated by motion compensated prediction and interpolation algorithms based on key frames.
[0064] Further, if Figure 3 As shown, S2 specifically includes the following steps:
[0065] S2.1, dividing the video clip into continuous non-overlapping initial pixel value intervals according to the pixel value distribution range of the video clip;
[0066] S2.2, for each initial pixel value interval, the proportion of the number of pixels falling within the interval to the total number of pixels in the video clip is counted as the frequency weight of the interval, and the theoretical capacity of data that can be embedded in each initial pixel value interval is calculated based on a pre-set capacity evaluation function related to the characteristics of the video stream, combined with the frequency weight of the interval and the distribution characteristics of the pixel value;
[0067] S2.3, based on the real-time requirements of the video stream and the importance of the data, the embedding priority of each interval is initially set;
[0068] S2.4. During the transmission process, the dynamic changes in the pixel value distribution and the frequency fluctuations of the video stream are continuously monitored, the division of the pixel value interval, the embeddable data capacity of each interval and the embedding priority are adjusted, and a dynamic mapping table of the pixel value intervals of the video stream is constructed.
[0069] Furthermore, the interval division is adaptively divided by equal spacing or the density of pixel value frequency distribution. If the pixel values are distributed relatively evenly within the set range, equal spacing division is adopted; if there are obvious clustering areas of pixel values, the clustering areas are used to divide the interval.
[0070] Furthermore, in S2.2, the total number of pixels of the video clip is set to P T, for the i-th initial pixel value interval, the number of pixels falling into this interval is P i , calculate the frequency weight W i , frequency weight W i The calculation formula is W i =P i / P T ; Set the video stream resolution to R s , color depth is C d , the distribution variance of pixel values is V D , the capacity evaluation function formula related to the video stream characteristics is pre-set as: Where k1 is the video stream resolution coefficient, k2 is the color depth coefficient, and k3 is the pixel value distribution variance coefficient. The theoretical capacity of data that can be embedded in each initial pixel value interval is calculated using the capacity evaluation function formula.
[0071] Furthermore, in S3, the time interval is set to T. During the video stream transmission, the network monitoring tool is used to obtain the available bandwidth B of the current network at every time T. d and the average transmission delay D y , by embedding the video segments according to the priority P y Sorting, high priority video clips are placed in the front, and bandwidth and data volume are allocated; the bandwidth allocation formula is: B di = Among them B z is the total available bandwidth, n is the total number of video clips, P yi is the priority of the i-th video clip, is the sum of the priorities of all video clips, B di is the bandwidth allocation for the i-th video segment; according to the allocated bandwidth, calculate the amount of data O that can be embedded in the video segment yi , the calculation formula is: Where r is the time resource required for data embedding per bit. According to the time sequence of the video stream and the time window mechanism of network transmission, a corresponding transmission time slot is allocated to each video clip to embed and transmit data in an orderly manner.
[0072] Furthermore, in S4, the data is embedded into the corresponding pixel value interval according to the dynamic mapping table. The key frame is embedded using the pixel difference expansion embedding algorithm, and the non-key frame is embedded using the bit plane replacement embedding algorithm. The pixel difference expansion embedding algorithm of the key frame sets a pixel pair in the key frame as (p1, p2), calculates the original difference d=p2-p1, sets the embedded data as m, and if the expansion multiple of the data embedding is k cWhen d is an even number, the new difference d′=d+k×m; when d is an odd number, d′=d+2k×m, and the calculated p′2=p1+d′, embed the data m into the key frame; the bit plane replacement embedding algorithm of the non-key frame sets the non-key frame pixel value p g Convert to binary bit plane representation as b l-1 b l-2 …b0, where l is the number of pixel bit planes, and the rth bit plane is determined according to the dynamic mapping table. i The amount of data that can be embedded in a bit plane is Take out the bits from the data to be embedded M Bit data is recorded as After replacement, the replaced bit plane becomes The modified bit planes are reconverted into pixel values to complete the data embedding into non-keyframes.
[0073] Furthermore, in S5, the received video stream is synchronously parsed by the receiving end, and the hidden data is extracted according to the embedding rules and dynamic mapping table of the sending end, and the video stream is preliminarily restored; the received video stream is synchronously parsed by the clock signal and frame identification information synchronized by the sending end to ensure that the order of the received video frames is consistent with that of the sending end and the timestamps match; the key frame extracts the hidden data through the inverse process of pixel difference expansion, and calculates the difference d′=p′2-p1 by reading the pixel pair (p1, p′2) after the embedded data. When d′ is an even number, m=(d′-d) / k c , where d is the original difference, k c is the expansion multiple when embedded; when d′ is an odd number, m=(d′-d) / (2k c )), extract the hidden data and restore the original pixel pairs; perform the inverse operation of bit plane replacement on non-key frames, convert the received pixel values into binary bit planes, determine the bit plane position and length of the embedded data according to the dynamic mapping table, replace the embedded data bits back to the original bits, extract the hidden data and restore the original pixel values.
[0074] Furthermore, in S6, an integrity check is performed on the initially recovered video stream by calculating the checksum of the video stream, and comparing the calculated checksum with the standard checksum pre-stored at the sending end or attached to the video stream. If the two are inconsistent, it is determined that the data is erroneous or lost, and data repair is performed. In data repair, the redundant information in the video stream is difference-calculated and compensated, and the erroneous data is corrected according to the error correction code embedded in the video stream using the decoding algorithm of the error correction code. The original data is restored according to the location and degree of the data error or loss, combining the redundant information and the error correction code. After multiple iterative repair and verification processes, the checksum is consistent with the standard checksum, and the video stream is restored.
[0075] This embodiment accurately distinguishes key frames and non-key frames through real-time analysis of the video stream, and constructs a dynamic mapping table based on the pixel value distribution and frequency, thereby achieving a reasonable allocation of data embedding capacity and priority, and effectively improving data embedding efficiency and video stream processing performance. During the transmission process, the network bandwidth and transmission delay are dynamically monitored, and the data embedding amount and transmission time slot are flexibly allocated for each video segment in combination with the embedding priority, ensuring the real-time and reliability of data hiding transmission. At the same time, a reversible embedding algorithm is used to accurately extract hidden data and completely restore the video stream at the receiving end, solving the problems of irreversible data hiding and impaired video quality in the prior art, significantly improving the security and practicality of video stream data hiding transmission, and meeting the growing demand for secure transmission of video data.
[0076] Example 2
[0077] This embodiment is based on Embodiment 1 and describes in detail a specific method for identifying the encoding type of each frame in a video stream to distinguish key frames from non-key frames, such as Figure 4 As shown, including:
[0078] In the real-time reversible data hiding transmission method of video stream, a certain frame in the video stream is set as F, and its encoding information is E(F); for the key frame, it has a unique encoding identification feature, and it is assumed that the encoding identification function of the key frame is I KF (E(F)), when certain conditions are met, such as I KF (E(F)) = 1, then the frame is determined to be a key frame, because the key frame is an independent reference unit in the video sequence, and its image information is complete. In the decoding process, the pixel data of the key frame can be directly used for image reconstruction without the need for information from other frames. The decoding function D KF (F) Depends only on its own pixel data P KF (F), which can be expressed as D KF (F) = f(P KF (F)), where f is the decoding algorithm.
[0079] For non-key frames, their coding information is related to key frames and can be generated through motion compensation prediction and difference algorithm; the coding generation function of non-key frames is set to G NF (E(F), E(KF)), where E(KF) is the encoding information of the relevant key frame. When generating non-key frames, firstly, based on the image data of the key frame, the motion vector MV is obtained by motion estimation, and the motion compensation algorithm is used according to the pixel data P of the key frame. KF (KF) and motion vector MV to calculate the predicted pixel data P P (F), the formula is: P P (F) = h(P KF(KF), MV), where h is the motion compensation calculation function; by predicting the pixel data P P (F) Calculate the difference data D between the actual pixel data and the predicted pixel data NF (F) = P NF (F)-P P (F), the obtained non-key frame encoding information E(F) is composed of the encoding information of the predicted pixel data and the encoding information of the difference data. The formula is: E(F) = E P (F)+E D (F), where (F) is the encoding information of the predicted pixel data, E D (F) is the encoding information of the difference data; the above technology is used to accurately distinguish key frames from non-key frames.
[0080] This embodiment uses the pixel difference characteristics in key frames to increase the amount of embedded data, and uses the redundant information of non-key frames to replace the bit plane, which does not affect the visual quality of the video and can effectively improve the data embedding rate. This technical effect allows more secret information to be embedded more efficiently without affecting the smooth playback of the video, and at the same time improves the anti-attack capability because the modified video frames are almost visually imperceptible.
[0081] Example 3
[0082] This embodiment is based on Embodiment 1, and performs a detailed integrity check on the initially recovered video stream. If data errors or loss are found, the redundant information and error correction code of the video stream are used to repair the data and restore the video stream. Figure 5 As shown, the specific steps include:
[0083] S6.1. Calculate the checksum of the video stream using the CRC (Cyclic Redundancy Check) algorithm to recover the video stream. Generate a checksum of fixed length by calculating the video stream data according to a specific polynomial rule. For example, for the common CRC-32 algorithm, perform complex shift and XOR operations on the binary data sequence of the video stream to obtain a 32-bit checksum. Strictly compare this checksum with the standard CRC-32 checksum pre-calculated by the sender before transmission and attached to the video stream. If the two are exactly the same, it is preliminarily determined that the video stream data is complete. If they are inconsistent, it is clear that the data is wrong or lost, and the repair process begins.
[0084] S6.2. Analyze the redundant information in the video stream. For example, in the video coding standard, there is a large amount of redundant data based on inter-frame prediction. By parsing the coding structure of the video stream, these redundant parts are identified. For example, for P frames (prediction frames), they are generated based on the previous key frame or other reference frames through motion estimation and compensation, and there is a correlation between the pixel values with the reference frame. These correlation data are redundant information. The location and data characteristics of the redundant information are recorded in detail.
[0085] S6.3. Extract the error correction code embedded in the video stream, such as the Reed-Solomon error correction code, and use the decoding algorithm to perform error correction operations according to the encoding rules and parameters of the error correction code; assuming that the Reed-Solomon (255, 223) code is used, it means that the original data is encoded into 255 symbols, of which 223 are information symbols and 32 are error correction symbols. When a data error is detected, the decoder will correct the erroneous data through Galois field operations based on the received symbols and error correction symbols. During the Galois field operation, the error position and error value are calculated, combined with the error correction capability of the error correction code to maximize the recovery of the correct data.
[0086] S6.4. Reintegrate the data after redundant information compensation and error correction code correction into the video stream, and arrange and reorganize the repaired video frames according to the original coding structure and time sequence of the video stream; by ensuring the continuity and integrity of the video stream, such as the correct order of key frames and non-key frames, and the time interval between frames meets the frame rate requirements of the video stream, perform another integrity check. If the checksum is consistent with the standard checksum, the video stream is restored, and real-time reversible data hiding transmission of the video stream is realized, ensuring that the video stream obtained by the receiving end is highly consistent with the original video stream at the sending end in terms of data integrity and accuracy.
[0087] This embodiment calculates the checksum of the video stream through a rigorous verification process, and compares it with the standard checksum pre-stored or attached at the sending end, which can quickly and accurately detect whether there are errors or data loss. Once a problem is found, the redundant information of the video stream itself is used to calculate and compensate for the difference, fully tap the potential error correction capability within the video stream, and correct the erroneous data through a complex and accurate decoding algorithm. During the entire repair process, according to the specific location and degree of data error or loss, the characteristics of redundant information and error correction codes are cleverly combined, and after multiple iterations of fine repair and verification operations, the quality of the video stream is continuously optimized until the checksum is completely consistent with the standard checksum, successfully achieving perfect restoration of the video stream, and ensuring the accuracy and integrity of the video stream data.
[0088] Example 4
[0089] Based on Example 1, this embodiment describes in detail a specific implementation example of a real-time reversible data hiding transmission method applicable to a video stream, which specifically includes:
[0090] It is assumed that there is a high-definition video stream with a frame rate of 25fps, a resolution of 1280×720, and a color depth of 8 bits.
[0091] The video stream parsing module starts to read the video stream frame by frame, parses the specific encoding format identification field in the header information of each frame, and successfully distinguishes the key frames and non-key frames; in a video stream with a duration of 15 seconds, there are a total of 375 frames, including 15 key frames and 360 non-key frames. According to the frame rate information, a fixed time length of 0.6 seconds (i.e. 15÷25) is set as the segmentation standard, and the video stream is evenly divided into 25 video clips of equal length in the time dimension. Taking one of the video clips as an example, its 921,600 pixels (1280×720) are traversed pixel by pixel from left to right and from top to bottom, the pixel value of each pixel is extracted and stored in a temporary array, and the pixel values in the temporary array are sorted using a quick sort algorithm to form a pixel value sequence. According to statistics, the pixel value range in the video clip is between 10-240, among which the pixel value 130 appears most frequently, reaching 46080 times; by setting the hash table data statistical structure, the frequency information of each pixel value is calculated, and the pixel value 10 is set to appear 1000 times, and its frequency is 1000÷921600≈0.001085, and the distribution range of the pixel value is determined.
[0092] According to the pixel value distribution range, the initial pixel value interval is divided into 12 intervals at equal intervals, such as [10-30], [31-50]...[231-250]; for the interval [111-130], the number of pixels falling into this interval is 230400, and its frequency weight is calculated to be 230400÷921600=0.25. The video stream resolution coefficient k1 is set to 0.4, the color depth coefficient k2 is set to 0.3, and the pixel value distribution variance coefficient k3 is set to 0.03. It is known that the video stream resolution is 1280×720, the color depth is 8 bits, and the pixel value distribution variance is calculated to be 25. The capacity evaluation function C i =W i ×R s k1 ×C x k2 ×(1+k3×V p) calculation, the theoretical capacity of data that can be embedded in this interval is 350 bits; considering the high real-time requirements of the video stream (such as for real-time video monitoring), the embedding priority is set to 0.7 for intervals containing important information such as timestamps, and the embedding priority is set to 0.2 for ordinary picture data intervals. During the transmission process, as the distribution and frequency of pixel values in the video stream change dynamically, such as a sudden increase in the frequency of pixel values in the [131-150] interval within a certain period of time, the interval division is adjusted in time, and it is further subdivided into [131-140] and [141-150]. At the same time, the embeddable data capacity and embedding priority of each interval are recalculated to construct a dynamic mapping table.
[0093] Set the time interval T = 0.5 seconds, and use professional network monitoring tools (such as bandwidth monitoring software based on SNMP protocol and high-precision delay measurement module) to obtain the current network's available bandwidth B x =8Mbps, average transmission delay D γ =40ms, the total number of video clips n = 25, after sorting the video clips according to the embedding priority, calculate the allocated bandwidth of each video clip; if there is a video clip with an embedding priority of 0.6, its allocated bandwidth B xi =8Mbps×(0.6÷∑1 25 P γj ), assuming that the sum of the priorities of other video clips is calculated to be 10, the bandwidth allocated to this video clip is 0.48Mbps. It is known that the time resource r required for data embedding per bit is 8ns (obtained through testing the video stream and embedding algorithm), then the amount of data that can be embedded in this video clip is Q γi =(0.48Mbps×(0.5s-40m s ))÷8n s = 28000 bits. At the same time, according to the time sequence of the video stream and the time window mechanism of network transmission, a corresponding transmission time slot is allocated to each video segment to ensure that the data can be embedded and transmitted in an orderly manner. For example, the video segment where the key frame is located is preferentially allocated a time slot close to the start position of the time window to ensure timely transmission and processing of data.
[0094] For a key frame, such as the pixel pair (80,90) in a key frame, the original difference d = 10, the embedded data m = 3, and the expansion multiple k e=3, because d is an even number, the new difference d′=10+3×3=19, the new p2′=80+19=99, and the data is successfully embedded in the key frame. For non-key frames, if the pixel value 160 of a non-key frame is converted to a binary bit plane representation of 10100000, the amount of data that can be embedded in the 4th bit plane is determined to be 2 bits according to the dynamic mapping table, and 11 is taken from the data to be embedded to replace the original data of the bit plane. The replaced bit plane becomes 10101100, and then converted to a pixel value to complete the data embedding in the non-key frame. During the embedding process, the dynamic mapping table and the corresponding algorithm are strictly followed to ensure that the data is accurately embedded in the specified pixel value range and will not have a significant impact on the normal playback of the video stream.
[0095] The received video stream is parsed synchronously using the clock signal and accurate frame identification information that are precisely synchronized with the transmitter. For key frames, the pixel pair (80,99) after the embedded data is read, and the difference d′=19 is calculated. Since d′ is an odd number, m=(19-10)÷(2×3)=1.5 (assuming that the data is stored in decimal form), the hidden data is successfully extracted and the original pixel pair is restored. For non-key frames, the received pixel value is converted into a binary bit plane, and the bit plane position and length of the embedded data are determined according to the dynamic mapping table. The embedded data bits are replaced back to the original bits, the hidden data is extracted, and the original pixel value is restored to achieve preliminary recovery of the video stream. During the extraction process, the dynamic mapping table and the embedding rules are carefully compared to ensure the accuracy and completeness of the data extraction. At the same time, a preliminary quality check is performed on the restored video frame, such as checking whether the pixel value is within a reasonable range and whether there are obvious abnormalities in the picture.
[0096] The CRC-16 algorithm is used to calculate the checksum of the initial recovery video stream, and the calculated checksum is compared with the standard checksum pre-stored at the sender. If data errors or loss are found, the redundant information of the video stream is analyzed in depth. For example, in a certain video clip, it is found that some data errors are caused by network fluctuations. By using redundant data based on inter-frame prediction, the difference between the pixel value at the error position and the correct value is calculated for compensation. At the same time, based on the embedded Reed-Solomon (128,100) error correction code, the erroneous data is corrected through complex Galois field operations. It is assumed that there is an 80-bit data error in a certain video clip during the transmission process. After multiple iterations of the error correction algorithm, the erroneous data is successfully restored. After multiple verification and repair processes, until the checksum is consistent with the standard checksum, the restoration of the video stream is completed, ensuring that the video stream obtained by the receiving end is highly consistent with the original video stream at the sending end in terms of data integrity and accuracy, and the video playback quality is not significantly affected.
[0097] Through this embodiment, it can be concluded that the technology of the present application performs well in all aspects during the processing of video streams, from the efficiency of data embedding, the reliability of transmission to the accurate recovery of video streams, fully demonstrating its extremely high superiority and being able to meet various complex video stream data hiding and transmission requirements.
[0098] The above are only preferred embodiments of the present invention, which do not limit the scope of protection of the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any changes, modifications, replacements, integrations and parameter changes to these embodiments within the spirit and principles of the present invention through conventional substitutions or without departing from the principles and spirit of the present invention fall within the scope of protection of the present invention.
Claims
1. A real-time reversible data hiding transmission method suitable for video streams, characterized in that: include: S1: parse the video stream in real time, extract key frames and non-key frames, divide the video stream into video segments of equal length according to preset rules, and count the distribution range and frequency information of pixel values in each video segment; S2: construct a dynamic mapping table of pixel value intervals according to the pixel value distribution and frequency of the video clips, and determine the embeddable data capacity and embedding priority corresponding to different pixel value intervals; S3: During the video stream transmission process, the network bandwidth and transmission delay are dynamically monitored at set time intervals, and the data embedding amount and transmission time slot are allocated to each video segment based on the embedding priority of the video segment; S4: embedding the data into the corresponding pixel value interval according to the dynamic mapping table, the key frame is embedded using the embedding algorithm of pixel difference expansion, and the non-key frame is embedded using the embedding algorithm of bit plane replacement; S5: at the receiving end, synchronously parse the received video stream, extract the hidden data according to the embedding rules and dynamic mapping table of the sending end, and perform preliminary recovery of the video stream; S6: Perform integrity check on the initially recovered video stream. If data error or loss is found, use the redundant information and error correction code of the video stream to repair the data and restore the video stream, completing the real-time reversible data hiding transmission of the video stream.
2. A real-time reversible data hiding transmission method applicable to video streams according to claim 1, characterized in that: The S1 specifically includes the following steps: S1.1: Use the video stream parsing module to read the input video stream frame by frame, and parse the specific encoding format identification field contained in the header information of each frame in the video stream to identify the encoding type of each frame in the video stream and distinguish between key frames and non-key frames; S1.2: according to the frame rate information of the video stream, a fixed time length is set as the segmentation standard, and the video stream is evenly divided into video segments of equal length in the time dimension according to the unit of time length; S1.3: traverse each video clip pixel by pixel in order from left to right and from top to bottom, extract the pixel value of each pixel, and store the pixel value in a temporary array, and sort the pixel values in the temporary array by a sorting algorithm to form a pixel value sequence of the video clip; S1.4: Based on the generated pixel value sequence, by setting the hash table data statistical structure, the number of times each different pixel value appears in the video clip is counted to determine the frequency information of the pixel value, and the first value in the sorted pixel value sequence is obtained as the minimum value and the last value as the maximum value to obtain the distribution range of the pixel values in the video clip.
3. A real-time reversible data hiding transmission method applicable to video streams according to claim 2, characterized in that: In S1.1, the encoding type of each frame in the video stream is identified to distinguish key frames from non-key frames; the key frames have complete image information and serve as independent reference units in the video sequence, and do not rely on other frames for decoding and restoration; The non-key frame is a frame containing partial image information generated by using a motion compensated prediction and difference algorithm based on the key frame.
4. A real-time reversible data hiding transmission method applicable to video streams according to claim 1, characterized in that: The S2 specifically includes the following steps: S2.1, dividing the video clip into continuous non-overlapping initial pixel value intervals according to the pixel value distribution range of the video clip; S2.2, for each initial pixel value interval, the proportion of the number of pixels falling within the interval to the total number of pixels in the video clip is counted as the frequency weight of the interval, and the theoretical capacity of data that can be embedded in each initial pixel value interval is calculated based on a pre-set capacity evaluation function related to the characteristics of the video stream, combined with the frequency weight of the interval and the distribution characteristics of the pixel value; S2.3, based on the real-time requirements of the video stream and the importance of the data, the embedding priority of each interval is initially set; S2.
4. During the transmission process, the dynamic changes in the pixel value distribution and the frequency fluctuations of the video stream are continuously monitored, the division of the pixel value interval, the embeddable data capacity of each interval and the embedding priority are adjusted, and a dynamic mapping table of the pixel value intervals of the video stream is constructed.
5. A real-time reversible data hiding transmission method applicable to video streams according to claim 4, characterized in that: The interval division is adaptively divided by equal spacing or the density of pixel value frequency distribution. If the pixel values are distributed relatively evenly within the set range, equal spacing is used for division; if there is an obvious clustering area of the pixel values, the clustering area is used for interval division.
6. A real-time reversible data hiding transmission method applicable to video streams according to claim 4, characterized in that: In S2.2, the total number of pixels of the video segment is set to P T , for the i-th initial pixel value interval, the number of pixels falling into this interval is P i , calculate the frequency weight W i , the frequency weight W i The calculation formula is W i =P i / P T ; Set the video stream resolution to R s , color depth is C d , the distribution variance of pixel values is V D , the capacity evaluation function formula related to the video stream characteristics is pre-set as: Where k1 is the video stream resolution coefficient, k2 is the color depth coefficient, and k3 is the pixel value distribution variance coefficient. The theoretical capacity of data that can be embedded in each initial pixel value interval is calculated using the capacity evaluation function formula.
7. A real-time reversible data hiding transmission method applicable to video streams according to claim 1, characterized in that: In S3, the time interval is set to T. During the video stream transmission, the network monitoring tool is used to obtain the available bandwidth B of the current network at every time T. d and the average transmission delay D y , by embedding the video segments according to the priority P y Sorting is performed, with high-priority video clips at the front, and bandwidth and data volume are allocated; the bandwidth allocation formula is: Among them B z is the total available bandwidth, n is the total number of video clips, P yi is the priority of the i-th video clip, is the sum of the priorities of all video clips, B di is the bandwidth allocation for the i-th video segment; the amount of data Q that can be embedded in the video segment is calculated based on the allocated bandwidth yi , the calculation formula is: Where r is the time resource required for data embedding per bit. According to the time sequence of the video stream and the time window mechanism of network transmission, a corresponding transmission time slot is allocated to each video clip to embed and transmit data in an orderly manner.
8. The real-time reversible data hiding transmission method applicable to video stream according to claim 1, characterized in that: In S4, data is embedded into the corresponding pixel value interval according to the dynamic mapping table. The key frame is embedded using the pixel difference expansion embedding algorithm, and the non-key frame is embedded using the bit plane replacement embedding algorithm. The pixel difference expansion embedding algorithm of the key frame sets a pixel pair in the key frame as (p1, p2), calculates the original difference d=p2-p1, sets the embedded data as m, and if the expansion multiple of the data embedding is k c , when d is an even number, the new difference d′=d+k×m; when d is an odd number, d′=d+2k×m, the calculated p′2=p1+d′, embed the data m into the key frame; the non-key frame bit plane replacement embedding algorithm sets the non-key frame pixel value p g Convert to binary bit plane representation as b l-1 b l-2 …b0, where l is the number of pixel bit planes, and the rth bit plane is determined according to the dynamic mapping table. i The amount of data that can be embedded in a bit plane is Take out the bits from the data to be embedded M Bit data is recorded as The bit plane after replacement becomes The modified bit planes are converted back into pixel values to complete the data embedding into non-keyframes.
9. A real-time reversible data hiding transmission method applicable to video streams according to claim 1 or 8, characterized in that: In S5, the received video stream is synchronously parsed by the receiving end, hidden data is extracted according to the embedding rules and dynamic mapping table of the sending end, and the video stream is preliminarily restored; the received video stream is synchronously parsed by the clock signal and frame identification information synchronized by the sending end to ensure that the order of the received video frames is consistent with that of the sending end and the timestamps match; the key frame extracts the hidden data through the inverse process of pixel difference expansion, and calculates the difference d′=p′2-p1 by reading the pixel pair (p1, p′2) after the embedded data. When d′ is an even number, m=(d′-d) / k c , where d is the original difference, k c is the expansion multiple when embedded; when d′ is an odd number, m=(d′-d) / (2k c )), extract the hidden data and restore the original pixel pair; the non-key frame performs the inverse operation of bit plane replacement, converts the received pixel value into a binary bit plane, determines the bit plane position and length of the embedded data according to the dynamic mapping table, replaces the embedded data bit back to the original bit, extracts the hidden data and restores the original pixel value.
10. A real-time reversible data hiding transmission method applicable to video streams according to claim 1, characterized in that: In the S6, the integrity check of the initially recovered video stream is performed, and the checksum of the video stream is calculated, and the calculated checksum is compared with the standard checksum pre-stored at the sending end or attached to the video stream. If the two are inconsistent, it is determined that there is an error or loss in the data, and data repair is performed; the data repair performs difference calculation and compensation on redundant information in the video stream, and corrects the erroneous data according to the error correction code embedded in the video stream using the decoding algorithm of the error correction code, and restores the original data according to the location and degree of the data error or loss, combining the redundant information and the error correction code, and after multiple iterations of the repair and verification process, until the checksum is consistent with the standard checksum, the restoration of the video stream is completed.