A security monitoring video encoding system with multi-scenario adaptive bitrate allocation
The security monitoring video encoding system with multi-scenario adaptive bitrate allocation solves the problems of wasted static scene storage resources and insufficient dynamic information on low-computing-power edge devices. It achieves adaptive encoding and efficient storage, is suitable for diverse scenarios, and reduces dependence on high-computing-power hardware.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN DONGRUN SYSTEM ENGINEERING CO LTD
- Filing Date
- 2026-06-01
- Publication Date
- 2026-06-30
AI Technical Summary
Existing security monitoring coding technologies struggle to achieve adaptive coding on low-computing-power edge devices, resulting in wasted static scene storage resources and insufficient retention of critical dynamic information. Furthermore, existing intelligent solutions have high computing power thresholds, limiting their widespread deployment on low-configuration edge devices.
The security monitoring video encoding system adopts multi-scenario adaptive bitrate allocation. Through data acquisition, feature extraction, feature fusion and window mapping modules, it delineates the moving target area and background area, quantifies the contrast, dynamic degree and individual anomaly feature values, and uses pooled windows for adaptive mapping and encoding to achieve adaptive bitrate video stream storage.
Adaptive encoding is implemented on low-computing-power devices, reducing storage resource consumption, improving scene compression ratio, and requiring no high-computing-power hardware support. It adapts to diverse scenarios and facilitates post-event traceability.
Smart Images

Figure CN122317271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image communication technology, and more specifically to a security monitoring video encoding system with multi-scenario adaptive bitrate allocation. Background Technology
[0002] Current security monitoring coding mainly uses fixed bitrate or variable bitrate technology based on deep learning. Among them, the fixed bitrate mode performs constant coding on the video stream according to preset thresholds such as 4Mbps, regardless of the dynamic or static state of the scene, and uniformly allocates bandwidth resources. However, this operation technology lacks scene adaptability and is prone to static redundancy. On the other hand, the intelligent coding scheme based on neural networks uses models such as CNN (Convolutional Neural Network) to extract scene features and dynamically adjust the bitrate. It relies on high computing power hardware, namely more than 10 GOPS (Giga Operations Per Second) for single-frame inference, and requires pre-training and deployment of dedicated models for different application scenarios such as roads and warehouses. In actual operation, due to the computing power threshold and the model customization requirements, its widespread deployment on low-end edge devices is limited.
[0003] Therefore, current security monitoring faces the dual dilemma of low efficiency due to fixed bitrates and high computational barriers for intelligent solutions. Existing technologies struggle to achieve effective adaptive encoding on low-computing-power edge devices, resulting in wasted storage of static scenes and insufficient retention of critical dynamic information. The main challenges lie in: how to optimize energy-intensive neural networks by utilizing lightweight image processing techniques to quantify contrast, dynamic range, and individual anomaly characteristics, and establish a mapping mechanism between these features and compression intensity; and how to overcome uniform compression limitations by implementing differentiated pooling strategies for background and moving targets within the same frame. Summary of the Invention
[0004] To address the technical problems of wasted storage resources and insufficient recording of critical dynamic information in existing security monitoring systems, this invention aims to provide a security monitoring video encoding system with multi-scenario adaptive bitrate allocation. The specific technical solution adopted is as follows: The data acquisition module is used to: acquire video streams based on monitoring equipment and establish grayscale frame sequences through preprocessing; The feature extraction module is used to: analyze grayscale frame sequences, delineate the moving target region and background region respectively, and extract contrast, dynamic range and individual anomaly quantification feature values in sequence; The feature fusion module is used to evaluate each quantified feature value to obtain a comprehensive importance. The window mapping module is used to: perform adaptive mapping of pooled windows based on comprehensive importance, determine the pooled window of the moving target region in the corresponding frame, and set the pooled window of the background region; The data encoding module is used to: encode the corresponding video for each region using a pooled window, and output and store the adaptive bitrate video stream in conjunction with a bitrate control strategy.
[0005] Preferably, based on the video stream acquired by the monitoring equipment, a grayscale frame sequence is established through preprocessing, specifically as follows: Set the acquisition parameters for the monitoring equipment, acquire the video stream, convert each color frame in the video stream to grayscale, and integrate them to create a grayscale frame sequence.
[0006] Preferably, the grayscale frame sequence is analyzed to delineate the moving target region and the background region, and contrast, dynamic range, and individual anomaly quantification feature values are extracted sequentially, including: For each frame in the grayscale frame sequence, a grayscale histogram is plotted, and the mean grayscale value is determined. The contrast quantization feature value is obtained by the degree of dispersion of the grayscale values. The moving target mask is obtained by analyzing the frame difference image of adjacent frames in the grayscale frame sequence. The moving target region and the background region are delineated respectively, and the dynamic degree quantization feature value is determined. Based on the analysis of the behavior patterns of the corresponding moving targets using moving target masks, quantitative feature values of individual anomalies are extracted.
[0007] Preferably, a moving target mask is obtained by analyzing the frame difference image of adjacent frames in the grayscale frame sequence, delineating the moving target region and the background region respectively, and determining the dynamic degree quantization feature value, including: Analyze the frame difference image of adjacent frames in the grayscale frame sequence, filter out the changing regions, obtain the moving target mask based on the changing regions, and delineate the moving target region and the background region respectively; The number of pixels corresponding to the changed areas is counted, and the dynamic level quantization feature value is determined by combining it with the total number of pixels in the corresponding frame.
[0008] Preferably, based on the analysis of the behavior pattern of the corresponding moving target using a moving target mask, individual anomaly quantification feature values are extracted, including: The connected components of the moving target mask are extracted and defined as the motion region of the moving target. Several corner points are extracted in each motion region, and trajectory tracking is performed based on the corner points to obtain the comprehensive motion trajectory of each moving target. The comprehensive motion trajectory is transformed into a multi-dimensional feature vector, which quantifies the motion characteristics of the corresponding moving target and determines abnormal and normal targets based on the motion characteristics. Individual anomaly quantification feature values are obtained based on the anomaly target.
[0009] Preferably, several corner points are extracted in each motion region, and trajectory tracking is performed based on the corner points to obtain the comprehensive motion trajectory of each moving target, specifically as follows: A corner detection algorithm is used to extract several corner points in the motion area. The trajectory of each corner point is tracked in multiple consecutive frames. The pixel coordinates corresponding to the successfully tracked corner points are selected, a coordinate sequence is established, and the comprehensive motion trajectory of the corresponding moving target is obtained by averaging the coordinate sequence.
[0010] Preferably, the comprehensive motion trajectory is transformed into a multi-dimensional feature vector to quantify the motion characteristics of the corresponding moving target. Based on these motion characteristics, abnormal and normal targets are identified. Specifically: The average speed, direction of motion, and trajectory curvature of each moving target are obtained by analyzing the comprehensive motion trajectory. These are then integrated to obtain a multi-dimensional feature vector. A historical trajectory feature pool is established, and cluster analysis is performed on all multi-dimensional feature vectors in the historical trajectory feature pool to label abnormal targets and normal targets respectively.
[0011] Preferably, the overall importance is evaluated for each quantified feature value, specifically as follows: Each quantization feature value is normalized, and a weight is set for each quantization feature value. The normalized quantization feature values are then summed using the weights to obtain the overall importance of the corresponding frame.
[0012] Preferably, adaptive mapping of pooling windows is performed based on comprehensive importance to determine the pooling window for the moving target region in the corresponding frame, and the pooling window for the background region is set, specifically as follows: The minimum and maximum sizes of the pooling windows are preset respectively. A linear mapping is used to combine the minimum and maximum sizes to transform the overall importance into the pooling window of the moving target region, and the maximum size is defined as the pooling window of the background region.
[0013] Preferably, a pooling window is used to encode the corresponding video for each region, and an adaptive bitrate video stream is output and stored in conjunction with a bitrate control strategy, including: The target region and background region are pooled separately using corresponding pooling windows, and edge processing is performed to establish a frame sequence after pooling. A video encoder is used to encode the pooled frame sequence, and corresponding bitrate priorities are assigned to the moving target area and the background area to obtain an adaptive bitrate video stream. Store the adaptive bitrate video stream to the monitoring equipment.
[0014] The present invention has the following beneficial effects: By integrating multiple modules, a security monitoring video encoding system with multi-scenario adaptive bitrate allocation is constructed. First, the video stream is preprocessed by quantizing and extracting quantitative feature values for contrast, dynamic range, and individual anomalies of each frame. Next, the overall importance is determined based on the quantized feature values. Then, adaptive size pooling is used to map the moving target area and background area, making scene adaptation flexible and adaptable to diverse scenarios such as campuses, warehouses, and intersections without changing the model. Finally, the moving target area and background area are encoded using corresponding pooling windows to obtain a video stream with an adaptive bitrate, which facilitates subsequent scene-specific storage. This not only helps with post-event traceability but also effectively reduces storage resource consumption and significantly improves scene compression ratio. In addition, the entire system only requires a CPU (Central Processing Unit) to run, completely eliminating the dependence on high-computing hardware such as GPUs (Graphics Processing Units), achieving over 90% compatibility with edge monitoring devices. Attached Figure Description
[0015] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic block diagram of a security monitoring video encoding system with multi-scenario adaptive bitrate allocation, provided as an embodiment of the present invention. Detailed Implementation
[0017] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a security monitoring video encoding system with multi-scene adaptive bitrate allocation proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0019] The following description, in conjunction with the accompanying drawings, details a specific scheme for a security monitoring video encoding system with multi-scenario adaptive bitrate allocation provided by the present invention.
[0020] To better illustrate, encoding security surveillance video involves using specific algorithms to convert the raw video stream into a compressed data stream of a specific format. This significantly reduces data size, facilitating efficient transmission and long-term stable storage of video content across various network environments. It also meets the needs of real-time analysis and intelligent processing, thereby improving the overall performance and response speed of the security system. Currently, there are two core challenges in security surveillance video encoding: first, how to optimize energy-intensive neural networks by utilizing lightweight image processing techniques to quantify contrast, dynamic range, and individual anomaly characteristics, and establish a mapping mechanism between these characteristics and compression intensity; second, how to overcome the limitations of uniform compression and implement differentiated pooling strategies for the background and moving targets within the same frame.
[0021] To address this technical deficiency, a multi-scenario adaptive bitrate allocation security monitoring video encoding system is proposed. This system implements a low-cost, customizable, and refined bitrate allocation method, balancing storage efficiency with the complete preservation of critical information under resource-constrained conditions. In its implementation, the system operates on an electronic device, including a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The processor calls logical instructions from the memory to execute instructions from various modules within the multi-scenario adaptive bitrate allocation security monitoring video encoding system. Whether the system and program data are integrated or different hardware is configured to produce functions similar to those achieved by this invention, all such implementations fall within the scope of protection of this invention.
[0022] Please see Figure 1 The diagram illustrates a schematic block diagram of a security monitoring video encoding system with multi-scenario adaptive bitrate allocation according to an embodiment of the present invention. The system includes: The data acquisition module is used to: acquire video streams based on monitoring equipment and establish grayscale frame sequences through preprocessing; The feature extraction module is used to: analyze grayscale frame sequences, delineate the moving target region and background region respectively, and extract contrast, dynamic range and individual anomaly quantification feature values in sequence; The feature fusion module is used to evaluate each quantified feature value to obtain a comprehensive importance. The window mapping module is used to: perform adaptive mapping of pooled windows based on comprehensive importance, determine the pooled window of the moving target region in the corresponding frame, and set the pooled window of the background region; The data encoding module is used to: encode the corresponding video for each region using a pooled window, and output and store the adaptive bitrate video stream in conjunction with a bitrate control strategy.
[0023] As an optional implementation, in this embodiment, the proposed system is designed for resource-constrained edge security monitoring environments with hardware devices such as outdoor bullet cameras, entry-level IPCs (Instructions Per Clock, i.e., the number of instructions executed in each clock cycle), and small NVRs (Network Video Recorders) that are only equipped with CPUs and have no GPU acceleration; and for variable monitoring scenarios such as community roads, logistics warehouses, and park entrances and exits that are sensitive to storage costs and need to retain details of key targets.
[0024] Furthermore, in the data acquisition module, based on the video stream acquired by the monitoring equipment, a grayscale frame sequence is established through preprocessing, specifically as follows: Set the acquisition parameters for the monitoring equipment, acquire the video stream, convert each color frame in the video stream to grayscale, and integrate them to create a grayscale frame sequence.
[0025] The explanation is that acquiring video streams means obtaining the raw frame data from the monitoring equipment, which provides the basic input for subsequent feature extraction. In other words, security monitoring video streams are continuous frame sequences, and timing information is the core basis for judging the degree of dynamics and the trajectory of the target. A frame-by-frame acquisition method is adopted to ensure the continuity of timing.
[0026] Specifically, by using monitoring equipment such as surveillance cameras or NVR devices, the acquisition parameters are set to a resolution of 1920×1080 and a frame rate of 25 frames per second, allowing for real-time acquisition of video streams. These parameters can be adjusted according to specific needs. Then, the acquisition time is recorded frame by frame. The obtained color frame is converted to a grayscale frame, denoted as . Its grayscale value range is , Indicates pure black. Represents pure white; grayscale frame image size is , Indicates the image width. Indicates the image height; if the acquisition time The corresponding color frame is the first frame, that is Store directly as the initial background frame That is, in the embodiments of the present invention It also includes the corresponding acquisition time index information; grayscale conversion eliminates redundant information in the color channels, reducing the processing complexity of subsequent calculations, based on the acquisition time. Similarly, all color frames in the video stream are converted to grayscale frames to obtain a continuous grayscale frame sequence that can be used for feature analysis, denoted as . .
[0027] Understandably, core features are extracted based on grayscale frame sequences to quantify the visual importance of an image. Among these features, contrast reflects the difference in brightness and darkness of the image, which can reflect the ability to distinguish between details and background; dynamics reflects the activity of the scene and can assess the salience of motion information; and individual anomaly reflects the deviation of the target, i.e., the behavior of moving targets in the image, to quantify the visual salience and information value of the image in the time dimension.
[0028] Furthermore, in the feature extraction module, the grayscale frame sequence is analyzed to delineate the moving target region and the background region, and then the contrast, dynamic range, and individual anomaly quantification feature values are extracted sequentially, including: Step S21: Calculate the grayscale histogram for each frame in the grayscale frame sequence and determine the grayscale mean. Obtain the contrast quantization feature value by the degree of dispersion of the grayscale value.
[0029] The explanation is that contrast feature extraction is performed on areas with higher contrast, such as targets under strong light or reflective objects at night, which are areas with more significant differences in brightness and darkness. These areas exhibit higher information density, richer texture and edge information, and greater visual information, requiring the preservation of more details.
[0030] Specifically, the current analysis frame is defined as the [number]th [frame]. The grayscale frame, firstly, for the grayscale frame Statistical grayscale histogram, denoted as This indicates that the grayscale value is... The number of pixels, and The process involves initializing a one-dimensional array of 256 elements based on a grayscale frame as a histogram container. Each array element represents the number of pixels at a corresponding grayscale level. By iterating through each pixel in the grayscale frame to obtain its corresponding grayscale value, the count of the array element corresponding to that grayscale value is incremented by 1. After traversing the entire grayscale frame, the distribution of values in the array is statistically analyzed to obtain the grayscale histogram corresponding to that grayscale frame. Next, the grayscale frame is calculated... The average gray level, i.e. , Indicates the grayscale value index; Represents grayscale frames The total number of pixels in the image; the contrast quantization feature value is obtained by the degree of dispersion of grayscale values, and the corresponding calculation formula is: in, Indicates the current grayscale frame The contrast quantization feature value.
[0031] It can be explained that, based on the process of determining the contrast quantization feature value, the larger the standard deviation, the more obvious the difference between pixel brightness and darkness, and the higher the contrast. Furthermore, the contrast quantization feature value... The theoretical scope is That is, contrast quantization feature value The larger the value, the higher the grayscale frame being analyzed. The greater the contrast between light and dark, the richer the details.
[0032] Step S22: Analyze the frame difference image of adjacent frames in the grayscale frame sequence to obtain the moving target mask, delineate the moving target region and background region respectively, and determine the dynamic degree quantization feature value.
[0033] To clarify, in a grayscale frame sequence, the greater the pixel difference between frames, the more likely it is that there is a moving target or a sudden change in lighting in the scene. The higher the dynamic range, that is, the greater the difference between frames, the greater the amplitude of the movement and change in the picture. This is because in subsequent video encoding, more dynamic details need to be valued and preserved to ensure that the picture is smooth and clear.
[0034] Further, step S22 includes: Step S221: Analyze the frame difference image of adjacent frames in the grayscale frame sequence, filter out the changing regions, obtain the moving target mask based on the changing regions, and delineate the moving target region and the background region respectively.
[0035] Specifically, still using the grayscale frame currently being analyzed Expanding on the explanation, calculating grayscale frames With the adjacent previous grayscale frame The frame difference image, i.e. , Represents the frame difference image; Represents pixel coordinates; , Representing grayscale frames respectively and Mid-pixel coordinates The corresponding pixels; This represents absolute value operations. A preset frame difference threshold is denoted as... Its default value is usually 20, but it can be adjusted to 10 in low-light scenes. The specific setting can be adjusted according to the actual situation; compare frame difference images. The pixel value corresponding to each pixel coordinate and the frame difference threshold ,filter The pixels are then processed and integrated to construct the variable region. Next, a morphological opening operation (erosion followed by dilation) is performed on the variable region to eliminate isolated noise points caused by noise, minute light fluctuations, etc., resulting in a cleaner moving target mask, denoted as . The target area is... The corresponding pixels; the background area is The corresponding pixels.
[0036] Step S222: Count the number of pixels corresponding to the changed area, and determine the dynamic degree quantization feature value by combining it with the total number of pixels in the corresponding frame.
[0037] Specifically, the number of pixels is counted based on the changed region, denoted as... The grayscale frame currently being analyzed The total number of pixels is The dynamic degree quantification feature value is obtained, and the corresponding calculation formula is: in, Indicates the current grayscale frame The dynamic degree of the quantified feature value.
[0038] It can be explained that the dynamic degree quantifies the feature value. The corresponding range is It is determined by the percentage of pixels in the changing area. The larger the value, the larger the proportion of the area occupied by the moving target that has undergone displacement, deformation or other forms of change in the scene, and the higher the dynamic level.
[0039] Step S23: Analyze the behavior pattern of the corresponding moving target based on the moving target mask, and extract the quantitative feature value of individual anomalies.
[0040] To clarify, based on the moving target mask obtained in the aforementioned steps, the behavior pattern of the corresponding moving target is analyzed. If the movement trajectory of the running target suddenly running, going against the flow, or wandering is contrary to the recent group behavior pattern, it is considered abnormal. Abnormal individuals in security monitoring video streams usually indicate potential security incidents, and key information that needs to be prioritized and preserved in video encoding should be given priority.
[0041] Furthermore, step S23 includes: Step S231: Extract connected components from the moving target mask and define them as the motion region of the moving target. Extract several corner points in each motion region and perform trajectory tracking based on the corner points to obtain the comprehensive motion trajectory of each moving target.
[0042] Explanation: Based on the moving target mask Extracting its connected components yields pixel regions that reflect the position and shape of the moving target. Each connected component is labeled as an independent moving target, denoted as . , Indicates the current grayscale frame Index of moving targets within, , Indicates the current grayscale frame The total number of moving targets in the dataset; and define each connected component as the motion region of the corresponding moving target.
[0043] Further, in step S231, several corner points are extracted in each motion region, and trajectory tracking is performed based on the corner points to obtain the comprehensive motion trajectory of each moving target, specifically as follows: A corner detection algorithm is used to extract several corner points in the motion area. The trajectory of each corner point is tracked in multiple consecutive frames. The pixel coordinates corresponding to the successfully tracked corner points are selected, a coordinate sequence is established, and the average of the coordinate sequence is performed to obtain the comprehensive motion trajectory of the corresponding moving target.
[0044] Specifically, with the goal of movement The corresponding motion region is analyzed by employing the Shi-Tomasi corner detection algorithm to extract significant corners. This algorithm identifies corners by analyzing the intensity of grayscale changes caused by minute movements of local image windows in various directions. To balance computational efficiency and trajectory representativeness, a maximum of the first few corners are extracted from each motion region. At each corner point, the Lucas-Kanade optical flow method was used to continuously analyze the optical flow at each corner point. Frame-based trajectory tracking is performed, which involves accurately estimating the motion trajectory of a moving target between adjacent frames by minimizing the motion error of all pixels in the neighborhood; in this embodiment, , It can be adjusted according to the actual situation.
[0045] Next, the pixel coordinates corresponding to the successfully tracked corner points are selected, and a coordinate sequence is established, which involves traversing the extracted... Each corner point is tracked independently. If any corner point fails to obtain a complete image due to occlusion, moving out of the image boundary, or optical flow calculation failure during the tracking process, the tracking will be incomplete. If the frame coordinate sequence is not obtained, the corner point is considered to have failed to be tracked and will be removed from subsequent analysis; conversely, if a complete coordinate sequence is obtained, the corner point is considered to have been successfully tracked, and the moving target can then be selected. For all successfully tracked corner points, the corner point trajectories fed back by the coordinate sequence are averaged to obtain the moving target. The comprehensive motion trajectory, namely This effectively improves the robustness of trajectory tracking.
[0046] Step S232: Convert the comprehensive motion trajectory into a multi-dimensional feature vector, quantify the motion characteristics of the corresponding moving target, and judge abnormal targets and normal targets based on the motion characteristics.
[0047] Provide an explanation, focusing on the goals of the sport. The corresponding comprehensive motion trajectory is explained by converting it sequentially into average speed, direction of motion, and trajectory curvature, and integrating them to establish a multi-dimensional feature vector to quantify the motion characteristics of the moving target. Average speed effectively reflects the speed and overall efficiency of the moving target; direction of motion clarifies the orientation of the moving target's path; and trajectory curvature quantifies the tortuosity and complexity of the trajectory, revealing the flexibility and path stability of the moving target during motion. Then, based on the multi-dimensional feature vector, an unsupervised clustering algorithm (DBSCAN, Density-Based Spatial Clustering of Applications with Noise) is used to adaptively filter abnormal targets without pre-defining normal and abnormal categories.
[0048] Furthermore, in step S232, specifically: The average speed, direction of motion, and trajectory curvature of each moving target are obtained by analyzing the comprehensive motion trajectory. These are then integrated to obtain a multi-dimensional feature vector. A historical trajectory feature pool is established, and cluster analysis is performed on all multi-dimensional feature vectors in the historical trajectory feature pool to label abnormal targets and normal targets respectively.
[0049] Specifically, based on motion targets Corresponding comprehensive motion trajectory A detailed analysis is conducted, where the average velocity is the velocity of the moving target in continuous motion. The ratio of the total displacement distance within the frame window to the time is calculated using the following formula: in, Indicates the current grayscale frame Medium movement target The average speed; , Both represent motion targets. Comprehensive motion trajectory Pixel coordinates in; Indicates the size of the consecutive frame window used for trajectory tracking; This indicates the single-frame interval.
[0050] The direction of motion is the direction of the moving target in continuous motion. The overall motion direction angle within the frame window is calculated using the following formula: in, Indicates the current grayscale frame Medium movement target The direction of movement; This represents the function used to calculate the arctangent value between pixel coordinates.
[0051] The trajectory curvature is the ratio of the total actual path length of the comprehensive motion trajectory to the straight-line distance between the beginning and end. It is used to quantify the degree of curvature of the trajectory, and the corresponding calculation formula is: in, Indicates the current grayscale frame Medium movement target The curvature of the trajectory; Indicates the grayscale frame index; Indicates the first grayscale frames The pixel coordinates of the moving target. Indicates the first grayscale frames The pixel coordinates of the moving target.
[0052] It should be noted that, to ensure the validity of the analysis data corresponding to the moving target, the size of the continuous frame window for trajectory tracking is... It must be greater than and equal to 1, and the single-frame interval is... In addition, because of the comprehensive motion trajectory The coordinates of each pixel in the image are dynamically changing, therefore There is no case where the value is 0, in order to ensure the stability of the calculation.
[0053] Next, integrate the goals of the movement. The average velocity, direction of motion, and trajectory curvature are used to obtain a multidimensional feature vector, denoted as […]. Then, based on the grayscale frame Similarly, all moving targets in each grayscale frame of the grayscale frame sequence are obtained, and then based on the moving targets... By performing relevant analysis, the multidimensional feature vectors of all moving targets in the corresponding grayscale frame are obtained.
[0054] Establish a historical trajectory feature pool, that is, based on grayscale frame sequences, store the most recent... The multidimensional feature vectors of all moving targets within a frame are denoted as follows: In this embodiment, It can be specifically configured according to actual conditions; the DBSCAN algorithm is used to perform cluster analysis on all multidimensional feature vectors in the historical trajectory feature pool. That is, based on the distribution characteristics and domain knowledge of multidimensional feature vectors, the neighborhood radius and minimum number of contained points are reasonably set. By calculating the Euclidean distance or Manhattan distance between pairwise multidimensional feature vectors, core points, boundary points and noise points are determined respectively, and iterative expansion is performed to form density-connected clusters; among them, in the grayscale frame currently being analyzed In the process, moving targets identified as noise points, i.e., moving targets that do not belong to any cluster, are considered to have trajectories that do not conform to recent normal behavior patterns and are marked as abnormal targets. Conversely, moving targets belonging to any cluster in this grayscale frame are considered normal targets, i.e. .
[0055] Step S233: Obtain individual anomaly quantification feature values based on the anomaly target.
[0056] Specifically, the individual anomaly quantification feature value is used to quantify the overall anomaly level in each frame, referring to the proportion of anomalous targets to the total number of moving targets in that frame. The corresponding calculation formula is: in, Indicates the current grayscale frame Individual anomaly quantification feature values; Indicates the current grayscale frame Index of moving targets within; Indicates the current grayscale frame The total number of moving targets in the process; This indicates whether the target is normal or abnormal after being marked.
[0057] It can be explained that the normal target is The abnormal target is Therefore The corresponding number of abnormal targets in this grayscale frame Corresponding individual anomaly quantification feature value The range of values is The larger this value is, the higher the proportion of abnormal targets in the current grayscale frame, which in turn indicates that the possibility of abnormal events occurring in the scene is greater.
[0058] In particular, during actual analysis, grayscale frames... There may be no moving target within the frame, meaning the target mask may be moving within the frame. Since there are no connected components, there are no normal or abnormal targets, so we can define them directly. This is to ensure the reliability of the entire analysis process.
[0059] Understandably, the focus of attention differs for different monitoring scenarios such as campuses or warehouses. For example, at the school gate, priority should be given to monitoring abnormal personnel, so the corresponding individual anomaly quantification feature value has a higher weight. In contrast, in a warehouse, more attention should be paid to moving goods, so the corresponding dynamic degree quantification feature value has a higher weight. Therefore, by introducing scenario-based weights, a comprehensive importance can be obtained to ensure that subsequent calculations are more targeted, thereby achieving scenario-adaptive control.
[0060] Furthermore, in the feature fusion module, the overall importance of each quantized feature value is evaluated, specifically as follows: Each quantization feature value is normalized, and a weight is set for each quantization feature value. The normalized quantization feature values are then summed using the weights to obtain the overall importance of the corresponding frame.
[0061] Specifically, before weighted fusion, normalization is used to map the quantized feature values of different dimensions to a unified value range. Within, based on the current grayscale frame Corresponding contrast quantization feature value Dynamic degree quantification feature value and individual anomaly quantification features The explanation includes the use of a min-max normalization method to process the contrast quantization feature values. ,Right now , Indicates the current grayscale frame Normalized contrast quantization feature values; , These represent the maximum and minimum contrast quantization feature values in the historical statistics of the current analysis scenario; and the dynamic level quantization feature value. and individual anomaly quantification features The range of values itself is The dynamic degree quantification feature value after normalization processing Normalized individual anomaly metric feature values .
[0062] Next, based on the different monitoring scenarios, a weight is set for each quantized feature value, which is denoted as the contrast weight. Dynamic degree weight and anomaly weight And the weighting coefficients satisfy the constraints. To better illustrate this, let's assume the current monitoring scenario is at a school gate. In this scenario, we need to pay more attention to suspicious individuals, so the weight is set to... , and When the monitoring scenario is a warehouse, more attention needs to be paid to the movement of goods, and the weight setting should be... 3. and That is, the weight settings should be adjusted according to the specific monitoring scenario.
[0063] Then, the normalized quantized feature values are weighted and summed to obtain the current grayscale frame. The overall importance is calculated using the following formula: in, Indicates the current grayscale frame Overall importance; , , These represent the contrast weight, dynamic range weight, and anomaly weight, respectively. , , These represent the contrast quantization feature value, dynamics quantization feature value, and individual anomaly quantization feature value after normalization, respectively.
[0064] It can be explained that the overall importance The range of values is The larger the value, the higher the visual priority of the corresponding frame, meaning it makes a significant contribution to the overall perceived quality of the video. More details should be retained in subsequent video encoding. By analyzing the importance of frames through data quantification, we can ensure that encoding resources are tilted towards content that truly affects the viewing experience.
[0065] Understandably, mapping the overall importance to the window size of the pooling operation enables an adaptive strategy where higher importance results in a lower compression ratio, meaning more details are preserved. Specifically, a larger pooling window leads to a higher compression ratio and a lower bitrate, eliminating pixel differences within the window and resulting in a smaller encoded data size. Conversely, a smaller window leads to a lower compression ratio, more complete detail preservation, and improved fidelity of detail information.
[0066] Furthermore, in the window mapping module, adaptive mapping of pooled windows is performed based on comprehensive importance to determine the pooled window for the moving target region in the corresponding frame, and the pooled window for the background region is set, specifically as follows: The minimum and maximum sizes of the pooling windows are preset respectively. A linear mapping is used to combine the minimum and maximum sizes to transform the overall importance into the pooling window of the moving target region, and the maximum size is defined as the pooling window of the background region.
[0067] Specifically, the minimum and maximum sizes of the preset pooling window are denoted as follows: and In this embodiment, This refers to the minimum compression ratio; Both the maximum compression ratio and the pooling window are adjustable based on specific needs; the pooling window is square, with its side length expressed in pixels. Then, a linear mapping is used to transform the overall importance into a pooling window for the moving target region. The corresponding calculation formula is: in, Indicates the current grayscale frame Pooling window for China Mobile's target region; Indicates the minimum size of the pooling window; Indicates the maximum size of the pooling window; Indicates the current grayscale frame Overall importance; This indicates the floor function.
[0068] It can be explained that the overall importance The larger, Conversely, the smaller the pooling window of the moving target region, the better. The closer to the minimum size This achieves a low compression ratio and high detail retention; conversely, The smaller, The larger the pooling window of the target region, the more it moves. The closer to the maximum size The higher the compression ratio, the lower the bitrate.
[0069] Next, since the background area does not change dynamically, to maximize compression efficiency, the maximum size of the pooling window is fixed, i.e. , Indicates the current grayscale frame The pooling window in the background region completes the adaptive mapping process of the pooling window between the moving target region and the background region.
[0070] Understandably, different pooling windows are used for the background region and the moving target region in the same frame image to achieve fine compression, and then the bitrate is optimized by conventional video coding standards. That is, for the background region, since there is usually no significant dynamic change, the maximum size of the pooling window is used to reduce the amount of data; for the moving target region, the pooling window determined in the aforementioned steps is used to achieve a balance between preserving key details and improving storage efficiency.
[0071] Furthermore, in the data encoding module, a pooling window is used to perform corresponding video encoding on the regions, and an adaptive bitrate video stream is output and stored in conjunction with a bitrate control strategy, including: Step S51: Use the corresponding pooling window to pool the moving target region and the background region respectively, and perform edge processing to establish the frame sequence after pooling.
[0072] Specifically, firstly, regarding the background area, i.e. the moving target mask... The maximum size of the pooled window It iterates through the current frame image, replacing the pixel values within each pooling window with the average grayscale value of all pixels within that pooling window; then, for the moving target region, i.e., the moving target mask... Using pooled windows The current analysis frame image is traversed, and the pixel values in each pooling window are replaced with the grayscale mean. Then, if some pixels exceed the boundaries of the current frame image during the pooling window processing, the grayscale mean is calculated only for the pixels inside the image within the pooling window to avoid introducing invalid pixel values. The pooling processing of all grayscale frames in the grayscale frame sequence is determined in the same way according to this process to obtain the pooled frame sequence.
[0073] Step S52: Encode the pooled frame sequence using a video encoder, assign corresponding bitrate priorities to the moving target area and the background area, and obtain an adaptive bitrate video stream.
[0074] To clarify, a video encoder typically refers to a hardware or software device that uses algorithms to compress and transform raw video streams to generate digital video streams with smaller file sizes and more efficient transmission and storage. In other words, by removing redundant information such as spatial redundancy, temporal redundancy, and visual redundancy from video data, the bit rate of video files is significantly reduced while maintaining a certain level of visual quality.
[0075] Specifically, the pooled frame sequence is input into the video encoder; encoding is performed using the H.265 / HEVC (High Efficiency Video Coding) standard, and during the encoding process, a bitrate control strategy is used to allocate a lower bitrate priority to the background area and a higher bitrate priority to the moving target area. After encoding is completed, an adaptive bitrate video stream is obtained, in which the moving target area retains more details, while the background area is efficiently compressed; then, regional pooling and corresponding encoding are completed, and the optimized video bitstream is output.
[0076] Step S53: Store the adaptive bitrate video stream to the monitoring device.
[0077] To clarify, in practice, the adaptive bitrate video stream is stored in the storage device of the monitoring equipment, while retaining metadata for subsequent retrieval and traceability. The storage device usually refers to conventional storage applications such as hard drives and cloud storage, all of which are compatible with H.265 bitrate streams. The metadata can quickly locate abnormal frames.
[0078] Specifically, the optimized video stream is stored on the local NVR hard drive or cloud storage unit, and frame-level metadata, including the frame number of the current grayscale frame, is stored synchronously. Number of moving targets in this frame Pixel location and overall importance of the abnormal target This enables efficient storage of video streams, and the metadata supports rapid retrieval of abnormal frames, reducing the time cost of post-event tracing. This completes the adaptive bitrate encoding and storage process for the entire security monitoring video, achieving a balance between storage efficiency and the preservation of key details.
[0079] Understandably, by integrating multiple modules, a security monitoring video encoding system with multi-scenario adaptive bitrate allocation is constructed. First, the video stream is preprocessed by quantizing and extracting quantitative feature values for image contrast, dynamic range, and individual anomalies in each frame. Next, the overall importance is determined based on the quantized feature values. Then, adaptive size pooling is used to map the moving target area and background area, making scene adaptation flexible and requiring no model change. By adjusting the weights, it can adapt to diverse scenes such as campuses, warehouses, and intersections. Finally, the corresponding pooling window is used to encode the moving target area and background area to obtain a video stream with an adaptive bitrate. This facilitates subsequent scene-specific storage, which not only helps with post-event traceability but also effectively reduces storage resource consumption and significantly improves scene compression ratio. In addition, the entire system can run with only CPU, completely eliminating the dependence on high-computing hardware such as GPUs, and achieving over 90% compatibility with edge monitoring devices.
[0080] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0081] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A multi-scenario adaptive bit rate allocation security monitoring video encoding system, characterized in that, The system includes: The data acquisition module is used to: acquire video streams based on monitoring equipment and establish grayscale frame sequences through preprocessing; The feature extraction module is used to: analyze grayscale frame sequences, delineate the moving target region and background region respectively, and extract contrast, dynamic range and individual anomaly quantification feature values in sequence; The feature fusion module is used to evaluate each quantified feature value to obtain a comprehensive importance. The window mapping module is used to: perform adaptive mapping of pooled windows based on comprehensive importance, determine the pooled window of the moving target region in the corresponding frame, and set the pooled window of the background region; The data encoding module is used to: encode the corresponding video for each region using a pooled window, and output and store the adaptive bitrate video stream in conjunction with a bitrate control strategy.
2. The security monitoring video coding system with multi-scene adaptive bit rate allocation according to claim 1, characterized in that, Based on video streams acquired by monitoring equipment, a grayscale frame sequence is established through preprocessing, specifically as follows: Set the acquisition parameters for the monitoring equipment, acquire the video stream, convert each color frame in the video stream to grayscale, and integrate them to create a grayscale frame sequence.
3. The security monitoring video coding system with multi-scene adaptive bit rate allocation according to claim 1, characterized in that, Analyze the grayscale frame sequence, delineate the moving target region and background region respectively, and extract quantitative feature values of contrast, dynamic range, and individual anomalies in sequence, including: For each frame in the grayscale frame sequence, a grayscale histogram is plotted, and the mean grayscale value is determined. The contrast quantization feature value is obtained by the degree of dispersion of the grayscale values. The moving target mask is obtained by analyzing the frame difference image of adjacent frames in the grayscale frame sequence. The moving target region and the background region are delineated respectively, and the dynamic degree quantization feature value is determined. Based on the analysis of the behavior patterns of the corresponding moving targets using moving target masks, quantitative feature values of individual anomalies are extracted.
4. The security monitoring video coding system with multi-scene adaptive bit rate allocation according to claim 3, characterized in that, A moving target mask is obtained by analyzing the frame difference image of adjacent frames in a grayscale frame sequence. The moving target region and the background region are delineated respectively, and the dynamic level quantization feature values are determined, including: Analyze the frame difference image of adjacent frames in the grayscale frame sequence, filter out the changing regions, obtain the moving target mask based on the changing regions, and delineate the moving target region and the background region respectively; The number of pixels corresponding to the changed areas is counted, and the dynamic level quantization feature value is determined by combining it with the total number of pixels in the corresponding frame.
5. A security monitoring video encoding system with multi-scenario adaptive bitrate allocation according to claim 3, characterized in that, Based on moving target mask analysis, the behavioral patterns of corresponding moving targets are analyzed, and individual anomaly quantification feature values are extracted, including: The connected components of the moving target mask are extracted and defined as the motion region of the moving target. Several corner points are extracted in each motion region, and trajectory tracking is performed based on the corner points to obtain the comprehensive motion trajectory of each moving target. The comprehensive motion trajectory is transformed into a multi-dimensional feature vector, which quantifies the motion characteristics of the corresponding moving target and determines abnormal and normal targets based on the motion characteristics. Individual anomaly quantification feature values are obtained based on the anomaly target.
6. A security monitoring video encoding system with multi-scenario adaptive bitrate allocation according to claim 5, characterized in that, Several corner points are extracted from each motion region, and trajectory tracking is performed based on these corner points to obtain the comprehensive motion trajectory of each moving target, specifically: A corner detection algorithm is used to extract several corner points in the motion area. The trajectory of each corner point is tracked in multiple consecutive frames. The pixel coordinates corresponding to the successfully tracked corner points are selected, a coordinate sequence is established, and the average of the coordinate sequence is performed to obtain the comprehensive motion trajectory of the corresponding moving target.
7. A security monitoring video encoding system with multi-scenario adaptive bitrate allocation according to claim 5, characterized in that, The comprehensive motion trajectory is transformed into a multi-dimensional feature vector to quantify the motion characteristics of the corresponding moving target. Based on these motion characteristics, abnormal and normal targets are identified. Specifically: The average speed, direction of motion, and trajectory curvature of each moving target are obtained by analyzing the comprehensive motion trajectory. These are then integrated to obtain a multi-dimensional feature vector. A historical trajectory feature pool is established, and cluster analysis is performed on all multi-dimensional feature vectors in the historical trajectory feature pool to label abnormal targets and normal targets respectively.
8. A security monitoring video encoding system with multi-scenario adaptive bitrate allocation according to claim 1, characterized in that, The overall importance is evaluated for each quantified feature value, specifically as follows: Each quantization feature value is normalized, and a weight is set for each quantization feature value. The normalized quantization feature values are then summed using the weights to obtain the overall importance of the corresponding frame.
9. A security monitoring video encoding system with multi-scenario adaptive bitrate allocation according to claim 1, characterized in that, Based on comprehensive importance, adaptive mapping of pooling windows is performed to determine the pooling window for the moving target region in the corresponding frame, and the pooling window for the background region is set, specifically as follows: The minimum and maximum sizes of the pooling windows are preset respectively. A linear mapping is used to combine the minimum and maximum sizes to transform the overall importance into the pooling window of the moving target region, and the maximum size is defined as the pooling window of the background region.
10. A security monitoring video encoding system with multi-scenario adaptive bitrate allocation according to claim 1, characterized in that, The system employs pooled windows to encode corresponding video streams for different regions, and uses a bitrate control strategy to output and store an adaptive bitrate video stream, including: The target region and background region are pooled separately using corresponding pooling windows, and edge processing is performed to establish a frame sequence after pooling. A video encoder is used to encode the pooled frame sequence, and corresponding bitrate priorities are assigned to the moving target area and the background area to obtain an adaptive bitrate video stream. Store the adaptive bitrate video stream to the monitoring equipment.