A video surveillance data compression transmission method and system
By analyzing the texture feature and complexity score of video frames and dynamically adjusting the encoding parameters, the problem of visual quality degradation in the existing technology in high dynamic scenes or complex textured videos is solved, and more efficient video compression and transmission are achieved.
Patent Information
- Application Number
- CN202510136452.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-02-07
AI Technical Summary
When existing video compression technology deals with videos with high dynamic scenes or complex textures, fixed encoding parameters cannot maintain the original visual quality, resulting in the loss of key details and affecting the video analysis and utilization value.
By analyzing the texture characteristics of video frames, calculating the texture change rate, edge density and color discrete degree, generating video frame complexity scores, dynamically adjusting the quantization step size and encoding decision parameters, generating dynamic coding strategies, and optimizing the entropy coding process.
It realizes that while maintaining video quality, dynamically adjusting encoding parameters, reducing unnecessary information losses, improving the storage and transmission efficiency of video surveillance data, and ensuring the clarity and accuracy of key information.
Smart Images

Figure CN119583800B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video compression, and in particular to a video monitoring data compression transmission method and system. Background Art
[0002] The field of video compression technology involves methods of encoding video data to reduce the required storage space and transmission bandwidth. This technology uses various algorithms to reduce file size while maintaining video quality as much as possible.
[0003] The main technologies include intra-frame compression and inter-frame compression. Intra-frame compression removes data redundancy for a single picture frame, while inter-frame compression achieves compression by predicting and describing the changes between frames. Common technologies include motion estimation and motion compensation. Video compression is widely used, including but not limited to digital television, video conferencing systems, network video streaming, and personal video recording.
[0004] The video surveillance data compression and transmission method refers to a data compression and transmission technology specially designed for video surveillance systems, which is used to effectively transmit large amounts of video surveillance data. By applying video compression technology, the data transmission bandwidth requirement and storage space requirement can be significantly reduced while maintaining video quality, thereby improving the efficiency and performance of the video surveillance system. This method is particularly suitable for situations where large amounts of video data need to be remotely monitored and stored, such as public safety monitoring, traffic monitoring, and commercial monitoring systems.
[0005] Although existing technologies provide basic video compression functions, their processing strategies lack responsiveness to the complexity of video content, often resulting in the loss of visually important details during the compression process. Especially when processing videos with high dynamic scenes or complex textures, fixed encoding parameters often fail to maintain the original visual quality, affecting the analysis and utilization value of the video. For example, in the field of security monitoring, this defect may lead to the loss of key evidence and affect the accuracy of subsequent analysis. In addition, existing technologies fail to fully optimize the processing of inter-frame dependencies, often resulting in redundancy in data transmission, further limiting the efficiency of applications in bandwidth-constrained environments. Summary of the invention
[0006] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a video monitoring data compression transmission method and system.
[0007] In order to achieve the above object, the present invention adopts the following technical solution: a video surveillance data compression transmission method, comprising the following steps:
[0008] S1: Analyze the texture features of the video frame, calculate the grayscale gradient of each pixel, obtain the texture change rate, then detect the edge information, calculate the distribution density of edge pixels, then extract the color histogram, calculate the discrete degree of color distribution, normalize the texture change rate, edge density and color discrete degree respectively, perform weighted summation, and obtain the video frame complexity score;
[0009] S2: determining initial encoding parameters according to the video frame complexity score, and applying the initial encoding parameters to adjust the quantization step size of each video frame, reducing or increasing the quantization step size according to the score, and adjusting the encoding decision parameters at the same time, optimizing the entropy encoding process, and generating a dynamic encoding strategy;
[0010] S3: Based on real-time monitoring of the video quality after encoding using the dynamic encoding strategy, calculate the peak signal-to-noise ratio and the structural fit index, compare them with the preset thresholds respectively, and obtain the video quality score of the current frame. If the peak signal-to-noise ratio or the structural fit index is lower than the preset threshold, generate a result that the video quality score is lower than the preset value, and iteratively adjust the quantization step size and the encoding decision parameters according to the video frame complexity score to obtain the real-time adjusted encoding parameters;
[0011] S4: Encode the entire video stream using the real-time adjusted encoding parameters in combination with the video frame complexity score, count the encoding parameter values and corresponding quality indicators in differentiated scenarios, analyze the relationship between the encoding parameters and video content characteristics, adjust the value range of the global encoding parameters, and generate an optimized compression strategy.
[0012] As a further solution of the present invention, the step of obtaining the video frame complexity score is specifically as follows:
[0013] S111: Calculate the grayscale gradient of each pixel to form a grayscale gradient matrix G using the formula:
[0014]
[0015] Calculate and generate texture change rate T;
[0016] in, Representative The grayscale gradient of pixels, Represents the total number of pixels, represents the adjustment factor;
[0017] S112: Count edge pixels and set gradient threshold , the gradient is greater than Mark the pixels as edges and count the number of edge pixels , and the total number of pixels Ratio of:
[0018]
[0019] Calculate the edge density ;
[0020] S113: Extract color histogram using the formula:
[0021]
[0022] Calculate the degree of color dispersion ;
[0023] in, Representative The probability of a color appearing, Represents the total number of colors;
[0024] S114: Normalize the texture change rate, the edge density and the color discreteness using the formula:
[0025]
[0026] Calculate the complexity score of the generated video frame ;
[0027] in, , , represents the weight coefficient, , , Represents the normalized texture change rate, edge density, and color discreteness.
[0028] As a further solution of the present invention, the step of obtaining the dynamic encoding strategy is specifically as follows:
[0029] S211: Based on the video frame complexity score, apply linear adjustment using the formula:
[0030]
[0031] Determine the initial encoding parameters, match the complexity change of the video content, and generate the initial encoding parameters P;
[0032] in, represents the video frame complexity score, , They are adjustment factor and offset respectively;
[0033] S212: According to the initial encoding parameters, a nonlinear conversion formula is used:
[0034]
[0035] Match the quality and compression requirements of video encoding and calculate the quantization step size ;
[0036] in, It is the base of the natural logarithm and is used to adjust the response speed;
[0037] S213: Using the quantization step size, adjusting the coding decision parameters, using a dynamic adjustment formula:
[0038]
[0039] Optimize the entropy coding process and generate coding decision parameters ;
[0040] in, is the quantization step size, is the coefficient that adjusts the coding decision;
[0041] S214: Optimize entropy coding according to the coding decision parameters, using the formula:
[0042]
[0043] Adjust the dynamic encoding strategy and generate the dynamic encoding strategy R.
[0044] As a further solution of the present invention, the step of obtaining the encoding parameters adjusted in real time is specifically:
[0045] S311: adopt the dynamic encoding strategy to perform video encoding for real-time monitoring, calculate the peak signal-to-noise ratio and the structural fit index of the real-time monitoring video stream, compare them with the preset thresholds, and obtain the video quality score of the current frame. If the peak signal-to-noise ratio or the structural fit index is lower than the preset threshold, a result that the video quality score is lower than the preset value is generated;
[0046] S312: Based on the result that the quality score is lower than the preset threshold, evaluate the complexity score of the current video frame, and adjust it in combination with the original quantization step size to obtain preliminary adjusted encoding decision data;
[0047] S313: Utilizing the initially adjusted coding decision data, iteratively optimizing coding parameters, using the formula:
[0048]
[0049] Calculate the current quantization parameter , obtain the encoding parameters adjusted in real time;
[0050] in, is based on the original quantization parameters with lower video quality scores. It is the quantization step adjustment value based on the video frame complexity score. Represents the importance of the video frame complexity score to the quantization step size adjustment. Represents the normalization factor for the overall adjustment process.
[0051] As a further solution of the present invention, the step of obtaining the optimized compression strategy is specifically as follows:
[0052] S411: Encode the entire video stream using the real-time adjusted encoding parameters, score the encoding quality and complexity of each video frame according to the content complexity, record the encoding parameters and corresponding quality indicators of each video frame, and generate encoding and quality data of the video frame;
[0053] S412: extracting encoding parameters and corresponding quality indicators in differentiated scenarios from the encoding and quality data of the video frame, identifying factors affecting video quality by encoding parameters through data analysis and comparison, and generating correlation analysis data between encoding parameters and video content characteristics;
[0054] S413: Analyze data by using the correlation between the encoding parameters and the video content characteristics, using the formula:
[0055]
[0056] Calculate the optimal value range of global encoding parameters and generate an optimized compression strategy;
[0057] in, represents the optimal value range of the global encoding parameters, Represents the local parameters that affect the video encoding effect. represents a characteristic measure associated with changes in video content, Indicates the total number of referenced scenes.
[0058] A video surveillance data compression transmission system, the video surveillance data compression transmission system is used to execute the above-mentioned video surveillance data compression transmission method, the system comprises:
[0059] The video frame complexity analysis module extracts the pixel grayscale value of each video frame based on video surveillance data, calculates the grayscale gradient and edge density, extracts the color histogram, calculates the color discreteness, normalizes the grayscale gradient, edge density and color discreteness, and performs weighted summation to obtain the frame complexity score;
[0060] The coding parameter determination module allocates initial coding parameters to each video frame according to the frame complexity score, sets a quantization step size, sets differential quantization step sizes for high-scoring frames and low-scoring frames, and generates an initial coding parameter set;
[0061] The dynamic coding strategy module applies the initial coding parameter set to dynamically adjust the quantization step size of the video frame, monitors the frame complexity score change in real time, and if the score increases, reduces the quantization step size, and if the score decreases, increases the quantization step size, and adjusts the coding decision parameters at the same time to generate a coding adjustment plan;
[0062] The video quality monitoring module encodes the video frame using the encoding adjustment scheme, calculates the peak signal-to-noise ratio and structural fit index of the encoded video and the original video, and compares them with the preset quality threshold. If the quality index is lower than the threshold, the quantization step size and encoding decision parameters are adjusted according to the frame complexity score to obtain real-time optimized encoding parameters;
[0063] The global compression optimization module uses the real-time optimized encoding parameters, combined with the frame complexity score, to encode the video stream, count the encoding parameter values and quality indicators, analyze the relationship between the encoding parameters and the video content characteristics, adjust the global encoding parameter value range, and generate an optimized compression strategy.
[0064] Compared with the prior art, the advantages and positive effects of the present invention are:
[0065] In the present invention, a content-based dynamic encoding parameter adjustment mechanism is introduced to analyze the video frames and adjust the compression strategy according to the content complexity. Through the comprehensive analysis of texture change rate, edge density and color discreteness, the encoding process can accurately respond to the needs of different video contents and reduce unnecessary information loss. By real-time monitoring of the encoded video quality and comparing it with the preset quality threshold, the scheme can dynamically adjust the encoding parameters to ensure the video quality while further optimizing the storage and transmission of data, ensuring the clarity and accuracy of key information, and improving the practicality and dependence of video monitoring data. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a schematic diagram of the workflow of the present invention;
[0067] Figure 2 A flow chart of steps for obtaining a video frame complexity score according to the present invention;
[0068] Figure 3 A flowchart of the acquisition steps of the dynamic encoding strategy of the present invention;
[0069] Figure 4 A flowchart of the steps for obtaining the encoding parameters adjusted in real time according to the present invention;
[0070] Figure 5 The figure is a flow chart of the steps for obtaining the compression strategy optimized in the present invention. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0072] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0073] Embodiment 1
[0074] See also Figure 1 The present invention provides a technical solution: a video surveillance data compression transmission method, comprising the following steps:
[0075] S1: Analyze the texture features of the video frame, calculate the grayscale gradient of each pixel, obtain the texture change rate, then detect the edge information, calculate the distribution density of edge pixels, then extract the color histogram, calculate the discrete degree of color distribution, normalize the texture change rate, edge density and color discrete degree respectively, perform weighted summation, and obtain the video frame complexity score;
[0076] S2: Determine initial encoding parameters according to the video frame complexity score, apply the initial encoding parameters, adjust the quantization step size of each video frame, reduce or increase the quantization step size according to the score, and adjust the encoding decision parameters at the same time, optimize the entropy encoding process, and generate a dynamic encoding strategy;
[0077] S3: Based on real-time monitoring of the video quality after encoding using a dynamic encoding strategy, calculate the peak signal-to-noise ratio and the structural fit index, compare them with the preset thresholds, and obtain the video quality score of the current frame. If the peak signal-to-noise ratio or the structural fit index is lower than the preset threshold, a result that the video quality score is lower than the preset value is generated. According to the video frame complexity score, iteratively adjust the quantization step size and the encoding decision parameters to obtain the real-time adjusted encoding parameters.
[0078] S4: Encode the entire video stream using the real-time adjusted encoding parameters combined with the video frame complexity score, count the encoding parameter values and corresponding quality indicators in differentiated scenarios, analyze the relationship between encoding parameters and video content characteristics, adjust the value range of global encoding parameters, and generate an optimized compression strategy.
[0079] The video frame complexity score includes texture change rate, edge density and color discreteness. The initial encoding parameters include quantization depth, initial compression ratio, baseline encoding settings. The dynamic encoding strategy includes inter-frame adjustment rules, intra-frame compression mode, and adaptive encoding path. The encoding parameters adjusted in real time include adjusted quantization accuracy, encoding speed optimization, and adaptive decision threshold. The optimized compression strategy includes differentiated compression logic, quality control indicators, and scene response encoding strategy.
[0080] See also Figure 2 , the steps for obtaining the video frame complexity score are as follows:
[0081] S111: Calculate the grayscale gradient of each pixel to form a grayscale gradient matrix G using the formula:
[0082]
[0083] Calculate and generate texture change rate T;
[0084] in, Representative The grayscale gradient of pixels, Represents the total number of pixels, represents the adjustment factor;
[0085] formula:
[0086]
[0087] Detailed explanation of the formula and the process of formula calculation and derivation:
[0088] First define For the The gray gradient value of a pixel, is the total number of pixels, To adjust the coefficient, the coefficient is used to strengthen the influence of high grayscale gradient values, making the texture change more prominent. The formula is to calculate the average degree of texture change in the image, which is called the texture change rate .
[0089] Set a grayscale gradient array is [10,20,30,40,50], i.e., the grayscale gradient values of the five pixels, and (This value is selected based on experimental optimization results to better highlight the impact of high gradient values), .
[0090] Calculation process:
[0091] Calculate the square of each grayscale gradient:
[0092]
[0093] Add the values and divide by the total number of pixels :
[0094] Calculating Texture Change Rate :
[0095]
[0096] The results show that the average texture change rate of the image is 1100, which reflects the intensity of the average change in the grayscale value of each pixel and provides a basic quantitative indicator for subsequent image processing and analysis.
[0097] S112: Count edge pixels and set gradient threshold , the gradient is greater than Mark the pixels as edges and count the number of edge pixels , and the total number of pixels Ratio of:
[0098]
[0099] Calculate the edge density ;
[0100] formula:
[0101]
[0102] Detailed explanation of the formula and the process of formula calculation and derivation:
[0103] definition is the number of pixels identified as edges, is the total number of image pixels. The edge pixels pass a preset gradient threshold. Pixels with gradients greater than a threshold are identified as edges. It indicates the ratio of edge pixels to total pixels and is an indicator to measure the richness of image edge features.
[0104] In an image of 1000 pixels, the edge detection algorithm determines that the gradient of 300 pixels exceeds the set threshold. (The threshold is based on image contrast analysis to ensure that only significant edges are counted).
[0105] Calculation process:
[0106] Determine the number of edge pixels .
[0107] Total number of pixels used .
[0108] Calculate edge density :
[0109] The results show that edge pixels account for 30% of the total pixels. This value reflects the proportion of edge features in the image and is closely related to the structural complexity of the image, providing a direct quantitative method for analyzing the complexity of image content.
[0110] S113: Extract color histogram using the formula:
[0111]
[0112] Calculate the degree of color dispersion ;
[0113] in, Representative The probability of a color appearing, Represents the total number of colors;
[0114] formula:
[0115]
[0116] Detailed explanation of the formula and the process of formula calculation and derivation:
[0117] The formula calculates the degree of color dispersion ,in Indicates The probability of a color in the color histogram, is the total number of colors. The formula is based on the concept of information entropy and is used to quantify the uniformity or diversity of color distribution. The higher the degree of discreteness of color distribution, the richer the image color information.
[0118] Suppose there is a simplified color histogram, which has only four colors and their probabilities are .
[0119] Calculation process:
[0120] Compute the information contribution of each color:
[0121]
[0122] Add these values:
[0123]
[0124] The results show that the color discreteness is 1.846, which indicates that the image color distribution is relatively uniform and the amount of color information is relatively high, which is suitable for subsequent image analysis and content recognition tasks.
[0125] S114: Normalize texture change rate, edge density and color discreteness using the formula:
[0126]
[0127] Calculate the complexity score of the generated video frame ;
[0128] in, , , represents the weight coefficient, , , Represents the normalized texture change rate, edge density, and color discreteness.
[0129] formula:
[0130]
[0131] Detailed explanation of the formula and the process of formula calculation and derivation:
[0132] In the formula, Represents the complexity score of a video frame, combining three differentiated feature metrics: Normalized texture change rate , normalized edge density and the normalized color dispersion . Weight , and are the relative importance of these three features, respectively, and these weights are set based on optimization or previous research to ensure a balanced scoring system.
[0133] In the scene, the weight is set to , , , this assignment refers to the relatively greater impact of edge density on the complexity of video frames. It is known from the previous step that , , as normalized value.
[0134] Calculation process:
[0135] Calculate the video frame complexity score using the given normalization value and weight:
[0136]
[0137]
[0138] The results show that the video frame complexity score is 0.51, which is obtained by comprehensively referring to the normalized effects of texture change rate, edge density and color discreteness. It provides a quantitative complexity measure for subsequent video processing and can assist in optimizing video analysis and processing algorithms.
[0139] See also Figure 3 , the specific steps for obtaining the dynamic encoding strategy are:
[0140] S211: Based on the video frame complexity score, apply linear adjustment using the formula:
[0141]
[0142] Determine the initial encoding parameters, match the complexity change of the video content, and generate the initial encoding parameters P;
[0143] in, represents the video frame complexity score, , They are adjustment factor and offset respectively;
[0144] formula:
[0145]
[0146] Detailed explanation of the formula and the process of formula calculation and derivation:
[0147] The formula is used to determine the initial encoding parameters of the video frame ,in represents the video frame complexity score, and are the coefficients of the linear mapping.
[0148] Set up the complexity analysis of the video frames, The value of has been calculated, for example This value is derived through a comprehensive evaluation of the pixel change rate, edge information, and color distribution within the video frame. Settings and These coefficients are adjusted based on previous video coding efficiency tests and compression quality feedback to ensure that they can match the encoding requirements of differentiated video content.
[0149] The calculation formula is as follows:
[0150]
[0151]
[0152]
[0153] Calculation results Indicates the initial encoding parameters. The encoding settings are adjusted according to the video complexity to maintain a balance between encoding efficiency and video quality.
[0154] S212: According to the initial encoding parameters, a nonlinear conversion formula is used:
[0155]
[0156] Match the quality and compression requirements of video encoding and calculate the quantization step size ;
[0157] in, It is the base of the natural logarithm and is used to adjust the response speed;
[0158] formula:
[0159]
[0160] Detailed explanation of the formula and the process of formula calculation and derivation:
[0161] The formula is used to calculate the quantization step size , affecting the compression rate and quality of video encoding. are the initial encoding parameters obtained from the previous formula.
[0162] Substitution Perform the calculation:
[0163]
[0164]
[0165]
[0166]
[0167] The obtained quantization step size , indicating that the encoding compression setting for the current video frame is moderate and suitable for maintaining high video quality.
[0168] S213: Use the quantization step size to adjust the coding decision parameters, using the dynamic adjustment formula:
[0169]
[0170] Optimize the entropy coding process and generate coding decision parameters ;
[0171] in, is the quantization step size, is the coefficient that adjusts the coding decision;
[0172] formula:
[0173]
[0174] Detailed explanation of the formula and the process of formula calculation and derivation:
[0175] Formula used to adjust encoding decision parameters ,in and It is a coefficient adjusted according to the actual needs of video encoding to match the changes in video content. and , this value is based on the trade-off between coding efficiency and error rate.
[0176] Substitution Perform the calculation:
[0177]
[0178] result Refers to the adjustment of coding decision parameters to a matching level in preparation for optimizing the entropy coding process.
[0179] S214: Optimize entropy coding according to the coding decision parameters, using the formula:
[0180]
[0181] Adjust the dynamic encoding strategy and generate the dynamic encoding strategy R.
[0182] formula:
[0183]
[0184] Detailed explanation of the formula and the process of formula calculation and derivation:
[0185] The formula is used to calculate the optimization result of entropy coding .
[0186] Substitution Perform the calculation:
[0187]
[0188]
[0189]
[0190] result It shows that by adjusting the coding decision parameters, the entropy coding process has been optimized, providing a more effective data coding strategy for video compression, reducing data redundancy and improving coding efficiency.
[0191] See also Figure 4 , the steps for obtaining the real-time adjusted encoding parameters are as follows:
[0192] S311: adopt a dynamic encoding strategy to perform video encoding for real-time monitoring, calculate the peak signal-to-noise ratio and the structural fit index of the real-time monitoring video stream, compare them with the preset thresholds respectively, and obtain the video quality score of the current frame. If the peak signal-to-noise ratio or the structural fit index is lower than the preset threshold, a result that the video quality score is lower than the preset value is generated;
[0193] A dynamic encoding strategy is used to encode the video for real-time monitoring, and the peak signal-to-noise ratio and structural fit index of the real-time monitoring video stream are calculated. First, the brightness and chrominance signals of each frame of video are separated and the signal is digitized to obtain the difference between the signal of each frame and the original reference frame. The peak signal-to-noise ratio of the current frame is calculated based on the difference value. In addition, the geometric structure features of the video frame are extracted and modeled using spatial information to obtain the structural fit index. Subsequently, the two indicators are compared with the set preset thresholds to obtain the video quality score of the current frame. If the peak signal-to-noise ratio or the structural fit index is lower than the set preset threshold, a result with a video quality score lower than the preset value is generated.
[0194] S312: based on the result that the quality score is lower than the preset threshold, evaluating the complexity score of the current video frame, adjusting it in combination with the original quantization step size, and obtaining preliminary adjusted encoding decision data;
[0195] Based on the result that the video quality score is lower than the preset threshold, the complexity score of the current video frame is evaluated, and its spatial complexity is calculated by detecting the change of motion vectors of multiple pixels in the video frame. At the same time, the uniformity of color change is detected, and its temporal complexity is calculated by combining the motion information and texture complexity in the video frame. The complexity scores of these two dimensions are used to score the comprehensive complexity of the current video frame, and then the original quantization step size parameters are called to adjust the complexity score. Preliminary adjustments are made and encoding decision data is generated to obtain preliminary adjusted encoding decision data.
[0196] S313: Utilize the initially adjusted coding decision data to iteratively optimize the coding parameters, using the formula:
[0197]
[0198] Calculate the current quantization parameter , obtain the encoding parameters adjusted in real time;
[0199] in, is based on the original quantization parameters with lower video quality scores. It is the quantization step adjustment value based on the video frame complexity score. Represents the importance of the video frame complexity score to the quantization step size adjustment. Represents the normalization factor for the overall adjustment process.
[0200] formula:
[0201]
[0202] The formula is useful in that by introducing the weight coefficient and , which balances the original quantization step size and the quantization step size adjustment value based on the quality score, and can dynamically adjust the quantization step size according to the actual changes in video quality to improve the encoding quality.
[0203] Detailed explanation of the formula and the process of formula calculation and derivation:
[0204] set up ,but
[0205]
[0206] The results show that the quantization step size adjustment after video quality evaluation obtains the real-time adjusted encoding parameters. This value will be used to adjust the quantization accuracy during the encoding process to ensure the quality and encoding efficiency of the video frame.
[0207] See also Figure 5 , the specific steps for obtaining the optimized compression strategy are:
[0208] S411: Encode the entire video stream using the encoding parameters adjusted in real time, score the encoding quality and complexity of each video frame according to the content complexity, record the encoding parameters and corresponding quality indicators of each video frame, and generate encoding and quality data of the video frame;
[0209] Use the encoding parameters adjusted in real time to encode the video stream. First, each video frame is scored for complexity based on the dynamics of the content, color changes, and edge information. Differentiated encoding parameters are applied to each frame, and the parameter values and the resulting quality indicators for each frame are recorded. This method can track the factors that affect the output quality, thereby providing data support for subsequent steps. The video frame encoding and quality data generated at this stage provide a basis for subsequent analysis.
[0210] S412: extracting encoding parameters and corresponding quality indicators in differentiated scenarios from the encoding and quality data of the video frames, identifying factors affecting the video quality by encoding parameters through data analysis and comparison, and generating correlation analysis data between encoding parameters and video content characteristics;
[0211] Information is extracted from video frame encoding and quality data, and statistics are collected based on the values of encoding parameters and corresponding quality indicators in differentiated scenarios. Statistical analysis is used to compare the data and find out the impact of parameter changes on video quality. This data analysis process allows us to intuitively see how differentiated encoding parameters interact with video content characteristics, thereby obtaining direct relationship data between encoding parameters and video content characteristics.
[0212] S413: Analyze data using the correlation between encoding parameters and video content characteristics, using the formula:
[0213]
[0214] Calculate the optimal value range of global encoding parameters and generate an optimized compression strategy;
[0215] in, represents the optimal value range of the global encoding parameters, Represents the local parameters that affect the video encoding effect. represents a characteristic measure associated with changes in video content, Indicates the total number of referenced scenes.
[0216] formula:
[0217]
[0218] The benefit of the formula is that by summing and averaging the product of the local encoding parameters of each scene and the corresponding video content characteristics, the global encoding parameters are dynamically adjusted based on the actual video content, thereby achieving the best compression effect in differentiated types of video content.
[0219] Detailed explanation of the formula and the process of formula calculation and derivation:
[0220] There are three scenes set up, among which They are 30, 45, and 55 respectively, corresponding to (Video content characteristic index) are 0.8, 0.7, 0.9, and the number of scenes is 3.
[0221] The calculation process is:
[0222]
[0223] The results show that the global encoding parameter should be adjusted to 35 to match the compression requirements of differentiated types of videos and ensure that multiple types of videos can achieve good compression efficiency while ensuring quality.
[0224] A video surveillance data compression transmission system, the video surveillance data compression transmission system is used to execute the above-mentioned video surveillance data compression transmission method, the system comprises:
[0225] The video frame complexity analysis module extracts the pixel grayscale value of each video frame based on video surveillance data, calculates the grayscale gradient and edge density, extracts the color histogram, calculates the color discreteness, normalizes the grayscale gradient, edge density and color discreteness, and performs weighted summation to obtain the frame complexity score;
[0226] The coding parameter determination module assigns initial coding parameters to each video frame according to the frame complexity score, sets a quantization step size, sets differential quantization step sizes for high-scoring frames and low-scoring frames, and generates an initial coding parameter set;
[0227] The dynamic coding strategy module applies the initial coding parameter set to dynamically adjust the quantization step size of the video frame, monitors the frame complexity score changes in real time, and reduces the quantization step size if the score increases, and increases the quantization step size if the score decreases. At the same time, it adjusts the coding decision parameters and generates a coding adjustment plan;
[0228] The video quality monitoring module uses the coding adjustment scheme to encode the video frames, calculates the peak signal-to-noise ratio and structural fit index of the encoded video and the original video, and compares them with the preset quality threshold. If the quality index is lower than the threshold, the quantization step size and coding decision parameters are adjusted according to the frame complexity score to obtain real-time optimized coding parameters;
[0229] The global compression optimization module uses real-time optimized encoding parameters combined with frame complexity scores to encode video streams, count encoding parameter values and quality indicators, analyze the relationship between encoding parameters and video content characteristics, adjust the global encoding parameter value range, and generate an optimized compression strategy.
[0230] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A video surveillance data compression and transmission method, characterized in that: The following steps are involved: Analyze the texture features of the video frame, calculate the grayscale gradient of each pixel, obtain the texture change rate, then detect the edge information, calculate the distribution density of edge pixels, then extract the color histogram, calculate the discrete degree of color distribution, normalize the texture change rate, edge density and color discrete degree respectively, perform weighted summation, and obtain the video frame complexity score; Determine initial encoding parameters according to the video frame complexity score, and apply the initial encoding parameters to adjust the quantization step size of each video frame, reduce or increase the quantization step size according to the score, and adjust the encoding decision parameters at the same time, optimize the entropy encoding process, and generate a dynamic encoding strategy; Based on real-time monitoring of the video quality after encoding using the dynamic encoding strategy, the peak signal-to-noise ratio and the structural fit index are calculated, and compared with the preset thresholds respectively to obtain a video quality score of the current frame. If the peak signal-to-noise ratio or the structural fit index is lower than the preset threshold, a result that the video quality score is lower than the preset value is generated. According to the video frame complexity score, the quantization step size and the encoding decision parameters are iteratively adjusted to obtain the encoding parameters adjusted in real time; The entire video stream is encoded using the real-time adjusted encoding parameters in combination with the video frame complexity score, the encoding parameter values and corresponding quality indicators under differentiated scenarios are statistically analyzed, the relationship between the encoding parameters and the video content characteristics is analyzed, the value range of the global encoding parameters is adjusted, and an optimized compression strategy is generated; The structural fit index is extracted based on the geometric structural features of the video frame and is modeled and acquired using spatial information.
2. The video surveillance data compression and transmission method according to claim 1, characterized in that: The steps for obtaining the video frame complexity score are specifically as follows: Calculate the grayscale gradient of each pixel to form a grayscale gradient matrix G using the formula: Calculate and generate texture change rate T; in, Representative The grayscale gradient of pixels, Represents the total number of pixels, represents the adjustment factor; Count edge pixels and set gradient threshold , the gradient is greater than Mark the pixels as edges and count the number of edge pixels Total number of pixels Ratio of: Calculate the edge density ; Extract the color histogram using the formula: Calculate the degree of color dispersion ; in, Representative The probability of a color appearing, Represents the total number of colors; Normalize the texture change rate, the edge density and the color discreteness using the formula: Calculate the complexity score of the generated video frame ; in, , , represents the weight coefficient, , , Represents the normalized texture change rate, edge density, and color discreteness.
3. The video surveillance data compression and transmission method according to claim 2, characterized in that: The steps for obtaining the dynamic encoding strategy are specifically as follows: Based on the video frame complexity score, a linear adjustment is applied using the formula: Determine the initial encoding parameters, match the complexity change of the video content, and generate the initial encoding parameters P; in, represents the video frame complexity score, , They are adjustment factor and offset respectively; According to the initial encoding parameters, through the nonlinear conversion formula: Match the quality and compression requirements of video encoding and calculate the quantization step size ; in, It is the base of the natural logarithm and is used to adjust the response speed; The quantization step size is adopted to adjust the coding decision parameters and use the dynamic adjustment formula: Optimize the entropy coding process and generate coding decision parameters ; in, is the quantization step size, is the coefficient that adjusts the coding decision; According to the coding decision parameters, the entropy coding is optimized using the formula: Adjust the dynamic encoding strategy and generate the dynamic encoding strategy R.
4. The video surveillance data compression and transmission method according to claim 3, characterized in that: The steps for obtaining the real-time adjusted encoding parameters are specifically as follows: The dynamic encoding strategy is used to perform video encoding on real-time monitoring, and the peak signal-to-noise ratio and structural fit index of the real-time monitoring video stream are calculated, and compared with the preset thresholds respectively to obtain the video quality score of the current frame. If the peak signal-to-noise ratio or the structural fit index is lower than the preset threshold, a result is generated that the video quality score is lower than the preset value; Based on the result that the quality score is lower than the preset threshold, evaluating the complexity score of the current video frame, adjusting it in combination with the original quantization step size, and obtaining preliminary adjusted encoding decision data; The coding decision data obtained through the preliminary adjustment is used to iteratively optimize the coding parameters, using the formula: Calculate the current quantization parameter , obtain the encoding parameters adjusted in real time; in, is based on the original quantization parameters with lower video quality scores. It is the quantization step adjustment value based on the video frame complexity score. Represents the emphasis on the original quantization parameters. Represents the importance of the video frame complexity score to the quantization step size adjustment. Represents the normalization factor for the overall adjustment process.
5. The video surveillance data compression and transmission method according to claim 4, characterized in that: The steps for obtaining the optimized compression strategy are specifically as follows: Encoding the entire video stream using the encoding parameters adjusted in real time, scoring the encoding quality and complexity of each video frame according to the content complexity, recording the encoding parameters and corresponding quality indicators of each video frame, and generating encoding and quality data of the video frame; Extracting encoding parameters and corresponding quality indicators in differentiated scenarios from the encoding and quality data of the video frames, identifying factors affecting video quality through data analysis and comparison, and generating correlation analysis data between encoding parameters and video content characteristics; The data is analyzed by using the correlation between the encoding parameters and the characteristics of the video content, using the formula: Calculate the optimal value range of global encoding parameters and generate an optimized compression strategy; in, represents the optimal value range of the global encoding parameters, Represents the local parameters that affect the video encoding effect. represents a characteristic measure associated with changes in video content, Indicates the total number of referenced scenes.
6. A video surveillance data compression transmission system, characterized in that: The system is used to implement the video surveillance data compression and transmission method according to any one of claims 1 to 5, and the system includes: The video frame complexity analysis module extracts the pixel grayscale value of each video frame based on video surveillance data, calculates the grayscale gradient and edge density, extracts the color histogram, calculates the color discreteness, normalizes the grayscale gradient, edge density and color discreteness, and performs weighted summation to obtain the frame complexity score; The coding parameter determination module allocates initial coding parameters to each video frame according to the frame complexity score, sets a quantization step size, sets differential quantization step sizes for high-scoring frames and low-scoring frames, and generates an initial coding parameter set; The dynamic coding strategy module applies the initial coding parameter set to dynamically adjust the quantization step size of the video frame, monitors the frame complexity score change in real time, and if the score increases, reduces the quantization step size, and if the score decreases, increases the quantization step size, and adjusts the coding decision parameters at the same time to generate a coding adjustment plan; The video quality monitoring module encodes the video frame using the encoding adjustment scheme, calculates the peak signal-to-noise ratio and structural fit index of the encoded video and the original video, and compares them with the preset quality threshold. If the quality index is lower than the threshold, the quantization step size and encoding decision parameters are adjusted according to the frame complexity score to obtain real-time optimized encoding parameters; The global compression optimization module uses the real-time optimized encoding parameters, combined with the frame complexity score, to encode the video stream, count the encoding parameter values and quality indicators, analyze the relationship between the encoding parameters and the video content characteristics, adjust the global encoding parameter value range, and generate an optimized compression strategy.
Citation Information
Patent Citations
Video compression method and system based on variational auto-encoder improved entropy model
CN119011851A
Video coding and decoding acceleration method and system based on learnable task perception mechanism
CN119031147A