Video secure transmission method, device and system in low-bandwidth scene
By identifying and optimizing the Region of Interest (ROI) and activity level in low-bandwidth video transmission, and combining this with a Gaussian kernel function to smooth the bitrate allocation, the problems of image quality jumps and visual flicker in ROI regions were solved, achieving high-quality video transmission effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-06
- Publication Date
- 2026-04-07
AI Technical Summary
In low-bandwidth environments, ROI-based encoding techniques can cause image quality jumps and visual flickering between ROI and non-ROI areas when moving targets move rapidly or scenes change in the video frame, affecting the subjective quality and usability of the video.
By identifying the motion regions of each frame, analyzing their ROI and activity inertia, constructing a smoothing matrix using a Gaussian kernel function, and optimizing bitrate allocation to maximize motion region quality and minimize quality jumps between regions, a Gaussian kernel function is used to smooth the bitrate increase factor, and dynamic bitrate allocation is performed in conjunction with real-time network bandwidth.
It effectively suppresses visual discontinuities between frames, improves the subjective quality and usability of video, and enables secure and reliable video transmission under low bandwidth conditions.
Smart Images

Figure CN121814958A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video transmission technology, and specifically to a method, apparatus, and system for secure video transmission in low-bandwidth scenarios. Background Technology
[0002] Secure video transmission refers to using technologies such as encryption, authentication, and integrity verification to ensure that video data is not stolen, tampered with, or illegally accessed during transmission, achieving end-to-end confidentiality and reliability. Low-bandwidth scenarios often correspond to critical application areas such as telemedicine, security monitoring, and military communications. These scenarios have extremely high requirements for the clarity and real-time performance of video content; degraded image quality can lead to serious consequences such as misdiagnosis and misjudgment. Therefore, video transmission quality directly affects user experience and business value; ensuring video transmission quality under limited bandwidth resources is crucial.
[0003] In low-bandwidth environments, video transmission typically employs ROI (Region of Interest)-based coding techniques. First, using inter-frame differential encoding combined with motion analysis, motion regions in the video sequence are identified to determine the ROIs. Then, high-quality coding parameters are applied to the ROIs, while high-compression coding strategies are used for non-ROIs. The bitrate distribution ratio between ROIs and non-ROIs is dynamically adjusted based on real-time network bandwidth changes to ensure critical areas remain clear even with limited bandwidth. Finally, after encoding, end-to-end encryption is applied to the video stream, and forward error correction and adaptive bitrate transmission mechanisms are introduced to enhance the video data transmission's resilience to packet loss and its dynamic adaptability, thereby achieving reliable and secure video transmission.
[0004] In existing technologies, ROI-based encoding techniques typically allocate higher bitrates and resolutions to key regions of a video (such as moving objects), while applying stronger compression to non-critical background regions. However, when moving targets in a video frame experience rapid movement, occlusion, or scene changes, the detection and segmentation of ROI regions may change frequently. If the encoding system directly follows these changes and immediately switches the bitrate allocation strategy for different regions, it can easily lead to noticeable quality jumps and visual flickering between adjacent frames at the ROI and non-ROI boundaries. In severe cases, this can even affect the viewer's continuous perception and understanding of key information. Especially in low-bandwidth environments, where bitrate resources are already limited, quality differences between regions are more easily perceived by the human eye, thus reducing the overall subjective quality and usability of the video. Summary of the Invention
[0005] To address the above-mentioned technical problems, the present invention aims to provide a method, apparatus, and system for secure video transmission in low-bandwidth scenarios.
[0006] According to a first aspect of the embodiments of this application, a method for secure video transmission in low-bandwidth scenarios is provided, and the specific technical solution adopted is as follows: Acquire video data, identify the motion region of each frame, and obtain the ROI of the motion region; Based on the time distance between historical frame images and the current frame image, and combined with the ROI property, the influence weight of historical frame images on the current frame image is obtained, and then the activity inertia of the motion region is analyzed to determine the bitrate increase factor of each motion region in the current frame image. Analyze the spatial centrality of each motion region, and combine it with the bitrate increase factor to determine the weight of each motion region in the smoothing matrix in the current frame image; Based on the weights and combined with the Gaussian kernel function, a smoothing matrix is constructed for all motion regions in the current frame image, and a bitrate increase factor is smoothed for each motion region in the current frame image. Based on the bitrate increase factor after motion region smoothing and the ROI property, an objective function is designed with the goal of maximizing motion region quality and minimizing quality jumps between motion regions. The relative bitrate weight of each motion region in the current frame image is determined, and bitrate allocation and video data encoding are performed for each motion region in the current frame image.
[0007] In some embodiments of the present invention, analyzing the activity inertia of the motion region to determine the bitrate increase factor for each motion region in the current frame image includes: For historical multi-frame images, the proportion of the influence weight corresponding to each historical frame image in all historical frame images is obtained, the ROI weight of the motion region in each historical frame image is weighted, and the bitrate increase factor of each motion region in the current frame image is determined.
[0008] In some embodiments of the present invention, the spatial centrality of each motion region is analyzed, including: Obtain the center points of all motion regions in the current frame image, and perform a weighted average of the center points of the regions based on the ROI property to determine the total center point of the current frame image. Analyze the distance relationship between the regional center point of each motion region and the total center point to determine the spatial centrality of each motion region.
[0009] In some embodiments of the present invention, a smoothing matrix for all motion regions in the current frame image is constructed based on the weights and in conjunction with a Gaussian kernel function, including: Obtain the coordinates of the center point of the motion region and calculate the spatial distance matrix between all motion regions in the current frame image; Apply a Gaussian kernel function to the spatial distance matrix to generate a Gaussian weight matrix corresponding to all the motion regions in the current frame image; By weighting the Gaussian weight matrix according to the weight of each motion region in the smoothing matrix, a smoothing matrix for all motion regions in the current frame image is constructed.
[0010] In some embodiments of the present invention, smoothing the bitrate increment factor for each motion region in the current frame image includes: Based on the bitrate increase factor of the motion region, construct a bitrate increase factor vector for all motion regions in the current frame image; Multiply the smoothing matrix by the bitrate increase factor vector to smooth the bitrate increase factor of each motion region in the current frame image, and obtain the smoothed bitrate increase factor of each motion region in the current frame image.
[0011] In some embodiments of the present invention, maximizing the quality of the motion region includes: Using a logarithmic model, we define the coding quality function for each motion region in the current frame image at different bit rates; Based on the coding quality function, combined with the bitrate increase factor after motion region smoothing and the ROI property, the objective of maximizing motion region quality is determined.
[0012] In some embodiments of the present invention, minimizing the mass jump between motion regions is the objective, including: Based on the encoded quality function, the quality difference between each motion region and its neighboring motion regions in the current frame image is analyzed to ensure that the sum of the quality differences corresponding to all motion regions in the current frame image is minimized, and the objective of minimizing the quality jump between motion regions is determined.
[0013] In some embodiments of the present invention, an objective function is designed with the goal of maximizing motion region quality and minimizing quality jumps between motion regions, and the relative bitrate weight of each motion region in the current frame image is determined, including: By balancing parameters, the objective function is determined by fusing the objective of maximizing the quality of the motion region with the objective of minimizing the quality jump between motion regions. The objective function is solved using the Lagrange multiplier method. Constraints such as the total bit rate being less than the total bit rate budget and the minimum bit rate guarantee are set to determine the relative bit rate weight of each motion region in the current frame image.
[0014] According to a second aspect of the embodiments of this application, a video security transmission device for low-bandwidth scenarios is provided, the device comprising: The motion region recognition module is used to collect video data, identify the motion region of each frame of image, and obtain the ROI of the motion region; The bitrate increase factor analysis module is used to obtain the influence weight of the historical frame image on the current frame image based on the time distance between the historical frame image and the current frame image, combined with the ROI property, and then analyze the activity inertia of the motion region to determine the bitrate increase factor of each motion region in the current frame image. The bitrate increase factor smoothing module is used to analyze the spatial centrality of each motion region, and in combination with the bitrate increase factor, determine the weight of each motion region in the current frame image in the smoothing matrix; and based on the weight, combined with the Gaussian kernel function, construct a smoothing matrix for all motion regions in the current frame image, and smooth the bitrate increase factor of each motion region in the current frame image. The bitrate allocation module is used to design an objective function based on the bitrate increment factor after motion region smoothing and the ROI property, with the goal of maximizing motion region quality and minimizing quality jumps between motion regions, determine the relative bitrate weight of each motion region in the current frame image, and perform bitrate allocation for each motion region in the current frame image.
[0015] According to a third aspect of the embodiments of this application, a video security transmission system for low-bandwidth scenarios is provided, the system comprising a memory and a processor, wherein: The memory is used to store program code; The processor is configured to read program code stored in the memory and execute the method as described in any one of the first aspects of the embodiments of this application.
[0016] Compared with existing technologies, the video secure transmission method, apparatus, and system provided by this invention for low-bandwidth scenarios have the following beneficial effects: This invention first identifies the motion regions in each frame and obtains their Regions of Interest (ROI), providing input for subsequent bitrate allocation optimization. Then, it defines the influence weights based on the overall ROI average of each historical frame image, and, considering the characteristic that each motion region consistently maintains a high ROI in historical frames, determines the bitrate increase factor for each motion region in the current frame image. Next, using this bitrate increase factor and the spatial center position of each motion region, it constructs the weights of each motion region in the current frame image within a smoothing matrix, and, combined with a Gaussian kernel function, constructs a smoothing matrix for all motion regions in the current frame image. A bitrate increase factor is applied to each motion region for smoothing, effectively suppressing visual discontinuities between frames. Building upon this, an optimization function is designed to address the potential issue of rapid ROI switching within a single frame. This function aims to maximize the visual quality of key regions and minimize quality jumps between regions, generating a bitrate allocation strategy for each motion region and determining the relative weight of the bitrate for each motion region in the current frame. Finally, the bitrate allocation results are dynamically scaled based on the available real-time network bandwidth, achieving an optimal balance between quality and smoothness under bandwidth constraints, thus improving the overall subjective quality and usability of the video. Attached Figure Description
[0017] 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.
[0018] Figure 1 A schematic diagram of the basic process of a video security transmission method in a low-bandwidth scenario provided by an embodiment of the present invention; Figure 2 A schematic diagram of a basic process for identifying motion regions in video data, provided as an embodiment of the present invention; Figure 3 This is a schematic diagram of the basic components of a video security transmission device in a low-bandwidth scenario, provided as an embodiment of the present invention. Detailed Implementation
[0019] 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 video security transmission method, apparatus, and system for low-bandwidth scenarios 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.
[0020] 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. Terms such as “comprising,” “including,” or any other variations thereof are intended to cover a non-exclusive inclusion, such that a circuit structure, article, or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or system. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the article or system that includes the element.
[0021] The following description, in conjunction with the accompanying drawings, details a specific scheme for a video security transmission method in low-bandwidth scenarios provided by the present invention.
[0022] Please see Figure 1 This illustrates the basic flow of a video security transmission method in a low-bandwidth scenario provided by an embodiment of the present invention.
[0023] like Figure 1 As shown, an embodiment of the present invention provides a method for secure video transmission in low-bandwidth scenarios, specifically including: S100: Acquires video data, identifies the motion region of each frame, and obtains the ROI of the motion region.
[0024] Acquire video data, identify the motion region of each frame, and obtain the ROI of the motion region. Further steps include: First, video data is acquired. Specifically, video data is acquired through a camera (frame rate of 30fps), and each frame of the video data is converted to grayscale and Gaussian filtering is applied to remove noise from each frame.
[0025] Then, the motion regions of each frame are identified. Specifically, such as... Figure 2As shown, motion detection is performed on the acquired and preliminarily processed video data using a three-frame difference method. This involves taking three consecutive frames, calculating the absolute difference between adjacent frames to obtain a difference image, and then performing a logical AND operation on the two difference images to obtain a motion mask. The motion mask is then binarized, and a suitable threshold (which can be set empirically) is set to separate moving pixels from the background. Next, morphological operations are performed on the binarized motion mask: opening (erosion followed by dilation) is performed to eliminate noise points, followed by closing to fill holes within the motion region. Connected component labeling is then applied to the closed binary mask, labeling each independent connected pixel region as an independent motion region, thus obtaining all motion regions for each frame. It should be noted that the motion regions are obtained using the difference method on three frames, where the three frames are respectively the first, second, and third frames. Frame image and its previous frame image (the first frame) (frame image) and the next frame image (the first) A frame image is a moving region of a three-frame image obtained by using the difference method on the frame image and the frame images before and after it. In other words, each frame image at that point is the middle frame image among the three frames.
[0026] Next, the ROI of the moving region is obtained. Specifically, the motion intensity of each moving region (i.e., the sum of the pixel values of the moving region in the two difference images) is used as the ROI of that moving region. The greater the motion intensity, the more important the moving region is, and the higher the bitrate needs to be allocated.
[0027] Finally, the motion regions are used as initial candidate key regions, and all motion regions (candidate key regions) and their ROIs are output for each frame of the image, providing input for subsequent bitrate allocation optimization.
[0028] S200: Based on the time distance between historical frame images and the current frame image, and combined with ROI characteristics, obtain the influence weight of historical frame images on the current frame image, and then analyze the activity inertia of motion regions to determine the bit rate increase factor of each motion region in the current frame image.
[0029] First, for all historical frame images, because video sequences have temporal continuity, the trajectory, speed, and background changes of moving targets are relatively stable in a short period of time. Therefore, the closer a historical frame image is to the current frame image, the more similar its motion state, lighting conditions, and scene content are to the current frame image. It is more valuable for predicting the current frame image and should be given a higher influence weight.
[0030] Secondly, for historical frame images, a lower overall ROI average indicates less interference from global environmental noise (such as sudden changes in lighting), meaning that moving targets are prominent and the background is stable. In this case, the ROI detection results have higher confidence. Conversely, a higher overall ROI average may indicate large-area motion or noise interference, making the ROI detection results more susceptible to background fluctuations and reducing reliability. Therefore, based on temporal proximity, a lower overall ROI average in a frame indicates that the moving areas in that frame are relatively concentrated, with less background interference, resulting in more accurate and reliable ROI detection results, and thus, it should receive a greater influence weight.
[0031] Based on the above analysis, in the embodiments of the present invention, the influence weight of the historical frame image on the current frame image is obtained according to the time distance between the historical frame image and the current frame image, combined with the ROI property. Specifically, a historical frame image is constructed. The formula for calculating the weight of the influence of a frame image on the current frame image is: In the formula, Indicates the first in history The influence weight of the current frame image on the frame image; Indicates the first in history Average ROI of all moving regions in a frame image; This indicates the sequence number of historical frames moving forward along the time direction from the current frame image; This represents a linear normalization function, such as a max-min normalization function, which normalizes the ROI compared to the average ROI of other historical frames. The normalized value range is... .
[0032] Similarly, the influence weights of all historical frames on the current frame can be determined.
[0033] In video sequences, true moving targets typically exhibit temporal continuity, maintaining their motion across multiple consecutive frames. If a moving region consistently exhibits high ROI (i.e., is continuously detected as a moving region) across historical frames, it indicates that the moving region is likely to contain an important moving target, rather than transient noise or a false detection. This consistently high ROI reflects the stable presence and continuous motion of the target, requiring a higher bitrate allocation to ensure its encoding quality. Conversely, moving regions that occasionally exhibit high ROI may be noise or false detections, and should not be over-allocated bitrate.
[0034] Therefore, based on the influence weight of historical frame images on the current frame image, the motion region with a continuously high ROI receives a larger bitrate increase factor. This not only conforms to the human eye's attention characteristics to moving targets (the human visual system is more sensitive to continuously moving objects and requires higher visual quality to ensure the viewing experience), but also avoids bitrate waste caused by instantaneous noise, thus achieving a reasonable allocation of bitrate resources.
[0035] Based on the above analysis, in the embodiments of the present invention, after obtaining the influence weights of historical frame images on the current frame image, the activity inertia of the motion region is analyzed to determine the bitrate increase factor for each motion region in the current frame image. Further, for historical multi-frame images, the proportion of the influence weight corresponding to each historical frame image in all historical frame images is obtained, and the ROI of the motion region in each historical frame image is weighted to determine the bitrate increase factor for each motion region in the current frame image. Here, the motion region in each historical frame image is the region corresponding to all motion regions in the current frame image in each historical frame image. Specifically, a feature point tracking / matching algorithm (such as KLT optical flow) is introduced to track and match the feature points of the motion region in the current frame image to obtain the region corresponding to the motion region in each historical frame image. Specifically, the current frame image is constructed... The formula for calculating the bitrate increase factor for each motion region is: In the formula, Indicates the current frame image number Bitrate increase factor for each motion region; Indicates the first in history The influence weight of the current frame image on the frame image; Indicates the first The sports area in history ROI of corresponding regions in frame image (historical first) The difference image of the current frame image (The sum of all pixel values in the region corresponding to each motion region); Indicates the number of historical frame images, for example, 10 frames; This represents the denominator correction parameter, which has the same dimensions as the denominator and takes the smallest value greater than 0. This is to prevent the denominator from being 0; for example, it can be set... This can prevent the denominator from being 0, and will not significantly interfere with the calculation of the normal weight values; This represents a linear normalization function, such as a max-min normalization function, which normalizes the bitrate increment factor compared to other motion regions in the current frame. The normalized value range is... .
[0036] The larger the value, the more significant the effect. The sports area in history The larger the weighted ROI value of a corresponding region in a frame image, the more historically relevant that moving region is. The greater the motion intensity of a corresponding region in a frame image, the more likely that region has historical motion intensity. The higher the activity level of the corresponding region in the frame image, the greater the inertia of the activity in that moving region, and thus the higher the activity level of the current frame image. The larger the bitrate increase factor for each motion region, the greater the increase.
[0037] Similarly, the bitrate increment factor for each motion region in the current frame image can be determined.
[0038] It should be noted that for the first 10 frames of the video data sequence (where there is insufficient historical data), the ROI obtained from the current frame image is directly used as the bitrate increase factor, without weighting from historical frame images.
[0039] S300: Analyze the spatial centrality of each motion region, and combine it with the bitrate increase factor to determine the weight of each motion region in the smoothing matrix in the current frame image.
[0040] For motion regions with a larger bitrate increase factor, it indicates that the motion region contains important moving targets, and the quality changes in this region have a greater impact on human visual perception. Therefore, a smoother bitrate allocation is needed to avoid visual flicker. At the same time, motion regions located in the center of the current frame image are usually the focus of human eye attention. Flickering or abrupt changes in the central motion region are more easily perceived and have a more significant impact on subjective quality.
[0041] Therefore, when a certain motion region, with a high bitrate increase factor (important moving target) and located in the center of the current frame (visual focus), experiences the most disruptive quality jumps, requiring stronger smoothing constraints. By assigning greater weight to such motion regions (each corresponding to a row in the smoothing matrix), we can ensure that the bitrate smooth transition of these key motion regions is prioritized during bitrate allocation optimization, thereby effectively suppressing visual flicker and improving overall viewing quality.
[0042] Based on the above analysis, in an embodiment of the present invention, the weight of each motion region in the smoothing matrix is determined by analyzing the spatial centrality of each motion region and combining it with a bitrate increment factor. Further steps include: First, the center points of all moving regions in the current frame image are obtained. Then, the coordinates of these center points are weighted and averaged using the Region of Interest (ROI) property to determine the overall center point of the current frame image. Specifically, the center points of all moving regions in the current frame image are obtained, and their coordinates are also acquired (this is a current technique and will not be elaborated upon here). The coordinates of the center points of each moving region are then weighted and averaged using the ROI property. Specifically, the weighted average of the horizontal coordinates is used as the horizontal coordinate of the overall center point of the current frame image, and the weighted average of the vertical coordinates is used as the vertical coordinate of the overall center point of the current frame image.
[0043] Then, the distance relationship between the regional center point and the overall center point of each motion region is analyzed to determine the spatial centrality of each motion region. Specifically, the spatial centrality of the first motion region is calculated. The x-coordinate of the center point of each movement area x-coordinate of the total center point The absolute value of the difference, and the calculation of the first The ordinate value of the center point of each movement area ordinate value of the total center point The absolute value of the difference is used to determine the first... Spatial centrality of each motion region.
[0044] Finally, based on the spatial centrality of each motion region and combined with the bitrate increment factor, the weight of each motion region in the current frame image in the smoothing matrix is determined. Specifically, the weight of the motion region in the current frame image is constructed as follows: The formula for calculating the weights of each motion region in the smoothing matrix is: In the formula, Indicates the current frame image number The motion region (smoothing matrix number 1) The weights of rows in the smoothing matrix; Indicating common sense about nature An exponential function with base 0; Indicates the current frame image number The x-coordinate of the center point of each motion area; This represents the x-coordinate of the center point of the current frame image; Indicates the current frame image number The ordinate value of the center point of each motion area; This represents the ordinate value of the center point of the current frame image; Indicates the scale factor. The value should be related to the scale of the current frame image, for example, set to 10% of the diagonal length of the current frame image; Indicates the current frame image number Bitrate increase factor for each motion region.
[0045] Similarly, the weight of each motion region (each row of the smoothing matrix) in the current frame image can be determined in the smoothing matrix.
[0046] S400: Based on the weights and combined with the Gaussian kernel function, construct a smoothing matrix for all motion regions in the current frame image, and smooth the bitrate increase factor for each motion region in the current frame image.
[0047] In image space, the visual quality of adjacent moving regions should maintain continuity, avoiding obvious boundary jumps. The Gaussian function has the characteristic that "the closer the distance, the greater the influence; the farther the distance, the smaller the influence," which perfectly meets the requirements of spatial smoothing. Therefore, by using the Gaussian function, combined with the weight of each moving region (each row of the smoothing matrix) in the current frame image (reflecting the importance of the moving region) in the smoothing matrix, the constructed smoothing matrix can simultaneously consider spatial proximity and the importance of moving regions, achieving differentiated processing of "prioritizing the smoothing of important regions and moderately smoothing of secondary regions," thereby suppressing flicker while maintaining a reasonable bitrate allocation.
[0048] Based on the above analysis, in an embodiment of the present invention, a smoothing matrix for all motion regions in the current frame image is constructed according to the weights and combined with a Gaussian kernel function, thereby smoothing the bitrate increase factor for each motion region in the current frame image. Further steps include: First, obtain the coordinates of the center point of the moving region, and calculate the spatial distance matrix between all moving regions in the current frame image. Specifically, this involves finding the coordinates of the center point of all moving regions in the current frame image. Each movement area constitutes a movement zone. The spatial distance matrix, where the matrix's _i ... Line 1 The element of the column is the first The regional center point of the first sports area and the first The Euclidean distance between the center points of each motion region is such that the diagonal elements of the matrix are 0.
[0049] Then, a Gaussian kernel function is applied to the spatial distance matrix to generate Gaussian weight matrices corresponding to all motion regions in the current frame image. Specifically, this is done based on the Euclidean distance elements in the spatial distance matrix, and by setting parameters that control the smoothing intensity. (Can be set to) , (The larger the value, the stronger the smoothing effect). Obtain the general Gaussian weight corresponding to each element in the spatial distance matrix, and generate the Gaussian weight matrix corresponding to all motion regions in the current frame image as follows: in, Indicates that there are a total of in the current frame image One sports area; and for: In the formula, Represents the first in the Gaussian weight matrix Line 1 General Gaussian weights for columns; Indicates the first [frame] in the current frame image Coordinates of the center point of each motion area; Indicates the first [frame] in the current frame image Coordinates of the center point of each motion area; The parameter that controls the smoothing intensity. The value should be related to the scale of the current frame image, for example, set to 10% of the diagonal length of the current frame image; Indicates the first The regional center point of the first sports area and the first The Euclidean distance between the center points of each movement zone; Represented by natural constant An exponential function with base 0.
[0050] Next, the Gaussian weight matrix is weighted according to the weight of each motion region in the smoothing matrix. This involves element-wise multiplying the Gaussian weight matrix with the weights of each row (the weights of each motion region in the smoothing matrix, reflecting the importance of the motion region) to construct a smoothing matrix for all motion regions in the current frame. Specifically, the smoothing matrix for all motion regions in the current frame is constructed as follows: In the formula, This represents a smoothing matrix for all moving regions in the current frame image; Indicates the current frame image number The motion region (smoothing matrix number 1) The weights of rows in the smoothing matrix; Represents the first in the Gaussian weight matrix Line 1 General Gaussian weights for columns; Indicates that there are a total of in the current frame image Each sports area.
[0051] Finally, a smoothing matrix is used to smooth the bitrate increment factor for each motion region in the current frame image. Further steps include: First, based on the bitrate increase factor for the motion regions, a bitrate increase factor vector is constructed for all motion regions in the current frame image. Specifically, the bitrate increase factor vector is: In the formula, This represents the bitrate increment factor vector for all motion regions in the current frame image; Indicates the current frame image number Bitrate increase factor for each motion region; Indicates that there are a total of in the current frame image One sports area; This represents the transpose of a vector.
[0052] Then, the smoothing matrix is multiplied by the bitrate increment factor vector to smooth the bitrate increment factor of each motion region in the current frame image, thus obtaining the smoothed bitrate increment factor of each motion region in the current frame image.
[0053] Specifically, by performing a linear transformation on the bitrate increase factor using a smoothing matrix, the smoothed bitrate increase factor can be obtained. Therefore, the following formula is used to construct the bitrate increase factor vector for smoothing all motion regions in the current frame image: In the formula, This represents a smoothing matrix for all moving regions in the current frame image; This represents the bitrate increment factor vector for all motion regions of the current frame image after smoothing. ,in, This represents the smoothed current frame image. Bitrate increase factor for each motion region; This represents the bitrate increment factor vector for all motion regions in the current frame image; This represents the dot product symbol.
[0054] S500: Based on the bitrate increase factor and ROI of the smoothed motion region, an objective function is designed to maximize the quality of the motion region and minimize the quality jump between motion regions. The relative weight of the bitrate of each motion region in the current frame image is determined, and the bitrate allocation and video data encoding of each motion region in the current frame image are performed.
[0055] To address the issue of rapid ROI switching within a single frame image, in embodiments of this invention, an objective function is designed based on the bitrate increase factor after motion region smoothing and the ROI, aiming to maximize motion region quality and minimize quality jumps between motion regions. This function determines the relative bitrate weight of each motion region in the current frame image and allocates bitrate to each motion region in the current frame image. Wherein: To maximize the quality of the motion zone, further measures include: First, a logarithmic model is used to define the coding quality function for each motion region in the current frame image at different bitrates. Specifically, in the current frame image, the [missing information - likely a specific region or function]... Each motion region at bitrate The coding quality function is as follows: In the formula, Indicates the first [frame] in the current frame image Each motion region at bitrate The encoding quality is as follows; This represents the bitrate value, and its unit is Mbps. and Represents model parameters (model parameters) and The value depends on a variety of factors, including the encoding standard, bitrate control mode (such as CRF), video resolution, and desired visual quality. In practical applications, the most suitable parameter value needs to be selected based on the specific video content and application scenario. Represents a logarithmic function.
[0056] Then, based on the coding quality function, combined with the bitrate increase factor after motion region smoothing and the ROI property, the objective for maximizing motion region quality is determined. Specifically, the objective for maximizing motion region quality is: In the formula, This represents the objective of maximizing the quality of the motion area; This represents the smoothed current frame image. Bitrate increase factor for each motion region; Indicates the first [frame] in the current frame image ROI of each motion region; Indicates the first [frame] in the current frame image Each motion region at bitrate The encoding quality is as follows; Indicates that there are a total of in the current frame image One sports area; This represents a linear normalization function, such as a min-max normalization function, which normalizes the region of interest (ROI) compared to other moving regions in the current frame. The normalized value range is... ; This represents the function that takes the maximum value.
[0057] To minimize the mass jump between motion regions, further measures include: Based on the coding quality function, the quality difference between each moving region and its neighboring moving regions in the current frame image is analyzed to ensure that the sum of the quality differences corresponding to all moving regions in the current frame image is minimized, thus determining the objective of minimizing the quality jump between moving regions. Specifically, the objective of minimizing the quality jump between moving regions is: In the formula, This represents the objective of minimizing mass jumps between motion regions; Indicates the first [frame] in the current frame image Each motion region at bitrate The encoding quality is as follows; Indicates the first [frame] in the current frame image Each motion region at bitrate The encoding quality is as follows; Indicates that there are a total of in the current frame image One sports area; Indicates the first [frame] in the current frame image The eight neighboring sports areas of the first sports area (the first) The eight directions surrounding the first movement area are related to the second A set of movement regions that have boundaries; This represents the function that takes the minimum value.
[0058] The objective function is designed to maximize the quality of motion regions and minimize the quality jumps between motion regions. The relative bitrate weights of each motion region in the current frame are determined, further including: First, by weighing parameters, the objectives of maximizing the quality of the motion region and minimizing the quality jumps between motion regions are merged, that is, the two objectives are combined into a single-objective optimization problem, and the objective function is determined. Specifically, the objective function is: In the formula, This represents the objective function that combines the objective of maximizing the quality of the motion region with the objective of minimizing the quality jump between motion regions by weighing parameters. This represents the objective of maximizing the quality of the motion area; This represents the objective of minimizing mass jumps between motion regions; This represents the trade-off parameter (which can be set to 0.6).
[0059] Then, the Lagrange multiplier method is used to solve the objective function, setting constraints that the total bitrate is less than the total bitrate budget and a minimum bitrate guarantee, to determine the relative bitrate weight of each motion region in the current frame image. Specifically, the Lagrange multiplier method is used to solve the optimization problem of the objective function, setting constraints that the total bitrate is less than the total bitrate budget and a minimum bitrate guarantee. First, the Lagrange function is constructed, and Lagrange multipliers are introduced to integrate the total bitrate constraint. Next, the partial derivative of the bitrate variable for each motion region is calculated and set to zero, combined with the complementary relaxation condition, to obtain the corresponding KKT conditions (Karush-Kuhn-Tucker conditions). Since the optimization objective includes a nonlinear quality function and a smoothing penalty term, a numerical iterative method is used, specifically gradient descent for approximate solution. In the actual iterative calculation process, the bitrate of each motion region is first initialized (e.g., uniformly distributed). In each iteration, the objective function value and its gradient under the current bitrate allocation are calculated, and the bitrate values of each motion region are updated along the gradient descent direction. Simultaneously, projection or scaling operations are used to ensure that the total bitrate does not exceed a given total bitrate budget. Iteration continues until the change in the objective function is below a preset threshold or the maximum number of iterations is reached, at which point convergence is considered achieved. The final bitrate allocation result is a set of normalized ratio values, reflecting the relative weight of the bitrate allocated to each motion region in the total bitrate. .
[0060] Network bandwidth is dynamic, and real-time video transmission must adaptively adjust the bitrate according to network conditions. If a pre-calculated bitrate allocation is used, packet loss and stuttering will occur when network bandwidth decreases, while network resources will be wasted when bandwidth increases. Therefore, it is necessary to combine the bitrate allocation ratio with the real-time network bandwidth to achieve dynamic bitrate scaling, which maintains the relative importance of motion areas while adapting to network fluctuations.
[0061] Based on the above analysis, in the embodiments of the present invention, according to the determined relative weight of the bitrate of each motion region in the current frame image, and in combination with the real-time network bandwidth, dynamic bitrate allocation and video data encoding are performed for each motion region in the current frame image. Specifically, when the real-time network bandwidth is... Then, the following formula can be constructed to represent the bitrate allocated to the i-th region of the current frame image: Formula explanation: Where, Indicates the first [frame] in the current frame image The bitrate allocated to each motion region, Indicates the first [frame] in the current frame image The relative weight of the bitrate allocated to each motion region in the total bitrate; This indicates the real-time network bandwidth (total bitrate).
[0062] Similarly, the bitrate allocated to each motion region in the current frame image can be determined.
[0063] Finally, the target bitrate is mapped to the encoder's quantization parameter (QP) through a preset bitrate-quantization parameter (RQ) model to implement encoding control and encode the video data. Existing technologies will not be elaborated here.
[0064] S600: Transmits encoded video data under low bandwidth conditions.
[0065] Transmitted encoded video data under low bandwidth conditions. Further steps include: end-to-end encryption of the encoded video data, combined with mechanisms such as forward error correction and adaptive bitrate transmission, to achieve secure, reliable, and real-time video stream transmission under low bandwidth conditions. Specific implementation methods are as follows: The encoded video data is encrypted using the AES-256 (Advanced Encryption Standard) symmetric encryption algorithm. The encryption key is securely exchanged using RSA asymmetric encryption to ensure key management security. Simultaneously, a timestamp and sequence number are added to the packet header to prevent replay attacks. The encrypted data packets are then subjected to HMAC-SHA256 (Hash-based Message Authentication Code using SHA-256) integrity verification to ensure that the data has not been tampered with during transmission.
[0066] Furthermore, to address the high packet loss rate in low-bandwidth networks, a forward error correction (FEC) mechanism is employed to enhance transmission reliability. At the sending end, video data packets are Reed-Solomon (RS code) encoded to generate redundant check packets. When the receiving end detects packet loss, the lost data can be recovered using these redundant packets without retransmission. Simultaneously, an adaptive bitrate streaming (ABR) mechanism is used to monitor network bandwidth, packet loss rate, and latency in real time, dynamically adjusting the video bitrate. This enables secure, reliable, and real-time video streaming transmission under low-bandwidth conditions, ensuring data security and improving transmission stability and real-time performance.
[0067] Based on the same inventive concept as the above method, this embodiment also provides a video security transmission device for low bandwidth scenarios.
[0068] Please see Figure 3This illustrates the basic components of a video security transmission device for low-bandwidth scenarios provided by an embodiment of the present invention.
[0069] like Figure 3 As shown, a video security transmission device for low-bandwidth scenarios includes a motion region recognition module 1, a bitrate increase factor analysis module 2, a bitrate increase factor smoothing module 3, a bitrate allocation module 4, and a data transmission module 5.
[0070] The motion region recognition module 1 is used to collect video data, identify the motion region of each frame of image, and obtain the ROI of the motion region; The bitrate increase factor analysis module 2 is used to obtain the influence weight of the historical frame image on the current frame image based on the time distance between the historical frame image and the current frame image, combined with the ROI property, and then analyze the activity inertia of the motion region to determine the bitrate increase factor of each motion region in the current frame image. The bitrate increase factor smoothing module 3 is used to analyze the spatial centrality of each motion region, combine the bitrate increase factor, determine the weight of each motion region in the current frame image in the smoothing matrix; and based on the weight, combine the Gaussian kernel function to construct the smoothing matrix of all motion regions in the current frame image, smoothing the bitrate increase factor of each motion region in the current frame image. The bitrate allocation module 4 is used to design an objective function based on the bitrate increase factor and ROI of the smoothed motion region, in order to maximize the quality of the motion region and minimize the quality jump between motion regions. It determines the relative weight of the bitrate of each motion region in the current frame image and performs bitrate allocation for each motion region in the current frame image.
[0071] The data transmission module 5 is used to transmit encoded video data under low bandwidth conditions.
[0072] Based on the same inventive concept as the above method, this embodiment also provides a video security transmission system for low-bandwidth scenarios.
[0073] The system includes memory and a processor, wherein: Memory, used to store program code; The processor reads the program code stored in memory and executes the acquisition of video data. It identifies the motion regions (ROIs) of each frame and obtains the ROI of these motion regions. Based on the temporal distance between historical and current frames, and combined with the ROI, it obtains the influence weights of historical frames on the current frame, analyzes the activity inertia of motion regions, and determines the bitrate increase factor for each motion region in the current frame. It analyzes the spatial centrality of each motion region, and combined with the bitrate increase factor, determines the weight of each motion region in the smoothing matrix. Based on these weights and a Gaussian kernel function, it constructs a smoothing matrix for all motion regions in the current frame, smoothing the bitrate increase factor for each motion region. Based on the smoothed bitrate increase factor and ROI of the motion regions, it designs an objective function to maximize motion region quality and minimize quality jumps between motion regions, determines the relative bitrate weights of each motion region in the current frame, and performs bitrate allocation and video data encoding for each motion region. Finally, it transmits the encoded video data under low bandwidth conditions.
[0074] 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.
[0075] 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 method for secure video transmission in low-bandwidth scenarios, characterized in that, The method includes: Acquire video data, identify the motion region of each frame, and obtain the ROI of the motion region; Based on the time distance between historical frame images and the current frame image, and combined with the ROI property, the influence weight of historical frame images on the current frame image is obtained, and then the activity inertia of the motion region is analyzed to determine the bitrate increase factor of each motion region in the current frame image. Analyze the spatial centrality of each motion region, and combine it with the bitrate increase factor to determine the weight of each motion region in the smoothing matrix in the current frame image; Based on the weights and combined with the Gaussian kernel function, a smoothing matrix is constructed for all motion regions in the current frame image, and a bitrate increase factor is smoothed for each motion region in the current frame image. Based on the bitrate increase factor after motion region smoothing and the ROI property, an objective function is designed with the goal of maximizing motion region quality and minimizing quality jumps between motion regions. The relative bitrate weight of each motion region in the current frame image is determined, and bitrate allocation and video data encoding are performed for each motion region in the current frame image.
2. The video secure transmission method in low-bandwidth scenarios according to claim 1, characterized in that, Analyze the activity inertia of the motion region to determine the bitrate increase factor for each motion region in the current frame image, including: For historical multi-frame images, the proportion of the influence weight corresponding to each historical frame image in all historical frame images is obtained, the ROI weight of the motion region in each historical frame image is weighted, and the bitrate increase factor of each motion region in the current frame image is determined.
3. The video secure transmission method in low-bandwidth scenarios according to claim 1, characterized in that, Analyze the spatial centrality of each motion region, including: Obtain the center points of all motion regions in the current frame image, and perform a weighted average of the center points of the regions based on the ROI property to determine the total center point of the current frame image. Analyze the distance relationship between the regional center point of each motion region and the total center point to determine the spatial centrality of each motion region.
4. The video secure transmission method in low-bandwidth scenarios according to claim 1, characterized in that, Based on the weights and combined with the Gaussian kernel function, a smoothing matrix is constructed for all motion regions in the current frame image, including: Obtain the coordinates of the center point of the motion region and calculate the spatial distance matrix between all motion regions in the current frame image; Apply a Gaussian kernel function to the spatial distance matrix to generate a Gaussian weight matrix corresponding to all the motion regions in the current frame image; By weighting the Gaussian weight matrix according to the weight of each motion region in the smoothing matrix, a smoothing matrix for all motion regions in the current frame image is constructed.
5. The video secure transmission method in low-bandwidth scenarios according to claim 4, characterized in that, The bitrate increase factor for smoothing each motion region in the current frame image includes: Based on the bitrate increase factor of the motion region, construct a bitrate increase factor vector for all motion regions in the current frame image; Multiply the smoothing matrix by the bitrate increase factor vector to smooth the bitrate increase factor of each motion region in the current frame image, and obtain the smoothed bitrate increase factor of each motion region in the current frame image.
6. The video secure transmission method in low-bandwidth scenarios according to claim 1, characterized in that, The goal of maximizing the quality of the motion zone includes: Using a logarithmic model, we define the coding quality function for each motion region in the current frame image at different bit rates; Based on the coding quality function, combined with the bitrate increase factor after motion region smoothing and the ROI property, the objective of maximizing motion region quality is determined.
7. The video secure transmission method in low-bandwidth scenarios according to claim 6, characterized in that, The objectives of minimizing the mass jump between motion regions include: Based on the encoded quality function, the quality difference between each motion region and its neighboring motion regions in the current frame image is analyzed to ensure that the sum of the quality differences corresponding to all motion regions in the current frame image is minimized, and the objective of minimizing the quality jump between motion regions is determined.
8. The video secure transmission method in low-bandwidth scenarios according to claim 7, characterized in that, The objective function is designed to maximize the quality of motion regions and minimize the quality jumps between motion regions. The relative bitrate weights of each motion region in the current frame are determined, including: By balancing parameters, the objective function is determined by fusing the objective of maximizing the quality of the motion region with the objective of minimizing the quality jump between motion regions. The objective function is solved using the Lagrange multiplier method. Constraints such as the total bit rate being less than the total bit rate budget and the minimum bit rate guarantee are set to determine the relative bit rate weight of each motion region in the current frame image.
9. A video security transmission device for low-bandwidth scenarios, characterized in that, The device includes: The motion region recognition module is used to collect video data, identify the motion region of each frame of image, and obtain the ROI of the motion region; The bitrate increase factor analysis module is used to obtain the influence weight of the historical frame image on the current frame image based on the time distance between the historical frame image and the current frame image, combined with the ROI property, and then analyze the activity inertia of the motion region to determine the bitrate increase factor of each motion region in the current frame image. The bitrate increase factor smoothing module is used to analyze the spatial centrality of each motion region, and in combination with the bitrate increase factor, determine the weight of each motion region in the current frame image in the smoothing matrix; and based on the weight, combined with the Gaussian kernel function, construct a smoothing matrix for all motion regions in the current frame image, and smooth the bitrate increase factor of each motion region in the current frame image. The bitrate allocation module is used to design an objective function based on the bitrate increment factor after motion region smoothing and the ROI property, with the goal of maximizing motion region quality and minimizing quality jumps between motion regions, determine the relative bitrate weight of each motion region in the current frame image, and perform bitrate allocation for each motion region in the current frame image.
10. A video security transmission system for low-bandwidth scenarios, characterized in that, The system includes a memory and a processor, wherein: The memory is used to store program code; The processor is configured to read program code stored in the memory and execute the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Macroblock layer bit allocation optimization method based on visual attention
CN104065962A
Audio and video media transmission method and system
CN119767009A
Compression transmission method and device for electric power safety supervision video and electronic equipment
CN119946335A
Coding method and system for on-site video return
CN121567870A
High-definition video low-delay compression method and system based on adaptive adjustment
CN121603658A