An ai video compression method applied in a cdn
By applying AI video compression methods in CDN, analyzing user access logs, and performing intelligent scene recognition and dynamic encoding, the problem of high bandwidth loss during video distribution is solved. This achieves a significant reduction in bandwidth and storage costs while maintaining video quality, resulting in savings of over 30%.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies suffer from significant bandwidth loss and high costs associated with indiscriminate compression during video distribution, making it difficult to effectively reduce video distribution bandwidth and storage costs while ensuring video quality.
By applying AI video compression methods in CDN, analyzing user access logs, predicting high-bandwidth videos, performing intelligent scene recognition and dynamic perception encoding, generating compression strategy templates, and optimizing video processing to reduce encoding bitrate and bandwidth.
It achieves a significant reduction in transmission bandwidth and storage space costs without affecting the viewing experience, resulting in savings of over 30%, thus realizing cost reduction and efficiency improvement in video distribution.
Smart Images

Figure CN116366881B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to artificial intelligence video processing, content distribution network, in particular to an AI video compression method applied in CDN. BACKGROUND
[0002] In recent years, with the rapid development of the Internet, 5G technology has gradually begun to be popularized. People's demand for video-based streaming content is growing, and users not only hope to be able to open the first screen in seconds, but also hope to watch the video smoothly, and the requirement for video clarity is also increasing. 720p or even 1080p clarity video can no longer meet the needs of some users. Although the content distribution network can greatly improve the video loading speed and user experience, the huge traffic loss it brings makes video manufacturers frown. The video industry has been in a loss spiral for more than a decade. Therefore, cost reduction and efficiency improvement will become the development direction of the video platform.
[0003] At present, the prior art proposes a strategy for compressing the size of the video without affecting the visual quality, which to some extent meets the user's pursuit of video quality and the video manufacturer's demand for cost reduction by reducing video distribution bandwidth. However, on the one hand, for video manufacturers, secondary processing of videos also requires certain costs, and if all videos are compressed without distinction, the cost loss may not be more than the original video traffic loss; on the other hand, due to the difference in video content, the processing space of each video is different, and some videos cannot be compressed much smaller than the original. SUMMARY
[0004] The purpose of the present application is to solve the problem of large bandwidth loss in video distribution and the above-mentioned problems existing in the prior art video compression cost reduction. The present application provides an AI video compression method applied in CDN, analyzes the user's access log of the video, predicts high-bandwidth videos, intelligently identifies the scene of the video to obtain a compression strategy template, and then uses the template parameters to guide the video processing enhancement algorithm and dynamic perception coding to optimize the subjective quality of the video and reduce the coding rate and bandwidth. The method specifically comprises:
[0005] An AI video compression method applied in CDN, comprising the following steps:
[0006] Step 1): record the log data of the user's video on-demand request to the CDN node, screen out the hot videos, and analyze the feature vectors of the hot videos;
[0007] Step 2): input the feature vector of the hot video in step 1) into the BERT model to obtain a hot index vector, dot product the hot index vector with the bandwidth data of all on-demand videos to obtain a bandwidth index value, sort all on-demand videos according to the bandwidth index value, and the videos enter a queue in order of the bandwidth index value from high to low;
[0008] Step 3): select the video at the head of the queue in step 2) to input into a classification model to perform intelligent scene recognition, input the classification result into a compression strategy determination model to obtain a compression strategy template;
[0009] Step 4): adjust the video at the head of the queue using a video processing enhancement algorithm, and then encode the video according to the compression strategy output by the compression strategy determination model in step 3) to obtain a compressed video, i.e., a high-definition low-code video;
[0010] Step 5): distribute the high-definition low-code video in step 4) to the edge server of the corresponding content distribution network.
[0011] In step 1), the hot video is screened out, specifically including:
[0012] According to the access frequency in the time interval, the hot video is sorted and screened out.
[0013] The feature vector of the hot video is analyzed, specifically including:
[0014] The log data of the hot video is extracted, and the feature vector of the hot video is obtained by One-Hot encoding and splicing.
[0015] The log data of the hot video includes the number of visits, video title, classification label, and video abstract.
[0016] In step 2), the BERT (Bidirectional Encoder Representations from Transformers) model includes: the feature vector of the hot video is trained to obtain a hot index vector through a neural network.
[0017] Step 2) specifically includes: the BERT model input feature vector is a vector obtained by One-Hot encoding and splicing the data such as video visit times; the hot index vector is obtained by training through a neural network, and then the inner product operation is performed on the hot index vector and the model input feature vector to obtain a hot value of the video. The hot value is multiplied by the bandwidth generated by the video to obtain a high bandwidth index value of the video. The value is sorted, and the video enters a queue waiting for processing by a video optimization engine.
[0018] In step 3), the classification model is trained by the following steps:
[0019] 3.1) extract the audio-visual content, title, video summary of the video sample;
[0020] 3.2) input the audio-visual content into the Inception-Resnet v2 model for neural network training to obtain a video feature sequence;
[0021] 3.3) input the video feature sequence into the NetVLAD network for aggregation training to obtain a global audio-visual feature vector; input the title and video summary into the BERT model for training to obtain a text feature vector;
[0022] 3.4) multiply the global audio-visual feature vector, the text feature vector, and the weight factor to obtain the fusion feature of the video; train the fusion feature of the video, the global audio-visual feature vector, and the text feature vector to learn the dependency relationship between the feature vector and the multi-level category of the video, and generate a classification model with the video as input and the category label as output.
[0023] In step 3), the compression strategy determination model is trained by the following steps:
[0024] A plurality of video sample sets are obtained, each video sample set containing a plurality of video samples of a known optimal compression strategy of a content type, and each video sample corresponding to an image frame, a motion state, and a texture state encoding guide parameter;
[0025] For each video sample set, the values of the multiple encoding guide parameters of the contained video samples are used as training samples to train a plurality of preset decision tree models, and all decision tree models use at least one encoding guide parameter as a variable and a compression strategy as a dependent variable;
[0026] For each video sample set, the variable of the decision tree model with the highest accuracy after training is selected as the compression strategy corresponding to the content type to which the contained video sample belongs; and according to the content type and the corresponding compression strategy, a compression strategy determination model is generated with the content type as input and the corresponding compression strategy as output.
[0027] The compression strategy includes an encoder type, a code rate, a reference frame number, a search range, a quantization parameter, and a detail reduce parameter.
[0028] In step 4), a video processing enhancement algorithm is used to adjust the video at the head of the queue, and then a compression strategy output by the compression strategy determination model in step 3) is used to guide encoding to obtain a compressed video, including:
[0029] The video enhancement algorithm is used to perform resolution scaling, noise reduction, and sharpening adjustment on the video at the head of the queue to obtain an optimized video at the head of the queue;
[0030] The video at the head of the optimized queue is input as input data into an encoder, the encoder adopts an encoder corresponding to the encoder type in the compression strategy, the encoder will automatically adjust the code rate, reference frame number and search range of the video to the preset values in the compression strategy according to the settings in the compression strategy, and then quantize and reduce the details of the video at the head of the optimized queue according to the quantization parameter and the detail reduce parameter, and finally obtain the compressed video after the encoding process.
[0031] Compared with the prior art, the application has the advantages that:
[0032] The application predicts and analyzes video access heat in multiple dimensions, filters high-bandwidth videos that will consume a large amount of bandwidth by considering the bandwidth consumption of the videos, and maximizes the experience and cost balance by not compressing and encoding the videos in a traditional way without difference; the whole process can be automatically and effectively executed without manual intervention based on full-automatic log analysis, heat prediction, intelligent scene recognition, compression strategy determination model, video adaptive optimization transcoding and other algorithm processing; the AI algorithm can intelligently identify the video scene, the content adaptation template guides the encoding, the video perception has no difference, the transmission bandwidth and storage space cost are reduced by more than 30%, and the cost is truly reduced and the efficiency is increased. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 is a flowchart of the AI video compression method applied in the CDN of the application;
[0034] Figure 2 is a comparison diagram of bandwidth consumption after the video is processed using the application. DETAILED DESCRIPTION
[0035] The core of the application is to provide an AI video processing method applied in the CDN, based on full-automatic log analysis, heat prediction, video adaptive optimization transcoding and other algorithm processing, without changing the video quality perception, while greatly reducing the transmission bandwidth and storage space of the video, thereby saving labor cost and content distribution cost.
[0036] In order to enable personnel in the art to better understand the application scheme, the technical solutions in the embodiments of the application will be described clearly and completely below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.
[0037] In order to facilitate understanding, first, the multiple concepts involved in the application are uniformly explained.
[0038] 1. Compression strategy: the specific method and strategy taken when data compression is performed, which refers to the parameter preset value used for subsequent video compression and encoding here;
[0039] 2. Optimal compression strategy: parameter preset value for video compression and encoding, which can achieve optimal balance between compression effect and image quality;
[0040] 3. Content type: a custom standard for identifying the picture type and texture type of a video sample.
[0041] An AI video compression method applied in a CDN, comprising the following steps:
[0042] Step 1) Record log data of user-initiated video on-demand requests to CDN nodes, screen out hot videos, and analyze to obtain feature vectors;
[0043] Step 2) Input the feature vectors in step 1) into an improved BERT model to obtain a hotness index vector, multiply it by the input vector (bandwidth data) to obtain a high-bandwidth index value, and screen according to the index value to obtain high-bandwidth videos.
[0044] Step 3) Input the high-bandwidth videos into a self-developed classification model for intelligent scene recognition, input the classification results into a compression strategy determination model to obtain a compression strategy template;
[0045] Step 4) According to the strategy template obtained in step 3), use a video processing enhancement algorithm to adjust the video first, and then dynamically perceive the encoding according to the strategy template to obtain the compressed video;
[0046] Step 5) Distribute the high-definition low-code video in step 4) to the edge server of the corresponding content distribution network.
[0047] Step 1) specifically includes sorting according to the access frequency in a specific time interval, and screening out hot videos. Then extract more log data of the video, including access times, video title, classification label, and video abstract, etc. Data, and One-Hot encoding to obtain the feature vector of the video.
[0048] Step 2) specifically includes that the BERT model input feature vector is the vector obtained by splicing the One-Hot encoded data of video access times, etc.; the hotness index vector is obtained by neural network training, and then the inner product operation is taken with the model input feature vector to obtain the hotness value of the video. The hotness value is multiplied by the bandwidth generated by the video to obtain the high-bandwidth index value of the video. Sort by this value, and the video enters the queue waiting for the video optimization engine to process.
[0049] The self-developed classification model includes: extracting audio and video content and titles from video samples; inputting the audio and video content into the Inception-Resnet v2 model for neural network training to obtain video feature sequences; inputting the feature sequences into the NetVLAD network for aggregation training to obtain global audio and video feature vectors; inputting text such as titles into the BERT model for training to obtain text feature vectors; performing a dot product of the two feature vectors with weighting factors and then weighting them to obtain the final fused features of the video; training the fused features of the video, as well as the audio and video feature vectors and text feature vectors, into a neural network to learn the dependency relationship between the feature vectors and the multi-level categories of the video, generating a classification model with video as input and category tags as output.
[0050] The compression strategy determination model specifically includes: acquiring multiple video sample sets, each containing multiple video samples of a content type for which the optimal compression strategy is known; acquiring encoding guidance parameters such as image frame, motion state, and texture state corresponding to the video samples; for each video sample set, training multiple preset decision tree models using the values of the multiple encoding guidance parameters of the included video samples as training samples, with all decision tree models using at least one encoding guidance parameter as a variable and the compression strategy as the dependent variable; for each video sample set, selecting the variable of the decision tree model with the highest accuracy after training as the compression strategy corresponding to the content type of the included video samples; and generating a compression strategy determination model with the content type as input and the corresponding compression strategy as output based on the content type and the corresponding compression strategy.
[0051] Step 4) specifically includes a compression strategy template containing encoding parameters and image processing parameters. Image processing guidance includes 3D noise reduction and deblurring to consume unnecessary bits and improve the encoder's efficient use of bits. Encoding guidance mainly refers to bitrate control; the optimal bitrate control mode and parameters given in the strategy template are input into the encoder. The video is then input into the encoder for re-encoding and decoding to obtain the compressed video.
[0052] like Figure 1 As shown, Figure 1 A flowchart of an AI video processing method applied on a CDN provided by the present invention, the method comprising:
[0053] When a user initiates an access request for a video, the CDN node first determines whether the video has been optimized. If not, it returns the request to the origin server; otherwise, it retrieves the optimized video from the cloud storage node and returns the optimized video to the customer.
[0054] The video optimization process includes the following:
[0055] (1) Record the user's access log data of a certain video manufacturer, sort out the top x% as the hot video according to the access frequency, extract the video title, classification label and video abstract related to the hot video, etc. Data for One-Hot coding to obtain the feature vector of the hot video;
[0056] (2) Input the feature vector into the improved BERT model to obtain the hot index vector, and the dot product of the input vector (bandwidth data) obtains the high bandwidth index value, and the high bandwidth video is obtained according to the index value, and then the video is input into the optimization queue;
[0057] (3) Input the high bandwidth video into the self-developed classification model to do intelligent scene recognition, and input the classification result into the compression strategy determination model to obtain the compression strategy template;
[0058] (4) According to the strategy template, use the video processing enhancement algorithm to adjust the video first, and then dynamically perceive the encoding to obtain the compressed video according to the strategy template;
[0059] (5) The enhanced and compressed video is distributed to the edge server of the corresponding content distribution network.
[0060] The big data algorithm extracts various reference factors in the log, such as the access frequency of a certain type of video content, content classification, and user distribution of video manufacturers, to analyze and determine the proportion of video popularity in different types and fields in real time. A current hot video ranking list is obtained, and the top x% is selected as the current hot video. These videos are one-hot encoded to obtain the feature vector of the hot video, and then input into the BERT model to obtain the current hot video index through neural network training. The inner product of the index and the feature vector obtained by one-hot encoding of the video modulo can obtain the video popularity value. Considering the popularity, the bandwidth of the video itself also needs to be considered, and the two factors are balanced to optimize to the greatest extent. Therefore, the dot product of the popularity value and the video bandwidth obtains the high bandwidth index value. The video with high popularity or hot spot rising is predicted, and the video with high bandwidth is preferentially added to the video optimization queue. The video optimization is triggered by the popularity, which greatly saves the cost of unnecessary optimization processing of low access volume videos. The popularity prediction makes it possible to obtain the optimized video of the high popularity video in advance, reducing the large amount of unnecessary bandwidth generated during the period when the access volume suddenly increases and the optimization is not completed.
[0061] The video input classification model first divides the video into audio-visual and text two parts, inputs the audio-visual content into the Inception-Resnet v2 model for neural network training to obtain a video feature sequence; the feature sequence is input into the NetVLAD network for aggregation training to obtain a global audio-visual feature vector; the title and the like text are input into the BERT model for training to obtain a text feature vector; the two feature vectors are dot multiplied with a weight factor to obtain the final fusion feature of the video; the fusion feature of the video and the audio-visual feature vector and the text feature vector are all subjected to neural network to obtain a video type multi-level category. By depicting multi-dimensional information through different modalities of the video, the video classification accuracy and refinement are effectively improved.
[0062] A video labeled with a shooting game-grassland-high code rate tag in the classification result is input into the compression strategy determination model. The output strategy template is: crf encoding mode, libvpx encoder best selection range 30, scene to noise / ringing, high block effect tolerance, first do deblurring optimization, solve fine-grained text noise, etc. According to the template, 3D noise reduction and blur optimization are first performed on the video to consume unnecessary bits and improve the effective use of bits by the encoder. According to the optimal code rate control mode and parameters of the video given by the strategy template, the encoder is input, and the video is encoded.
[0063] Finally, the processed video content is saved to the temporary storage, and the CDN content distribution cache refresh is triggered, so that the latest optimized video is obtained on the node.
[0064] In summary, the AI video processing method applied to the CDN provided by the application can analyze video access log data in real time, predict a high-bandwidth video ranking list, balance benefits and cost maximization, and divide certain videos that need to be optimized into a queue. Through scene recognition and video classification, the video is preprocessed, so that the video is adaptively enhanced and the code rate is adaptively adjusted. High definition and low code are realized by quality enhancement and encoding optimization, which can reduce the bandwidth of users by 30% on average, and provides a zero-cost solution for video manufacturers to reduce costs and increase efficiency.
[0065] As Figure 2 shown, the loss bandwidth comparison after the video is processed using the application shows that the video can be distributed with less bandwidth using the application, thereby saving bandwidth costs and realizing the actual cost reduction effect of video distribution.
Claims
1. An AI video compression method for use in CDN, characterized by comprising the following steps: Step 1): Record the log data of users making video-on-demand requests to CDN nodes, filter out popular videos, and analyze to obtain the feature vectors of popular videos; The log data for the trending videos includes the number of visits, video title, category tags, and video summary; Step 2): Input the feature vectors of the trending videos from Step 1) into the BERT model to train and obtain the trending index vector. The trending index vector is multiplied by the bandwidth data of all on-demand videos to obtain the bandwidth index value. All on-demand videos are sorted according to the bandwidth index value, and the videos are entered into the queue in order of bandwidth index value from high to low. Step 3): Select the video at the head of the queue in Step 2) to input the classification model for intelligent scene recognition, input the classification result into the compression strategy to determine the model, and obtain the compression strategy template; The classification model is trained through the following steps: 3.1) Extract the audio-visual content, title, and video summary of the video sample; 3.2) Input the audio-visual content into the Inception-Resnet v2 model for neural network training to obtain the video feature sequence; 3.3) The video feature sequence is input into the NetVLAD network for aggregation training to obtain global audio-visual feature vectors; the title and video summary are input into the BERT model for training to obtain text feature vectors; 3.4) The video fusion features are obtained by taking the dot product of the global audio-visual feature vector, the text feature vector and the weight factor and then weighting them. The video fusion features, the global audio-visual feature vector and the text feature vector are all trained into a neural network to learn the dependency relationship between the feature vector and the multi-level categories of the video, and a classification model with video as input and category tags as output is generated. The compression strategy determination model is trained through the following steps: Obtain multiple video sample sets, each containing multiple video samples of a content type with known optimal compression strategies, and each video sample corresponding to encoding guidance parameters for image frame, motion state, and texture state; For each set of video samples, the values of multiple encoding guidance parameters of the video samples contained therein are used as training samples to train multiple pre-set decision tree models. All decision tree models use at least one encoding guidance parameter as a variable and the compression strategy as the dependent variable. For each set of video samples, the variables of the decision tree model with the highest accuracy after training are selected as the compression strategies corresponding to the content type of the video samples included. Based on the content type and the corresponding compression strategy, a compression strategy determination model is generated, which takes the content type as input and the corresponding compression strategy as output. Step 4): First, adjust the video at the head of the queue using a video processing enhancement algorithm. Then, based on the compression strategy determined in Step 3), guide the encoding to obtain the compressed video, which is a high-definition, low-bitrate video, including: The video enhancement algorithm is used to first scale the resolution, reduce noise, and sharpen the video at the head of the queue to obtain an optimized video at the head of the queue. The optimized video at the head of the queue is used as input data and fed into the encoder. The encoder adopts the encoder type corresponding to the compression strategy. The encoder will automatically adjust the video bitrate, reference frame number and search range to the preset values in the compression strategy according to the settings in the compression strategy. Then, the optimized video at the head of the queue is quantized and detail reduced according to the quantization parameters and detail reduce parameters. Finally, after encoding, the compressed video is obtained. Step 5): Distribute the high-definition, low-bitrate video completed in Step 4) to the edge server of the corresponding content delivery network.
2. The AI video compression method applied in CDN according to claim 1, characterized in that, in step 1), screening out popular videos specifically includes: Videos are sorted by access frequency within a time interval to select the most popular videos.
3. The AI video compression method applied in CDN according to claim 1, characterized in that, in step 1), the feature vector of the popular video is analyzed and obtained, specifically including: Log data from trending videos is extracted, and the feature vectors of the trending videos are obtained by concatenating them after One-Hot encoding.
4. The AI video compression method applied in CDN according to claim 1, characterized in that, in step 2), the BERT model includes: The feature vectors of trending videos are used to train a neural network to obtain the trending index vector.
5. The AI video compression method applied in CDN according to claim 1, characterized in that, in step 3), the compression strategy includes encoder type, bitrate, reference frame number, search range, quantization parameter and detail reduce parameter.
Citation Information
Patent Citations
Video processing method and device, electronic equipment and computer storage medium
CN110149517A
Video classification method and device, storage medium and server
CN111209970A
Hotness prediction method and device, electronic equipment and readable storage medium
CN113837807A
Method and Apparatus for Two-Phase SSD Cache Management for Video Servers based on Support Vector Regression
KR102155185B1