Video compression method, device, equipment, medium and product
By sampling the video and fusing deep learning features, the compression rate is adaptively adjusted, solving the problem that existing technologies fail to consider the impact of network conditions and video content, and achieving efficient video transmission.
Patent Information
- Application Number
- CN202510318141.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-12-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing video compression methods fail to effectively consider the impact of network conditions and video content on video compression quality and transmission efficiency, resulting in quality degradation when the image content is complex or inefficiency when it is simple.
By sampling the video to be compressed, image quality feature sequences and network state features are obtained. Feature extraction and fusion are performed based on deep learning technology, and the video compression rate is adaptively adjusted to match the network state and video content.
It achieves adaptive adjustment of compression rate based on network conditions and video content while ensuring video quality, thereby improving video transmission efficiency and user experience.
Smart Images

Figure CN121125990A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more particularly to video compression methods, apparatus, devices, media, and products. Background Technology
[0002] Video transmission is often affected by various factors such as network bandwidth and latency, resulting in low transmission efficiency. In order to achieve efficient video transmission, video compression technology has emerged.
[0003] Existing video compression methods are mainly limited by the needs of the application scenario. That is, in scenarios that require high-definition video quality, a lower compression rate is used to ensure the clarity of the video, while when storing the video, a higher compression rate is used, sacrificing some video quality to reduce the storage space of the video file.
[0004] Existing video compression methods ignore the impact of network conditions and video content on video compression quality. This may lead to a high compression rate when processing videos with complex and detailed image content, resulting in a serious drop in video quality and affecting the viewing experience. Conversely, when processing videos with simple image content, a low compression rate is used, affecting video transmission efficiency. Summary of the Invention
[0005] This invention provides a video compression method, apparatus, device, medium, and product to address the shortcomings of existing video compression methods that do not consider the impact of network conditions and video content on compressed video quality and transmission efficiency when determining video compression parameters. It enables adaptive adjustment of the video compression rate based on network conditions and video content, achieving efficient video transmission while ensuring video quality.
[0006] This invention provides a video compression method, comprising: The video to be compressed is obtained, and the video to be compressed is sampled to obtain a frame sequence including multiple sampled frames; An image quality feature sequence is obtained based on each of the sampled frames in the frame sequence. The image quality feature sequence includes multiple image quality features, and the image quality features reflect the image quality of the sampled frames. Obtain network status characteristics, which reflect the network status of the target transmission link, which is used to transmit the compressed video obtained after compressing the video to be compressed. Based on the image quality feature sequence and the network state features, a target compression ratio is determined, and the video to be compressed is compressed based on the target compression ratio.
[0007] According to a video compression method provided by the present invention, the step of obtaining an image quality feature sequence based on each of the sampled frames in the frame sequence includes: Extract first quality index data and second quality index data from the sampled frame to obtain a first quality index sequence and a second quality index sequence; Feature extraction is performed on the first quality index sequence and the second quality index sequence respectively to obtain a first quality feature sequence and a second quality feature sequence. The first quality feature sequence includes multiple first quality features, and the second quality feature sequence includes multiple second quality features. The first quality feature and the second quality feature belonging to the same group are fused to obtain the image quality feature in the image quality feature sequence; Among them, the sampling frames corresponding to the first quality feature and the second quality feature belonging to the same group are consistent.
[0008] According to a video compression method provided by the present invention, the step of obtaining network state features includes: Obtain a transmission speed sequence, the transmission speed sequence including the transmission speed values of multiple target transmission links arranged in chronological order; The transmission speed sequence is encoded to obtain the network state characteristics.
[0009] According to a video compression method provided by the present invention, determining the target compression ratio based on the image quality feature sequence and the network state features includes: Based on the network state features and the image quality feature sequence, a matching feature sequence is obtained. Each matching feature included in the matching feature sequence reflects the semantic matching degree between the network state features and each image quality feature in the image quality feature sequence. Based on the matching feature sequence, the network state features and the image quality feature sequence are fused to obtain fused features; The fused features are input into the decoder to obtain the target compression ratio.
[0010] According to a video compression method provided by the present invention, obtaining a matching feature sequence based on the network state features and the image quality feature sequence includes: A nonlinear transformation is performed on each of the image quality features in the image quality feature sequence to obtain nonlinear transformed image quality features; The network state features are concatenated with each of the nonlinear transformation image quality features to obtain semantic association features, which reflect the degree of semantic association between the network state features and the image quality features. Based on each of the semantic association features, the matching feature sequence is obtained.
[0011] According to a video compression method provided by the present invention, the step of fusing the network state features and the image quality feature sequence based on the matching feature sequence to obtain fused features includes: The weights of each image quality feature in the image quality feature sequence are determined based on the matching feature sequence, and the image quality features are weighted and summed based on the weights to obtain the remodeling quality features; The difference between the network state features and the remodeling quality features is obtained as the fusion feature.
[0012] The present invention also provides a video compression device, comprising: The sampling module is used to acquire the video to be compressed, sample the video to be compressed, and obtain a frame sequence including multiple sampled frames; A quality feature extraction module is used to obtain an image quality feature sequence based on each of the sampled frames in the frame sequence. The image quality feature sequence includes multiple image quality features, and the image quality features reflect the image quality of the sampled frames. A state feature extraction module is used to obtain network state features, which reflect the network state of the target transmission link, and the target transmission link is used to transmit the compressed video obtained after compressing the video to be compressed. The compression module is used to determine a target compression ratio based on the image quality feature sequence and the network state features, and to compress the video to be compressed based on the target compression ratio.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the video compression method described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the video compression method as described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the video compression method described above.
[0016] The video compression method, apparatus, device, medium, and product provided by this invention sample the video to be compressed, obtaining a frame sequence comprising multiple sampled frames. Based on each sampled frame in the frame sequence, an image quality feature sequence is obtained, comprising multiple image quality features reflecting the image quality of the sampled frames. Network status features are also obtained, reflecting the network status of the target transmission link used to transmit the compressed video. Based on the image quality feature sequence and network status features, a target compression ratio is determined, and the video to be compressed is then compressed based on the target compression ratio. Thus, when determining the compression ratio for the video to be compressed, not only the image quality in the video is considered, but also the network status of the transmission link used to transmit the compressed video. This enables adaptive adjustment of the video compression ratio based on network status and video content, achieving efficient video transmission while ensuring video quality. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this 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 some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is one of the flowcharts of the video compression method provided by the present invention.
[0019] Figure 2 This is the second flowchart of the video compression method provided by the present invention.
[0020] Figure 3 This is the third flowchart of the video compression method provided by the present invention.
[0021] Figure 4 This is the fourth flowchart of the video compression method provided by the present invention.
[0022] Figure 5 This is a schematic diagram of the video compression device provided by the present invention.
[0023] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] The following is combined Figures 1-4 Describe the video compression method provided by this invention. For example... Figure 1 As shown, the video compression method includes the following steps: S110. Obtain the video to be compressed, sample the video to be compressed, and obtain a frame sequence including multiple sampled frames; S120. Obtain an image quality feature sequence based on each sampled frame in the frame sequence. The image quality feature sequence includes multiple image quality features, which reflect the image quality of the sampled frame. S130. Obtain network status characteristics. The network status characteristics reflect the network status of the target transmission link. The target transmission link is used to transmit the compressed video obtained after the video to be compressed is compressed. S140. Based on the image quality feature sequence and network state features, determine the target compression ratio, and compress the video to be compressed based on the target compression ratio.
[0026] The video compression method provided by this invention considers not only the image quality in the video but also the network status of the transmission link used to transmit the compressed video when determining the compression rate. This enables adaptive adjustment of the video compression rate based on network status and video content, achieving efficient video transmission while ensuring video quality.
[0027] In the method provided by this invention, after obtaining the video to be compressed, the video quality is first understood and analyzed to obtain an image quality feature sequence that reflects the quality of the video image, thereby providing an effective reference for setting its compression rate.
[0028] Since videos are composed of continuously changing image frames, especially in high-definition or ultra-high-definition videos, each frame contains a large amount of pixel data. Processing all frames of the entire video to be compressed directly would consume enormous computational resources and time. Therefore, the method provided in this invention, in order to reduce computational complexity and improve processing efficiency, employs a sampling method to selectively extract a portion of image frames from the video to be compressed for processing. Specifically, the sampling interval for the video to be compressed can be determined based on the duration of the video, ensuring that the extracted sampled frames cover the entire event span of the video, thereby covering the main content of the video and guaranteeing the comprehensiveness and accuracy of subsequent video quality analysis.
[0029] like Figure 3 As shown, the image quality feature sequence is obtained based on each sampled frame in the frame sequence, including: S121. Extract the first quality index data and the second quality index data from the sampled frame to obtain the first quality index sequence and the second quality index sequence. S122. Extract features from the first quality index sequence and the second quality index sequence respectively to obtain a first quality feature sequence and a second quality feature sequence. The first quality feature sequence includes multiple first quality features, and the second quality feature sequence includes multiple second quality features. S123. The first quality feature and the second quality feature belonging to the same group are fused to obtain the image quality features in the image quality feature sequence; Among them, the sampling frames corresponding to the first quality feature and the second quality feature belonging to the same group are the same.
[0030] The method provided by this invention extracts two aspects of quality indicators from the sampled frame, extracts features from the two aspects of quality indicators, and then further fuses the two aspects of quality features to obtain image quality features that can more comprehensively reflect the image quality of the sampled frame.
[0031] Contrast ratio and eye color depth are important parameters reflecting image quality. Contrast ratio reflects the brightness differences between different areas of an image; higher contrast ratio makes an image clearer and more vivid. Eye color depth, on the other hand, determines the number of colors an image can represent; the greater the color depth, the stronger the image's color representation capability. Therefore, in one possible implementation of the method provided by this invention, such as... Figure 2As shown, contrast and color depth are extracted from each sampled frame in the frame sequence, resulting in a time series of the sampled frame contrast as the first quality index sequence and a time series of the sampled frame color depth as the second quality index sequence. Thus, by using the first and second quality index sequences, information such as the brightness distribution, detail representation, and color richness of the video to be compressed at different time points can be obtained, leading to an understanding of the overall quality level of the video and providing fundamental data for determining the subsequent video compression rate.
[0032] Considering that the quality indicators in the video to be compressed may exhibit certain correlations over time, i.e., there may be continuity and changing trends in the quality indicators between adjacent frames, the method provided in this invention further performs sequence encoding based on a local time scale to extract features, resulting in a first quality feature sequence and a second quality feature sequence, in order to fully understand this temporal correlation and improve the accuracy of video quality analysis. Specifically, the first and second quality indicator sequences are first divided into multiple subsequences according to a preset local time scale (e.g., a fixed number of frames). Then, for each subsequence, a convolutional neural network is used for temporal encoding. In one possible implementation, a 1D-CNN (one-dimensional convolutional neural network) can be used to temporally encode the subsequences. By using a one-dimensional convolutional kernel to perform sliding convolution operations over time, the 1D-CNN can effectively capture local features and correlations in the temporal data, identify the changing patterns and regularities of the first and second quality indicators between adjacent image frames, and thus obtain the first quality feature sequence and the second quality feature sequence, providing a more comprehensive and accurate basis for the quality analysis of the video to be compressed.
[0033] More specifically, in a concrete example of the method provided by this invention, the encoding process based on the 1D-CNN model includes: First, the input layer receives a first quality index sequence and a second quality index sequence. These two time series represent the first quality index information and the second quality index information of the video at different time points, respectively. To process this information, the method provided by this invention designs a multi-scale convolutional layer. This layer uses convolutional kernels of different sizes (e.g., 3x1, 5x1, 7x1) to capture features at different scales. Through this multi-scale design, the model can simultaneously capture local and global information, which is crucial for the complexity and detail representation of video content.
[0034] Next, after each convolutional layer, the method provided in this invention introduces an SENet module to implement a channel attention mechanism. The SENet module first performs global average pooling on the feature maps, compressing each feature map into a single feature vector. Then, it generates weights for each feature map using two fully connected layers and a sigmoid activation function. These weights are used to reweight the feature maps, enabling the model to focus on features that are more important to the current task. This attention mechanism not only enhances the model's sensitivity to important features but also improves its generalization ability and robustness.
[0035] After the attention mechanism processing, the method provided in this invention performs a pooling operation on the feature map. Max pooling can be chosen here, which reduces the dimensionality of the data by selecting the maximum value within the pooling window while preserving the most salient features. The size and stride of the pooling window can be adjusted according to actual needs to balance feature preservation and computational efficiency.
[0036] Following the pooling operation, the method provided in this invention uses the ReLU activation function to perform non-linear activation on the pooled feature map. The ReLU activation function can increase the non-linear expressive power of the model, helping the model to better fit complex video content and network states.
[0037] Finally, the activated feature maps are mapped to the required dimensions through a fully connected layer to generate the final first quality feature sequence and second quality feature sequence.
[0038] As can be seen from the preceding explanation, since the sampled frames in the frame sequence are arranged in chronological order, and the first quality index data and the second quality index data are extracted from the sampled frames in the frame sequence respectively, the resulting first quality index sequence and second quality index sequence include the first quality index data and the second quality index data corresponding to each sampled frame. Then, feature extraction is performed on the first quality index data and the second quality index data, resulting in the first quality feature sequence and the second quality feature sequence, each containing the first quality feature and the second quality feature corresponding to the sampled frames respectively. The first quality feature and the second quality feature corresponding to the same sampled frame are called the first quality feature and the second quality feature belonging to the same group. In the method provided by the present invention, the first quality feature and the second quality feature belonging to the same group are further fused to obtain the image quality feature in the image quality feature sequence. By further fusing the quality information of the two aspects of the sampled frames, an image quality feature sequence that comprehensively reflects the video quality is obtained, forming a more comprehensive and accurate video quality description.
[0039] Different quality metrics may have varying degrees of importance at different time scales or within different scenes. For example, contrast information may be more important in fast-moving scenes, while color depth information may be more crucial in scenes with rich colors. To more accurately reflect the quality characteristics of the video to be compressed at different time points, one possible implementation of the method provided by this invention introduces a feature dynamic integration module based on a gating mechanism to fuse the corresponding first and second quality features for each set, thereby obtaining an image quality feature sequence. Specifically, the feature dynamic integration module, based on a gating mechanism, learns the correlation between the corresponding first and second quality features to adjust their fusion weights, achieving dynamic weighted fusion of the first and second quality features. This allows for automatic adjustment of the relative importance of the first and second quality metric information in different parts of the video, helping to more accurately reflect the quality characteristics of the video to be compressed at different time periods.
[0040] In the process of obtaining the image quality feature sequence, the first and second quality features of each group are first concatenated to obtain multi-dimensional joint features of image quality; the multi-dimensional joint features of image quality are input into the gating response function to obtain the information fusion response gate; the difference between the first and the information fusion response gate is calculated, and the information fusion response gate and the difference are used as weights to calculate the position-weighted sum of the first and second quality features of each group to obtain the image quality feature sequence.
[0041] The image quality multidimensional joint feature representation is input into the gating response function to obtain the information fusion response gate, including: multiplying the image quality multidimensional joint feature by a predetermined weight vector to obtain the information interaction fusion correlation coefficient; adding the information interaction fusion correlation coefficient and a predetermined bias parameter and then performing activation processing through the sigmoid function to obtain the information fusion response gate.
[0042] The process of obtaining image quality features can be represented by the following interactive fusion formula, where the interactive fusion formula is: ; ; in, It is the primary quality characteristic. It is the second quality characteristic. Indicates a cascading operation. It is the sigmoid function. It is a predefined weight vector. It is a predefined bias parameter. It is a response gate for information fusion. It is an image quality feature.
[0043] In video transmission, real-time network speed is one of the key factors affecting video quality. When network bandwidth is sufficient, high-quality video streams can be transmitted, ensuring a smooth viewing experience for users. However, when network bandwidth is insufficient to support the current video stream's bitrate, video playback will be choppy, requiring a reduction in video quality to adapt to network transmission conditions and avoid stuttering and frame drops. Therefore, in the technical solution of this application, network status characteristics reflecting the network status of the target transmission link are obtained to adjust compression parameters in advance based on the changing trend of real-time network speed values, achieving a smooth transition in video quality and avoiding video quality fluctuations caused by changes in network status.
[0044] Specifically, network state characteristics are obtained, including: Obtain the transmission speed sequence, which includes the transmission speed values of multiple target transmission links arranged in chronological order; The transmission speed sequence is encoded to obtain network state characteristics.
[0045] Encoding the transmission speed sequence to obtain network state characteristics can be achieved using existing encoding methods. One of the most likely implementations is based on a Bidirectional Gated Recurrent Unit (BiGRU). Real-time transmission speed values exhibit temporal correlations, and the BiGRU, as a variant of a recurrent neural network (RNN), can effectively capture long-term dependencies in time-series data. Specifically, BiGRU combines a bidirectional model and a gating mechanism, creating a GRU network with two directions. This allows for the simultaneous capture of forward and backward dependencies in the sequence, enabling a more comprehensive modeling of temporal correlations in the transmission speed sequence, including real-time network speed values. This more accurately reflects the dynamic changes in network state, providing more detailed network state information for subsequent video compression rate recommendations.
[0046] More specifically, in a concrete example of the method provided by this invention, the encoding process of the sequence encoder based on a bidirectional gated cyclic unit includes: First, the input layer receives a transmission speed sequence. These data reflect the temporal changes in network state and are of great significance for recommending video compression rates. To better capture these temporal features, the method provided by this invention adds a multi-layer structure based on BiGRU. Specifically, the method provided by this invention designs a two-layer BiGRU, each layer containing a forward GRU and a backward GRU. Such a multi-layer structure can more deeply model complex patterns in time-series data.
[0047] Following each BiGRU layer, the method provided in this invention introduces residual connections. Residual connections help the model mitigate the vanishing gradient problem and enhance the training performance of deep networks by directly adding the output of the previous layer to the output of the current layer. This structure allows the model to more effectively transfer and utilize low-level features while learning higher-level abstract features.
[0048] To further improve the model's flexibility and adaptability, the method provided in this invention incorporates an attention mechanism after the last BiGRU layer. This attention mechanism calculates weights for each time step, enabling the model to focus more on time points that are more important to the current task. Specifically, this application uses a self-attention-based module that generates an attention weight matrix by calculating the similarity between the hidden states at each time step. These weights are then used to reweight the hidden states at each time step, thereby generating the final network state features.
[0049] Furthermore, to improve the model's generalization ability and robustness, the method provided in this invention uses a Dropout layer to prevent overfitting by randomly discarding a portion of neurons. The Dropout layer can be placed after each BiGRU layer to reduce the model's dependence on specific neurons and improve the overall stability of the model. Finally, after the above processing, the final network state features are obtained.
[0050] Video compression performance is affected not only by image quality itself but also by network transmission conditions. To more comprehensively consider the various factors influencing video compression performance, the method provided in this invention jointly models image quality features and network state features. Specifically, for example... Figure 4 As shown, the target compression ratio is determined based on the image quality feature sequence and network state features, including: S131. Based on the network state features and image quality feature sequence, a matching feature sequence is obtained. Each matching feature in the matching feature sequence reflects the semantic matching degree between the network state features and each image quality feature in the image quality feature sequence. S132. Based on the matching feature sequence, the network state features and the image quality feature sequence are fused to obtain the fused features; S133. Input the fused features into the decoder to obtain the target compression ratio.
[0051] The method provided by this invention firstly bases on the semantic matching degree between network state features and image quality features in the image quality feature sequence, and then jointly models the network state features and image quality feature sequence based on the matching feature sequence that reflects the semantic matching degree, so as to provide a more accurate reference for candidate compression rate recommendations.
[0052] Specifically, based on the network state features and image quality characteristic sequences, a matching feature sequence is obtained, including: A nonlinear transformation is performed on each image quality feature in the image quality feature sequence to obtain the nonlinear transformed image quality features. The network state features are concatenated with each nonlinear transform image quality feature to obtain each semantic association feature. The semantic association feature reflects the degree of semantic association between the network state features and the image quality features. Based on each semantic association feature, a matching feature sequence is obtained.
[0053] Nonlinear transformations of image quality features can be performed using existing nonlinear transformation methods, utilizing the square of the feature values. The network state features are concatenated with each nonlinearly transformed image quality feature to obtain semantically related features. The matching feature sequence is then derived based on these semantically related features, either using existing feature transformation methods or directly using the semantically related features as the matching features in the matching feature sequence. In one possible implementation, a preset transformation vector can be multiplied by each semantically related feature to obtain a sequence of semantic similarities. A bias term is then added to each semantic similarity in the sequence, and the result is passed through a sigmoid activation function to obtain the matching feature sequence.
[0054] After obtaining the matching feature sequence, the network state features and image quality feature sequences are fused based on the matching feature sequence to obtain the fused features, including: The weights of each image quality feature in the image quality feature sequence are determined based on the matching feature sequence, and the weighted sum of each image quality feature is obtained based on the weights to obtain the remodeling quality feature. The difference between network state features and remodeling quality features is obtained as the fusion feature.
[0055] In the method provided by this invention, the image quality feature sequence is adaptively weighted and weighted fused according to the semantic matching degree between network state features and various image quality features to obtain reconstructed quality features. Then, by calculating the difference features between network state features and reconstructed quality features, the feature differences between network state features and weighted fused reconstructed quality features can be obtained, thereby further explaining the semantic mismatch or difference between video image quality and network state. The obtained fused features can provide a more accurate reference for subsequent compression rate recommendations.
[0056] In one possible implementation, the process of obtaining the reconstructed quality features can be as follows: after normalizing the matching feature sequence using the softmax function, the weights of each image quality feature are obtained, and the weights of each image quality feature are summed to obtain the reconstructed quality features.
[0057] The process of obtaining fused features can be expressed by the following formula: ; ; ; ; in, Indicates network state characteristics, Represents the first in the image quality feature sequence Image quality features, Indicates a cascading operation. For the preset transformation vector, For bias terms, express Activation function Indicates network state characteristics and the first One-way matching semantic metric coefficients between image quality features The number of image quality features. This represents the operation of an exponential function with base e. Indicates network state characteristics and the first One-way matching semantic metric weights between image quality features Table reshaping quality characteristics, This indicates subtraction by position. This indicates the fusion feature.
[0058] The fused features are input into the decoder to obtain the target compression ratio output by the decoder. The decoder is trained and optimized using a large amount of video stream data and corresponding compression ratio data. It can learn feature patterns from the input fused features using its internal structure and parameters. Taking into account the complexity of the video content itself and the limitations of network transmission conditions, the fused features are mapped to a predefined compression ratio space, thereby generating a compression ratio recommendation value suitable for the current situation. This helps to achieve more efficient compression and transmission while ensuring video quality, and ensures smooth video transmission and viewing experience.
[0059] Network state features and image quality feature sequences represent the local temporal correlation features of real-time network speed values and the temporal correlation features of sampled image frame image quality, respectively. In the process of calculating the one-way interactive matching result of network state features relative to the image quality feature sequence using the network state features as the query feature vector, the fused features suffer from sparsity due to the temporal correspondence gap between the network state features and the individual image quality features in the image quality feature sequence. This reduces the decoding accuracy of the decoder-based compression rate recommender.
[0060] Based on this, in one possible implementation of the method provided by the present invention, inputting the fused features into a decoder-based compression ratio recommender to obtain the compression ratio recommendation value includes: The association response matrix and distance response matrix are determined based on the association values and distance values of the fused features, i.e.: ; ; in, and These represent the fusion features respectively. The eigenvalue and the eigenvalue 1 eigenvalue, Represents the fused feature quantity. Represents the set of real numbers. Indicates the length of the melting feature. Indicating the correlation response matrix Location feature value In the distance response matrix Location feature values; The fused features are multiplied by the correlation response matrix to obtain the correlation response features; The distance response matrix is multiplied by the transpose of the fused features to obtain the distance response features; The query logic bias feature is obtained by multiplying the association response matrix and the distance response matrix by a dot product and then multiplying them by the transpose of the association response feature. The associated corresponding features, the distance response features, and the query logic bias features are combined to obtain optimized fusion features; The optimized fusion features are input into the decoder to obtain the target compression ratio.
[0061] Here, optimized fusion features Represented as: .
[0062] And in ,and In the following cases: ; ; in, Represents the correlation response matrix. Represents the distance response matrix. Indicates fusion characteristics, Represents the set of real numbers. Indicates the length of the fused feature. Indicates matrix multiplication. This indicates dot product by position. This indicates adding based on position points. Represents the transpose of a vector. This indicates a query for the intermediate vector. This indicates the query logic bias characteristic. This indicates optimized fusion features.
[0063] Therefore, by using the autocorrelation matrix and autodistance matrix of the fused features as a statistically based, reference-free distribution response framework for the fused features, and constructing an enhanced reverse response based on the retrieval of the fused features to avoid simple repetition of feature distribution, and by ensuring the intrinsic mapping logic of the fused features based on the retrieval-response context to avoid superficial combinatorial mapping of the fused features, the logical dependency mapping from the fused features to the decoding target domain is achieved while maintaining the intuitive response relevance. This improves the accuracy of the compression ratio recommendation value (i.e., the target compression ratio) obtained by inputting the fused features into the decoder-based compression ratio recommender.
[0064] Specifically, inputting the optimized fusion features into a decoder-based compression ratio recommender to obtain the target compression ratio includes: using the decoder to perform decoding regression on the optimized fusion features with the following decoding formula to obtain the target compression ratio; wherein, the decoding formula is: ,in, It is an optimized fusion feature. It is the target compression ratio. It is the decoded weight matrix. This represents matrix multiplication.
[0065] In summary, the method provided by this invention employs deep learning-based artificial intelligence technology to analyze the image parameters and real-time network speed of the video to be compressed, thereby extracting the image quality features and network status features of the video. By performing feature matching analysis on these two aspects, the compression rate of the video is intelligently determined. This allows for adaptive selection of appropriate compression parameters based on the current network status and video content, achieving efficient video transmission while ensuring video quality.
[0066] The video compression apparatus provided by the present invention is described below. The video compression apparatus described below can be referred to in correspondence with the video compression method described above. For example... Figure 5 As shown, the video compression device provided by the present invention includes: The sampling module 510 is used to acquire the video to be compressed, sample the video to be compressed, and obtain a frame sequence including multiple sampled frames; The quality feature extraction module 520 is used to obtain an image quality feature sequence based on each sampled frame in the frame sequence. The image quality feature sequence includes multiple image quality features, which reflect the image quality of the sampled frame. The state feature extraction module 530 is used to obtain network state features, which reflect the network state of the target transmission link. The target transmission link is used to transmit the compressed video obtained after the video to be compressed is compressed. Compression module 540 is used to determine the target compression ratio based on image quality feature sequence and network state features, and to compress the video to be compressed based on the target compression ratio.
[0067] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640. The processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a video compression method. This method includes: acquiring a video to be compressed; sampling the video to be compressed to obtain a frame sequence including multiple sampled frames; acquiring an image quality feature sequence based on each sampled frame in the frame sequence, the image quality feature sequence including multiple image quality features reflecting the image quality of the sampled frames; acquiring network status features reflecting the network status of a target transmission link used to transmit the compressed video obtained after compressing the video to be compressed; determining a target compression ratio based on the image quality feature sequence and network status features; and compressing the video to be compressed based on the target compression ratio.
[0068] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0069] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the video compression method provided by the above methods. The method includes: acquiring a video to be compressed; sampling the video to be compressed to obtain a frame sequence including multiple sampled frames; acquiring an image quality feature sequence based on each sampled frame in the frame sequence, the image quality feature sequence including multiple image quality features, the image quality features reflecting the image quality of the sampled frames; acquiring network status features, the network status features reflecting the network status of a target transmission link, the target transmission link being used to transmit the compressed video obtained after compressing the video to be compressed; determining a target compression ratio based on the image quality feature sequence and the network status features; and performing compression processing on the video to be compressed based on the target compression ratio.
[0070] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the video compression method provided by the methods described above. The method includes: acquiring a video to be compressed; sampling the video to be compressed to obtain a frame sequence including multiple sampled frames; acquiring an image quality feature sequence based on each sampled frame in the frame sequence, the image quality feature sequence including multiple image quality features reflecting the image quality of the sampled frames; acquiring network status features reflecting the network status of a target transmission link used to transmit the compressed video obtained after compressing the video to be compressed; determining a target compression ratio based on the image quality feature sequence and the network status features; and compressing the video to be compressed based on the target compression ratio.
[0071] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0072] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A video compression method, characterized in that, include: The video to be compressed is obtained, and the video to be compressed is sampled to obtain a frame sequence including multiple sampled frames; An image quality feature sequence is obtained based on each of the sampled frames in the frame sequence. The image quality feature sequence includes multiple image quality features, which reflect the image quality of the sampled frames. Obtain network status characteristics, which reflect the network status of the target transmission link, which is used to transmit the compressed video obtained after compressing the video to be compressed. Based on the image quality feature sequence and the network state features, a target compression ratio is determined, and the video to be compressed is compressed based on the target compression ratio.
2. The video compression method according to claim 1, characterized in that, The step of obtaining an image quality feature sequence based on each of the sampled frames in the frame sequence includes: Extract first quality index data and second quality index data from the sampled frame to obtain a first quality index sequence and a second quality index sequence; Feature extraction is performed on the first quality index sequence and the second quality index sequence respectively to obtain a first quality feature sequence and a second quality feature sequence. The first quality feature sequence includes multiple first quality features, and the second quality feature sequence includes multiple second quality features. The first quality feature and the second quality feature belonging to the same group are fused to obtain the image quality feature in the image quality feature sequence; Among them, the sampling frames corresponding to the first quality feature and the second quality feature belonging to the same group are consistent.
3. The video compression method according to claim 1, characterized in that, The acquisition of network state features includes: Obtain a transmission speed sequence, the transmission speed sequence including the transmission speed values of multiple target transmission links arranged in chronological order; The transmission speed sequence is encoded to obtain the network state characteristics.
4. The video compression method according to claim 1, characterized in that, Determining the target compression ratio based on the image quality feature sequence and the network state features includes: Based on the network state features and the image quality feature sequence, a matching feature sequence is obtained. Each matching feature included in the matching feature sequence reflects the semantic matching degree between the network state features and each image quality feature in the image quality feature sequence. Based on the matching feature sequence, the network state features and the image quality feature sequence are fused to obtain fused features; The fused features are input into the decoder to obtain the target compression ratio.
5. The video compression method according to claim 4, characterized in that, The step of obtaining a matching feature sequence based on the network state features and the image quality feature sequence includes: A nonlinear transformation is performed on each of the image quality features in the image quality feature sequence to obtain nonlinear transformed image quality features; The network state features are concatenated with each of the nonlinear transformation image quality features to obtain semantic association features, which reflect the degree of semantic association between the network state features and the image quality features. Based on each of the semantic association features, the matching feature sequence is obtained.
6. The video compression method according to claim 4, characterized in that, The process of fusing the network state features and the image quality feature sequence based on the matching feature sequence to obtain fused features includes: The weights of each image quality feature in the image quality feature sequence are determined based on the matching feature sequence, and the image quality features are weighted and summed based on the weights to obtain the remodeling quality features; The difference between the network state features and the remodeling quality features is obtained as the fusion feature.
7. A video compression device, characterized in that, include: The sampling module is used to acquire the video to be compressed, sample the video to be compressed, and obtain a frame sequence including multiple sampled frames; A quality feature extraction module is used to obtain an image quality feature sequence based on each of the sampled frames in the frame sequence. The image quality feature sequence includes multiple image quality features, and the image quality features reflect the image quality of the sampled frames. A state feature extraction module is used to obtain network state features, which reflect the network state of the target transmission link, and the target transmission link is used to transmit the compressed video obtained after compressing the video to be compressed. The compression module is used to determine a target compression ratio based on the image quality feature sequence and the network state features, and to compress the video to be compressed based on the target compression ratio.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the video compression method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the video compression method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the video compression method as described in any one of claims 1 to 6.