Video coding method and device
By extracting feature and determining target encoding parameters for video to be encoded, the problem of low video encoding efficiency in the prior art is solved, and the effect of improving video encoding efficiency and quality while reducing bandwidth costs is achieved.
Patent Information
- Application Number
- CN202411023034.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-24
AI Technical Summary
The existing video encoding technology is difficult to effectively improve video encoding efficiency while reducing bandwidth costs, and multiple encoding processing reduces video encoding efficiency.
By extracting the feature of multiple videos to be encoded, the target encoding parameters are determined based on the total code rate and the video features, and the target encoding parameters are used for encoding processing to ensure that the code rate of the encoded video is less than the total code rate and the quality evaluation index value meets the video requirements. .
It improves video encoding efficiency, reduces the time to determine target encoding parameters, and ensures that the quality of the encoded video meets the standards of the video demand side.
Smart Images

Figure CN119182935A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a video encoding method and device. Background Art
[0002] With the development of Internet technology, high-definition video applications (on-demand and live broadcast) have become more and more popular, but the problem is higher bandwidth costs and worse playback fluency. Therefore, it is a problem that needs attention to reduce the cost of video transmission bandwidth while ensuring video quality.
[0003] In the prior art, video encoding is usually performed based on different encoding parameter values. The video is first encoded multiple times, and then formal video encoding is performed after the target encoding parameter value is determined, thereby reducing bandwidth costs while ensuring video quality.
[0004] However, the conventional method of determining encoding parameters requires multiple encoding processes to determine the parameters, which reduces the video encoding efficiency. Summary of the invention
[0005] The embodiment of the present application provides a video encoding method to improve the video encoding efficiency while ensuring the video encoding quality. The embodiment of the present application also provides a video encoding device, an electronic device and a computer storage medium.
[0006] An embodiment of the present application provides a video encoding method, including: performing feature extraction processing on multiple videos to be encoded to obtain video features of the videos to be encoded in the multiple videos to be encoded; determining target encoding parameters of the videos to be encoded based on the total bit rate corresponding to the multiple videos to be encoded and the video features of the videos to be encoded in the multiple videos to be encoded; and encoding the videos to be encoded according to the target encoding parameters of the videos to be encoded; wherein, when the encoding parameters of the videos to be encoded in the multiple videos to be encoded are the corresponding target encoding parameters, the bit rate of the encoded video after the encoding processing is the target bit rate, the quality assessment index value of the encoded video is the target quality assessment index value, the sum of the target bit rates corresponding to the encoded videos respectively is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos respectively is greater than the video quality assessment index standard value required by the video demand end for the multiple encoded videos.
[0007] Optionally, the determining the target encoding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded and the video features of the video to be encoded in the multiple videos to be encoded includes: determining the video content type to which the video to be encoded in the multiple videos to be encoded belongs according to the video features of the video to be encoded in the multiple videos to be encoded; classifying the videos to be encoded in the multiple videos to be encoded according to the video content type to which the video to be encoded belongs, and obtaining at least one video group to be encoded, wherein the video content types of the videos to be encoded in the video group to be encoded belong to the same video content type; determining the target encoding parameters of the video group to be encoded as the target encoding parameters of the videos to be encoded in the video group to be encoded based on the total bit rate corresponding to the multiple videos to be encoded and in combination with the video content type of the video group to be encoded; correspondingly, encoding the video to be encoded according to the target encoding parameters of the video to be encoded includes: performing joint encoding processing on the videos to be encoded contained in the video group to be encoded according to the target encoding parameters of the video group to be encoded.
[0008] Optionally, determining the target coding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded and the video features of the video to be encoded in the multiple videos to be encoded includes: determining the coding parameter prediction model corresponding to the multiple videos to be encoded based on the total bit rate corresponding to the multiple videos to be encoded; inputting the video features of the video to be encoded in the multiple videos to be encoded into the coding parameter prediction model respectively, and obtaining the target coding parameters for the video to be encoded output by the coding parameter prediction model; wherein the coding parameter prediction model is used to determine the target coding parameters of the video to be encoded according to the video features of the video to be encoded, and the target coding parameters meet the following conditions: after encoding the video to be encoded using the target coding parameters, a target bit rate and a target quality assessment index value of the encoded video are obtained; the sum of the target bit rates corresponding to the encoded videos in the multiple encoded videos corresponding to the multiple videos to be encoded is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos is greater than the video quality assessment index standard value required by the video demand end for the multiple encoded videos.
[0009] Optionally, the coding parameter prediction model is trained in the following manner: obtaining a total bit rate corresponding to multiple sample videos, and sample video features and sample coding parameters of sample videos among the multiple sample videos; inputting the total bit rate corresponding to the multiple sample videos and the sample video features of the sample videos into the initial coding parameter prediction model to obtain the initial coding parameters for the sample videos output by the initial coding parameter prediction model; obtaining a loss value between the initial coding parameters and the sample coding parameters of the sample video; adding up the loss values corresponding to the sample videos among the multiple sample videos to obtain a total loss value corresponding to the multiple sample videos; adjusting the parameters of the initial coding parameter prediction model based on the total loss value to obtain a trained coding parameter prediction model.
[0010] Optionally, the sample coding parameters of the sample video are obtained in the following manner: obtaining a candidate rate-distortion point group obtained by a sample video from a plurality of sample videos under a plurality of candidate coding parameter conditions; selecting a predetermined rate-distortion point from the candidate rate-distortion point group corresponding to the sample video, the predetermined rate-distortion point comprising at least the following attribute parameters: a predetermined coding parameter, a predetermined bit rate, and a predetermined quality assessment index value; after encoding the sample video using the predetermined coding parameters, the bit rate of the encoded video is a predetermined bit rate, and the quality assessment index value of the encoded video is a predetermined quality assessment index value; if the above-mentioned attribute parameters of the predetermined rate-distortion points corresponding to the sample videos from the plurality of sample videos respectively meet the following conditions, the predetermined coding parameters in the predetermined rate-distortion points of the sample video are used as the sample coding parameters of the sample video: the sum of the predetermined bit rates corresponding to the encoded videos from the plurality of sample videos respectively is less than the total bit rate, and the sum of the predetermined quality assessment index values corresponding to all the encoded videos respectively is greater than the standard value of the video quality assessment index required by the video demand end for the plurality of encoded videos.
[0011] Optionally, the method of obtaining a candidate rate-distortion point group obtained by a sample video among multiple sample videos under multiple candidate coding parameter conditions includes: encoding the sample video using the candidate coding parameters to obtain the bit rate and quality assessment index values of the encoded video after the encoding process under the candidate coding parameter conditions; obtaining the corresponding bit rates and quality assessment index values after the sample video is encoded using multiple candidate coding parameters respectively; using the candidate coding parameters and the bit rate and quality assessment index values corresponding to the candidate coding parameters as a candidate rate-distortion point of the encoded video; using the candidate rate-distortion points corresponding to the multiple candidate coding parameters respectively as the candidate rate-distortion point group obtained by the sample video under the multiple candidate coding parameter conditions.
[0012] Optionally, it also includes: obtaining standard values of video quality assessment indicators required by the video demand end for multiple encoded videos; determining target encoding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded, and video features of the video to be encoded among the multiple videos to be encoded, including: determining the target encoding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded, the video features of the video to be encoded among the multiple videos to be encoded, and the standard values of the video quality assessment indicators.
[0013] Optionally, the method of determining the target coding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded, the video features of the videos to be encoded in the multiple videos to be encoded, and the standard value of the video quality assessment index includes: predicting the predicted bit rate required for the video to be encoded according to the video features of the video to be encoded; determining the predicted coding parameters required for the video to be encoded according to the predicted bit rate required for the video to be encoded; obtaining the predicted bit rate and predicted quality assessment index value of the video to be encoded after the video to be encoded is encoded with the predicted coding parameters; if the sum of the predicted bit rates corresponding to the encoded videos in the multiple encoded videos corresponding to the multiple videos to be encoded is less than the total bit rate, and the sum of the predicted quality assessment index values corresponding to the encoded videos is greater than the standard value of the video quality assessment index, then using the predicted coding parameters as the target coding parameters of the video to be encoded.
[0014] Optionally, the predicted coding parameters include multiple candidate coding parameters; the method also includes: for a video to be encoded among the multiple videos to be encoded, using the multiple candidate coding parameters to respectively encode the video to be encoded to obtain corresponding multiple predicted bit rates and multiple predicted quality assessment index values; if the predicted bit rates and predicted quality assessment index values respectively corresponding to the multiple candidate coding parameters are both the following conditions, then selecting a target coding parameter from the multiple candidate coding parameters: the sum of the predicted bit rates corresponding to the encoded videos is less than the total bit rate, and the predicted quality assessment index values corresponding to the encoded videos are less than the video quality assessment index standard value.
[0015] Optionally, the selecting a target coding parameter from the multiple candidate coding parameters includes: encoding the video to be encoded respectively using the multiple candidate coding parameters to obtain multiple prediction quality assessment index values after encoding the video to be encoded; comparing the multiple prediction quality assessment index values after encoding the video to be encoded to obtain a target prediction quality assessment index value, wherein the target prediction quality assessment index value is greater than other prediction quality assessment index values among the multiple prediction quality assessment index values except the target prediction quality assessment index value; and using the candidate coding parameter corresponding to the target prediction quality assessment index value as the target coding parameter of the video to be encoded.
[0016] An embodiment of the present application further provides an electronic device, comprising: a processor; and a memory for storing a computer program. After the electronic device is powered on and the computer program is run by the processor, the above method is executed.
[0017] An embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to perform the above method.
[0018] Compared with the prior art, the embodiments of the present application have the following advantages:
[0019] The video encoding method provided in the embodiment of the present application, after extracting the video features of the videos to be encoded from the multiple videos to be encoded, determines the target encoding parameters of the videos to be encoded according to the total bit rates corresponding to the multiple videos to be encoded and the video features of the videos to be encoded. Then, the target encoding parameters are used to encode the videos to be encoded to obtain the encoded videos. In this process, when determining the target encoding parameters of the videos to be encoded, the target encoding parameters corresponding to the videos to be encoded can be determined by the total bit rates corresponding to the multiple videos to be encoded and the video features of the videos to be encoded, without the need to obtain the encoding features of the pre-processed videos after pre-encoding the videos to be encoded, thereby improving the efficiency of determining the target encoding parameters of the videos to be encoded. Moreover, the method provided in the present application determines the target encoding parameters of the videos to be encoded, which can meet the following conditions: the bit rate of the encoded videos obtained after encoding the videos to be encoded using the target encoding parameters is the target bit rate, and the quality assessment index value of the encoded videos is the target quality assessment index value; the sum of the target bit rates corresponding to the encoded videos in the multiple encoded videos corresponding to the multiple videos to be encoded is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos is greater than the quality assessment index standard value required by the video demand end for the encoded videos. Therefore, the video encoding method provided by the present application improves the video encoding efficiency while ensuring the video encoding quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1A flowchart of a video encoding method provided in the first embodiment of the present application.
[0021] Figure 2 P is the gray level co-occurrence matrix provided in the prior art d Schematic diagram of a pixel pair (i, j).
[0022] Figure 3 Schematic diagram of two filtering operators in spatial domain information.
[0023] Figure 4 A schematic diagram of a process of determining target coding parameters of multiple videos to be encoded and encoding the videos to be encoded respectively according to the target coding parameters using a coding parameter prediction model provided in an embodiment of the present application.
[0024] Figure 5 A schematic diagram of a video encoding device provided in accordance with the second embodiment of the present application.
[0025] Figure 6 A schematic diagram of an electronic device provided in the third embodiment of the present application. DETAILED DESCRIPTION
[0026] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0027] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The descriptions used in this application and the appended claims, such as "a", "first", and "second", are not limitations on quantity or sequence, but are used to distinguish the same type of information from each other.
[0028] The embodiments of the present application provide a video encoding method and device, which are described one by one in the following embodiments.
[0029] To facilitate understanding, some relevant concepts and terms involved in the embodiments of the present application are first given.
[0030] During the transmission of a batch of videos, these video files will be subject to the same bandwidth limitation, where bandwidth is the maximum rate of video transmission, that is, the amount of data that can be transmitted per unit time. The total bandwidth during the transmission of this batch of video files can also be determined by determining the target encoding parameters of each video file when the total bit rate is determined, so as to ensure that the sum of the bit rates corresponding to each video in this batch of video files is less than the total bit rate of this batch of videos, and the sum of the target quality assessment index values corresponding to each video can also be greater than the sum of the candidate quality assessment index values corresponding to other encoding parameter conditions.
[0031] The following are explanations of the terms involved in the embodiments of the present application:
[0032] Video Coding: The process of converting a video signal into digital code to efficiently use bandwidth and storage space for storage and transmission. It involves breaking down the video signal into spatially and temporally codable units and applying compression algorithms to reduce the amount of data.
[0033] Coding efficiency: The data compression ratio that a video coding algorithm can achieve with the same image quality. A high coding efficiency means that it can encode at a higher bit rate, thereby reducing the storage space and transmission bandwidth requirements.
[0034] Support Vector Regression (SVR): This is a machine learning algorithm used to establish a regression relationship between input variables and continuous target variables. In video encoding, SVR can be used to establish a rate control model to dynamically adjust encoding parameters based on video content and quality requirements, thereby achieving higher encoding efficiency and higher video quality.
[0035] I-frame (Intra-coded frame): Also called key frame or intra-frame, it is an independent frame in a video sequence. I-frame does not rely on the information of other frames for decoding, and it contains complete image information. In a video sequence, an I-frame is usually inserted at regular intervals (for example, every second). I-frame can be decoded into a complete image, so it is very useful in video editing and random access.
[0036] P frame (Predictive-coded frame): It is called a predicted frame and is a frame type relative to the I frame. P frame is encoded by using the information of the decoded forward reference frame (usually the previous I frame and P frame). P frame only contains the difference information between the current frame and the reference frame, but not the complete image information. This difference information can be represented by motion compensation technology to reduce the amount of data and improve coding efficiency.
[0037] Quantization Parameter (QP): used to control the quantization process in video coding. Quantization is the process of converting a continuous video signal into a discrete numerical representation. By controlling the QP value, the quantization accuracy can be adjusted, thus affecting the coding efficiency and video quality.
[0038] Constant Rate Factor (CRF): A rate control mode that adjusts the encoding bit rate while maintaining constant video quality. By adjusting the CRF value, different encoding efficiencies and file sizes can be achieved while maintaining relatively consistent video quality.
[0039] Rate-distortion curve: describes the change of compression quality under different bit rates. In the process of data compression, in order to reduce the size of data, a certain image or audio quality is usually sacrificed. The rate-distortion curve describes the degree of distortion between the compressed data and the original data under different compression ratios (bit rates). A typical rate-distortion curve uses the bit rate (compression ratio) as the horizontal axis and the distortion (quality loss) as the vertical axis. Generally, as the compression ratio increases, the distortion will also increase, that is, the quality of the compressed data will decrease. Because a high compression ratio will lead to more data loss or information loss.
[0040] Grouped knapsack problem: An optimization problem solving algorithm based on dynamic programming, used to solve a variant of the knapsack problem. In the traditional knapsack problem, there is a group of items and a knapsack, each item has a weight and a value, and the goal is to select some items to put into the knapsack so that their total weight does not exceed the capacity of the knapsack and the total value is maximized. In the grouped knapsack problem, the items are divided into several groups, and only one item in each group can be selected to be put into the knapsack. The goal is to select one item from each group so that their total weight does not exceed the capacity of the knapsack and the total value is maximized.
[0041] It should be noted that the above disclosed information is only used to help understand the present application and does not mean to constitute the prior art known to ordinary technicians in the field.
[0042] The following combination Figures 1 to 4 The video encoding method provided in the first embodiment of the present application is described. Figure 1 A flowchart of a video encoding method provided in the first embodiment of the present application. Figure 1 The video encoding method shown comprises:
[0043] Step S101: performing feature extraction processing on a plurality of videos to be encoded to obtain video features of a video to be encoded among the plurality of videos to be encoded;
[0044] Step S102: determining a target encoding parameter of the video to be encoded based on a total bit rate corresponding to the plurality of videos to be encoded and video features of the video to be encoded among the plurality of videos to be encoded;
[0045] Step S103: encoding the video to be encoded according to the target encoding parameters of the video to be encoded; wherein, when the encoding parameters of the video to be encoded among the multiple videos to be encoded are the corresponding target encoding parameters, the bit rate of the encoded video after the encoding process is the target bit rate, the quality assessment index value of the encoded video is the target quality assessment index value, the sum of the target bit rates corresponding to the encoded videos respectively is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos respectively is greater than the video quality assessment index standard value required by the video demand end for multiple encoded videos.
[0046] The method provided in the embodiment of the present application can be applied to the process in which a video publisher uploads a batch of videos to a video platform, and the client sends the batch of videos to the server. The server determines the target encoding parameters of each video in the batch of videos based on the method provided in the present application, encodes each video based on the target encoding parameters, and transmits it to the video platform. It can also be applied to the video platform to select a batch of videos for the target user. Before showing the batch of videos to the target user, the client of the video platform provides the batch of videos to the server. The server determines the target encoding parameters of each video in the batch of videos based on the method provided in the present application, encodes each video based on the target encoding parameters, and transmits it to the client to show it to the target user.
[0047] The method provided in the embodiment of the present application provides that when determining the target encoding parameters of a video to be encoded in a plurality of videos to be encoded, it is determined based on the total bit rate corresponding to the plurality of videos to be encoded and the video features of the video to be encoded. It does not need to determine the encoding feature data in a pre-encoding manner for the video to be encoded, and obtains the target encoding parameters in a manner of performing multiple encodings, thereby improving the efficiency of determining the target encoding parameters of the plurality of videos to be encoded. Moreover, after the target encoding parameters obtained by the video encoding method provided in the embodiment of the present application are encoded for the video to be encoded, the encoded video can meet the following conditions: the sum of the bit rates corresponding to the encoded videos in the plurality of encoded videos corresponding to the plurality of videos to be encoded is less than the total bit rate corresponding to the plurality of videos to be encoded, and the sum of the quality assessment index values corresponding to the encoded videos is greater than the standard value of the quality assessment index required by the video demand end for the plurality of encoded videos. Therefore, the video encoding method provided in the embodiment of the present application improves the efficiency of determining the target encoding parameters of the plurality of videos to be encoded, while ensuring that the sum of the bit rates of the encoded videos is less than the total bit rate, and ensuring the video quality of the encoded videos, that is, while improving the encoding efficiency, ensuring the video encoding quality.
[0048] Wherein, the video features of the video to be encoded are determined, as described in step S101, and feature extraction processing is performed on multiple videos to be encoded to obtain the video features of the video to be encoded in the multiple videos to be encoded. Specifically, the video features are first extracted for each video to be encoded, and then the target encoding parameters of the video to be encoded are determined. Wherein, the multiple videos to be encoded may be multiple videos to be encoded with an associated relationship. For example, the multiple videos to be encoded are all videos to be encoded about the introduction of dishes. The multiple videos to be encoded may also be multiple fragment videos to be encoded of a complete video, and each fragment video contains different video features. The multiple videos to be encoded include at least two videos to be encoded. Furthermore, each video to be encoded may also include multiple fragment videos to be encoded.
[0049] The multiple videos to be encoded may also be multiple videos to be encoded that are not associated with each other. For example, the multiple videos to be encoded include three videos to be encoded, the first video to be encoded is a video to be encoded whose static picture frame ratio is greater than a preset threshold, the second video to be encoded is a video to be encoded whose dynamic video frame ratio is greater than a preset threshold, and the third video to be encoded is a video to be encoded whose content richness in the video frame is greater than a preset threshold. Therefore, for the above three types of videos to be encoded, their corresponding video features are different, and accordingly, the target encoding parameters required to determine the videos to be encoded in the subsequent steps are also different.
[0050] First, the process of extracting video features from encoded video is described in detail:
[0051] Specifically, feature regions are performed on the video to be encoded from both the spatial domain and the temporal domain to obtain spatial domain features of the video to be encoded and derived features of the spatial domain features, as well as temporal domain features of the video to be encoded and derived features of the temporal domain features.
[0052] The spatial domain features of the video to be encoded include at least one of the following features: Gray Level Co-occurrence Matrix GLCM, used to characterize the texture features of the image; Spatial Information SI (Spatial Information), used to characterize the amount of spatial details in the image; Colorfulness CF (Colorfulness), used to characterize the saturation or intensity of the color in the image. The following describes them one by one:
[0053] The following first describes the first aspect of the spatial domain features: the gray-level co-occurrence matrix GLCM, which is used to describe the image texture features. Specifically, the image is converted into an image with a grayscale level of L, and then a gray-level co-occurrence matrix is generated based on the relationship between the grayscale values of the pixels. The secondary statistics are obtained based on the gray-level co-occurrence matrix to describe the image texture features.
[0054] The size of the gray-level co-occurrence matrix is LxL, and each value (i, j) of the gray-level co-occurrence matrix corresponds to a fixed distance d from the point with gray level i in the same direction = (D x , D y ) after reaching the point with gray level j, the frequency of occurrence is P d (i, j) represents. Among them, P d (i, j) is obtained by formula 1.
[0055] P d (i, j) = P d (i,j|d,θ)(i,j=0,1,2,…,L-1) Formula 1
[0056] Among them, i and j represent the grayscale value of the pixel, d represents the distance between two points, and θ represents the angle between two points. Its value is usually 0°, 45°, 90°, and 135°. For details, please refer to Figure 2 , which is P in the gray level co-occurrence matrix provided in the prior art d Schematic diagram of a pixel pair (i, j).
[0057] Based on formula 1, when the distance relationship between two points is d and the angle relationship between two points is θ, the gray level co-occurrence matrix is in, It is expressed by formula 2.
[0058]
[0059] In order to facilitate the analysis of each element in the gray-level co-occurrence matrix, each element in the gray-level co-occurrence matrix is normalized to obtain the normalized gray-level co-occurrence matrix. The specific method of normalizing each element is as follows: Each element P in d (i, j) is divided by the sum of all elements in the gray-level co-occurrence matrix to get the average value of each element Then, the secondary statistics of the normalized gray-level co-occurrence matrix are extracted as follows:
[0060] The secondary statistics of the gray level co-occurrence matrix GLCM include at least one of the following:
[0061] (1) Entropy of Gray Level Co-occurrence Matrix GLCM ent (where ent is the abbreviation of entropy), which is used to characterize the complexity or non-uniformity of image texture features. The larger the entropy of the gray-level co-occurrence matrix, the more complex the texture information in the image; conversely, the simpler the texture information in the image. ent Calculated by formula 3:
[0062]
[0063] (2) Correlation of Gray Level Co-occurrence Matrix (GLCM) cor (where cor is the abbreviation of correlation) is used to characterize the similarity of the elements of the gray-level co-occurrence matrix in the column or row direction. When the element values in the gray-level co-occurrence matrix are uniform and equal, the value of its element correlation is larger; on the contrary, when the elements in the matrix are uneven, the value of its element correlation is smaller. Among them, the correlation of the gray-level co-occurrence matrix GLCM cor Through the public
[0064] Formula 4 calculates:
[0065]
[0066] in,
[0067]
[0068] (3) Contrast of Gray Level Co-occurrence Matrix GLCM con (Con is the abbreviation of Contrast), which is used to measure how the element values of the matrix are distributed and the degree of local changes in the image, and to characterize the clarity of the image and the depth of the texture grooves. The larger the contrast value, the deeper the texture grooves, the greater the contrast, and the clearer the effect; conversely, the smaller the contrast value, the shallower the texture grooves, and the more blurred the effect. Among them, the contrast of the gray level co-occurrence matrix GLCM con Calculated by formula 5:
[0069]
[0070] (4) Homogeneity of Gray Level Co-occurrence Matrix GLCM hom (hom is the abbreviation of homogeneity) and is used to characterize the local variation of image texture. A high homogeneity indicates that the local area of the image is very uniform, while a low homogeneity indicates that the local area of the image is not uniform. hom Calculated by formula 6:
[0071]
[0072] (5) Energy GLCM of gray-level co-occurrence matrix ene (ene is the abbreviation of energy) and is used to characterize the uniformity of image grayscale distribution and the coarseness of texture. ene Calculated by formula 7:
[0073]
[0074] The following is an explanation of the spatial domain features and the temporal domain features in combination with Table 1:
[0075] Table 1
[0076]
[0077]
[0078]
[0079] Among them, as shown in Table 1, (1) the entropy of the gray level co-occurrence matrix GLCM ent Including the entropy mean of the gray-level co-occurrence matrix (F9, GLCM ent _mean, mean means average value): the average value between the values used to characterize the complexity or non-uniformity of image texture features; the entropy standard deviation of the gray-level co-occurrence matrix (F10, GLCM ent _std, std is the abbreviation of StandardDeviation): the standard deviation value between the values used to characterize the complexity or non-uniformity of image texture features.
[0080] (2) Correlation of Gray Level Co-occurrence Matrix (GLCM) cor Including the correlation average of the gray level co-occurrence matrix (F1, GLCM cor _mean): the average value between the values used to characterize the similarity of the elements of the gray-level co-occurrence matrix in the column or row direction; the standard deviation of the correlation of the gray-level co-occurrence matrix (F2, GLCM cor _std): The standard deviation between the values used to characterize the similarity of the elements of the gray-level co-occurrence matrix in the column or row direction.
[0081] (3) Contrast of Gray Level Co-occurrence Matrix GLCM con Contrast averages including gray-level co-occurrence matrices (F3, GLCM con _mean): the average value between the values used to characterize the clarity of the image and the depth of the texture grooves; the contrast standard deviation of the gray level co-occurrence matrix (F4, GLCM con _std): The standard deviation between the values used to characterize the clarity of the image and the depth of the texture grooves.
[0082] (4) Homogeneity of Gray Level Co-occurrence Matrix GLCM hom Including the homogeneity mean of gray level co-occurrence matrix (F7, GLCM hom_mean): the average value between the values used to characterize the local variation of image texture; the homogeneity standard deviation of the gray level co-occurrence matrix (F8, GLCM hom _std): The standard deviation between the values used to characterize the degree of local variation in image texture.
[0083] (5) Energy GLCM of gray-level co-occurrence matrix ene Including the energy average of the gray-level co-occurrence matrix (F5, GLCM ene _mean): The average value used to characterize the uniformity of the grayscale distribution of the image and the coarseness of the texture, and the energy standard deviation of the gray-level co-occurrence matrix (F6, GLCM ene _std): It is used to characterize the standard deviation between the values of the uniformity of the grayscale distribution of the image and the coarseness and fineness of the texture.
[0084] The above is the feature description information contained in the secondary statistics of the gray-level co-occurrence matrix.
[0085] The second feature of the spatial domain feature is described below: spatial domain information SI, which represents the amount of spatial detail in a frame of image. The spatial domain refers to the distribution of the image or signal in spatial position, which corresponds to the time domain, which refers to the change of the signal over time. The more complex the scene is in space, the higher the corresponding SI value.
[0086] The calculation method of SI is as shown in Formula 8:
[0087] SI=σ{G(x,y)} Formula 8
[0088] Among them, σ represents the variance of G(x,y);
[0089] G(x,y) is expressed by Formula 9:
[0090]
[0091] Among them, (x, y) represents the pixel point in the image, G 1 , G 2 They are the images obtained by passing the two filtering operators, where the two filtering operators are Figure 3 express, Figure 3 It is a schematic diagram of two filtering operators in the spatial domain information. Figure 3 301 in the code indicates G 1 , 302 means G 2 .
[0092] If the SI value is large, it means that the image contains a lot of edge information.
[0093] As shown in Table 1, the derived features of the spatial information SI include the following representations:
[0094] (1) Average value of spatial information (F26, SI_mean): Spatial information (SI) refers to the grayscale value of each pixel in the image or the intensity value of the signal at a spatial position. These values carry basic information about the image content or signal characteristics, such as brightness, color distribution, texture features, etc.
[0095] Calculating the mean value of the spatial information (SI_mean) is to perform arithmetic averaging on the grayscale values of all pixels in the image to obtain a single value to represent the average brightness or signal strength level of the entire image.
[0096] (2) Standard deviation of spatial information (F27, SI_std): It is used to characterize the degree of change or dispersion of the grayscale values of all pixels in the image relative to their average value. That is, it is an indicator that characterizes the uniformity or variability of the distribution of all pixel data in the image, so as to determine the spatial heterogeneity of all pixel data or the clarity and noise level of the image.
[0097] (3) Average value between average values of spatial information (F28, mean_SI_mean): After calculating the average values of spatial information of different regions in the image, the average values of multiple different regions in the image are calculated again to determine the similarity of spatial information of different regions.
[0098] Alternatively, after calculating the average value of the spatial domain information in the same area of the image at different times, the average values corresponding to different times are calculated again to determine the similarity of the image at different time points.
[0099] (4) The standard deviation between the mean values of the spatial information (F29, mean_SI_std) is used to characterize the images of different regions in the image. After calculating the mean values of the spatial information of the images respectively, the standard deviation of the mean values of multiple different regions in the image is calculated to determine the fluctuation or degree of deviation between the spatial information of different regions.
[0100] Alternatively, after calculating the average value of the spatial domain information in the same area of the image at different times, the standard deviation is calculated again for the average values corresponding to different times to determine the fluctuation or deviation degree between the spatial domain information of the image at different time points.
[0101] The following describes the third feature of the spatial domain feature: chromaticity CF. The chromaticity feature mainly describes the saturation or intensity of the color in the image. By analyzing the chromaticity, we can understand the richness, intensity and color distribution of the image color. Among them, the chromaticity is calculated by formula 10:
[0102] CF=σ rgyb +0.3*μrgyb Formula 10
[0103] in,
[0104] rg(i,j)=|R(i,j)-B(i,j)|, yb(i,j)=|0.5*R(i,j)+G(i,j)-B(i,j)|
[0105] Among them, μ rgyb represents the average color factor, σ rgyb Represents the variance color factor.
[0106] R(i,j), G(i,j), B(i,j) represent the values of the R, G, B channels of the (i, j)th pixel in the RGB color space. rg represents the mean of rg(i,j), μ yb Represents the mean of yb(i,j). σ rg represents the standard deviation of rg(i,j), σ yb Represents the standard deviation of yb(i,j).
[0107] Among them, as shown in Table 1, the derived features of chromaticity CF include the following representations:
[0108] (1) Average color value (F22, CF_mean): The color values of all pixels in the image are summed and then divided by the total number of pixels to obtain the average color value (CF_mean) to represent the overall average color level of the image.
[0109] (2) Color standard deviation (F23, CF_std): used to characterize the difference between the color values of all pixels in the image and their corresponding average value.
[0110] The above is the description process of the three aspects of spatial characteristics and their derived characteristics.
[0111] The following describes the temporal characteristics of the video to be encoded:
[0112] The time domain features of the video to be encoded include at least one of the following features: time domain information TI (Temporal Information), which is used to characterize the time change of the video sequence; normalized cross correlation NCC (Normalized Cross Correlation), which is used to characterize the correlation between two adjacent video frames; time domain coherence TC (Temporal Coherence), which is used to characterize the correlation between the time domain signals of two adjacent video frames.
[0113] The following first describes the first aspect of the time domain feature: the time domain information TI, which is used to characterize the temporal variation of the video sequence. The higher the degree of motion of the video sequence, the higher the TI value. The time domain information TI is calculated by finding the frame difference between the image brightness component of the nth frame and the n-1th frame. It is specifically calculated by formula 11:
[0114]
[0115] Among them, Luma n (x, y) represents the brightness component of the (x, y)th point of the nth frame image; Luma n-1 (x, y) represents the brightness component of the (x, y)th point position of the n-1th frame image.
[0116] As shown in Table 1, the derived features of the time domain information TI include the following representations:
[0117] (1) The mean value of the time domain information (F24, TI_mean), (2) The standard deviation of the time domain information (F25, TI_std).
[0118] The following describes the second aspect of the time domain feature: normalized cross correlation NCC, an algorithm based on statistics to calculate the correlation between two sets of sample data, and its value range is between [-1, 1]. When the value of NCC is 1, it means that the correlation is high, and when the value of NCC is -1, it means that there is no correlation at all. In the embodiment of the present application, the image frame is first converted into a grayscale image, and then the correlation between two adjacent image frames is calculated. Among them, the normalized cross correlation NCC is calculated by formula 12:
[0119]
[0120] Among them, f n (i, j) represents the value of the grayscale image of the nth video frame at the coordinate value (i, j); Represents the average value of all grayscale values of the nth video frame; H and W represent the height and width of the video frame respectively.
[0121] As shown in Table 1, the derived features of the normalized cross-correlation NCC include the following representations:
[0122] (1) The mean value of the normalized cross-correlation (F20, NCC_mean), (2) The standard deviation of the normalized cross-correlation (F21, NCC_std).
[0123] The third aspect of the time domain feature is described below: time domain coherence TC, which is used to measure the correlation between two signals, and its value range is [0, 1], where 0 represents no correlation. The calculation of normalized cross-correlation is implemented as follows: the cross power spectrum density between the two signals and their respective power spectrum densities are calculated, and then the cross power spectrum density between the two signals and their respective power spectrum densities are combined to obtain the value of the normalized cross-correlation. This can be implemented specifically by formula 13:
[0124]
[0125] Among them, |P xy (μ,v)| 2 represents the square of the cross-power spectrum modulus between two signals; P xx (μ,v),P yy (μ,v) represent the auto-power spectrum, P xy (μ,v) represents the cross power spectrum.
[0126] Among them, the auto-power spectrum and the cross-power spectrum are calculated by the formula group provided by formula 14:
[0127]
[0128] Among them, F x (μ,v),F y (μ,v) represents the Fourier transform of the two signals, Represent the conjugate functions of the Fourier transform of the two signals respectively.
[0129] Among them, as shown in Table 1, the derived characteristics of time domain coherence TC include the following representations:
[0130] (1) The average value between the average values of time domain coherence (F11, mean_TC_mean): used to characterize the average value of a group of time domain coherence average value data. It is calculated as follows:
[0131] Step 1, calculate the mean value mean_TC of a set of time domain coherence data:
[0132] Time domain coherence TC is used to measure the correlation between two signals. A group contains 10 signal pairs, and each of the 10 signal pairs corresponds to a time domain coherence data. By calculating the average value mean_TC of these 10 time domain coherence data, the overall time domain coherence level of this group of time domain coherence data is characterized.
[0133] Step 2, calculate the average value mean_TC_mean between the average values of multiple groups of time domain coherence data:
[0134] A plurality of signal pairs are obtained, for example, 3 signal pairs, each signal pair contains 10 signal pairs, and the average value of the time domain coherence data of each signal pair is obtained based on the above method, then the three signal pairs can obtain 3 time domain coherence data average values. The 3 time domain coherence data average values are taken as a group of time domain coherence average values, and the group of time domain coherence average values is divided by the number of groups (3) to obtain the average value (mean_TC_mean) between the time domain coherence average values. Mean_TC_mean is used to reflect the overall level of the time domain coherence data of the three signal pairs.
[0135] (2) Standard deviation between the mean values of time-domain coherence (F12, mean_TC_std): A statistic used to characterize the degree of dispersion of a set of time-domain coherence mean value data, that is, it reflects the volatility or variation range of the time-domain coherence mean value data. It is calculated as follows:
[0136] Step 1, calculate the mean value mean_TC of a set of time domain coherence data:
[0137] Time domain coherence TC is used to measure the correlation between two signals. A group contains 10 signal pairs, and each of the 10 signal pairs corresponds to a time domain coherence data. By calculating the average value mean_TC of these 10 time domain coherence data, the overall time domain coherence level of this group of time domain coherence data is characterized.
[0138] Step 2, calculate the standard deviation mean_TC_mean between the mean values of multiple groups of time domain coherence data:
[0139] A plurality of groups of signal pairs are obtained, for example, 3 groups of signal pairs, each group of signal pairs includes 10 signal pairs, and the average value of the time domain coherence data of each group of signal pairs is obtained based on the above method, then the three groups of signal pairs can obtain 3 time domain coherence data average values, and the 3 time domain coherence data average values are used as a group of time domain coherence average values. The group of time domain coherence average values is divided by the number of groups (3) to obtain the average value (mean_TC_mean) between the time domain coherence average values.
[0140] In order to measure the degree of dispersion between each time-domain coherence data average value and its corresponding average value (mean_TC_mean) in this set of time-domain coherence data average values (that is, the volatility or variation range between this set of time-domain coherence data average values), the standard deviation of this set of time-domain coherence data average values is calculated. The specific calculation is as follows: for each time-domain coherence data average value, calculate the square of the difference between it and the average value mean_TC_mean, and obtain the square of the difference corresponding to the three time-domain coherence data average values. After adding the squares of the difference corresponding to the three time-domain coherence data average values, divide them by the number of time-domain coherence data average values (3) to obtain the variance. Finally, take the square root of the variance to obtain the standard deviation (mean_TC_std) between the time-domain coherence data average values.
[0141] (3) Average value between standard deviations of time-domain coherence (F13, std_TC_mean): used to represent the average value of standard deviations of multiple sets of time-domain coherence data. Each set of time-domain coherence data has its own standard deviation, which reflects the degree of dispersion or fluctuation of each data set. std_TC_mean is the average value of these standard deviations to obtain an indicator representing the overall fluctuation. It is calculated as follows:
[0142] Step 1, calculate the standard deviation (std_TC) between a set of time domain coherence data:
[0143] Time domain coherence TC is used to measure the correlation between two signals. A group contains 10 signal pairs, and the 10 signal pairs correspond to time domain coherence data. In order to measure the average value of each time domain coherence data and its corresponding coherence data in this group of time domain coherence data The degree of dispersion between the time domain coherence data (that is, the volatility or variation range between this set of time domain coherence data) is calculated, and the standard deviation of this set of time domain coherence data is calculated. The specific calculation method is as follows: Calculate the average value of this set of time domain coherence data (10 TC values) Calculate each time domain coherence data TC separately i (i=1,2,3,…,10) and its corresponding average value The square of the difference between the two sets of time domain coherence data is calculated to obtain the square of the difference between the 10 sets of time domain coherence data. The square of the difference between the two sets of time domain coherence data is added together and divided by the number of time domain coherence data (10) to obtain the variance. Finally, the square root of the variance is taken to obtain the standard deviation (std_TC) between the two sets of time domain coherence data.
[0144] Step 2, calculate the mean value std_TC_mean between the standard deviations of multiple sets of time domain coherence data:
[0145] For multiple groups of time-domain coherence data, in order to obtain the average value between the standard deviation values of the multiple groups of time-domain coherence data, for example, 3 groups of time-domain coherence data, each group of time-domain coherence data contains 10 time-domain coherence data, and each group of time-domain coherence data has a corresponding standard deviation (std_TC), the average value of these 3 corresponding standard deviations is taken to obtain the average value (std_TC_mean) between the standard deviations of the 3 groups of time-domain coherence data.
[0146] (4) Standard deviation between standard deviations of time-domain coherence (F14, std_TC_std): used to represent the standard deviation between standard deviations of multiple sets of time-domain coherence data. Each set of time-domain coherence data has its own standard deviation (std_TC), which reflects the degree of discreteness or fluctuation of each data set. std_TC_std is the standard deviation of the standard deviations of multiple sets of time-domain coherence data to obtain the degree of discreteness or fluctuation between the standard deviations of multiple sets of time-domain coherence data. It is calculated as follows:
[0147] Step 1, calculate the standard deviation (std_TC) between a set of time domain coherence data:
[0148] Time domain coherence TC is used to measure the correlation between two signals. A group contains 10 signal pairs, and each of the 10 signal pairs corresponds to a time domain coherence data. In order to measure the average value of each time domain coherence data and its corresponding coherence data in this group of time domain coherence data The degree of dispersion between the time domain coherence data (that is, the volatility or variation range between this set of time domain coherence data) is calculated, and the standard deviation of this set of time domain coherence data is calculated. The specific calculation method is as follows: Calculate the average value of this set of time domain coherence data (10 TC values) Calculate each time domain coherence data TC separately i (i=1,2,3,…,10) and its corresponding average value The square of the difference between the two sets of time domain coherence data is calculated to obtain the square of the difference between the 10 sets of time domain coherence data. The square of the difference between the two sets of time domain coherence data is added together and divided by the number of time domain coherence data (10) to obtain the variance. Finally, the square root of the variance is taken to obtain the standard deviation (std_TC) between the two sets of time domain coherence data.
[0149] Step 2, calculate the standard deviation std_TC_std between the standard deviations of multiple sets of time domain coherence data:
[0150] For multiple sets of time-domain coherence data, in order to obtain the fluctuation and discreteness between the standard deviation values of multiple sets of time-domain coherence data, for example, 3 sets of time-domain coherence data, each set of time-domain coherence data contains 10 time-domain coherence data, and each set of time-domain coherence data has a corresponding standard deviation (std_TC), the standard deviation of these 3 corresponding standard deviations is calculated again, specifically:
[0151] Calculate the mean value (std_TC_mean) of the three corresponding standard deviations, then calculate the square of the difference between each standard deviation (std_TC) and its corresponding mean value (std_TC_mean) to obtain the square of the difference between the three standard deviations (std_TC) and their corresponding mean values (std_TC_mean). Add the squares of the differences between the three standard deviations (std_TC) and their corresponding mean values (std_TC_mean) and divide by 3 to obtain the variance. Finally, take the square root of the variance to obtain the standard deviation (std_TC_std) between the standard deviations of the three sets of time-domain coherence data.
[0152] (5) Skewness of the mean value of time-domain coherence (F15, mean_TC_skew, where skew is the abbreviation of skewness): refers to the statistic obtained after skewness analysis of the mean value of a set of time-domain coherence data, which is used to characterize the skew direction and degree of the mean value of this set of time-domain coherence data. If the mean distribution of this set of time-domain coherence data is symmetrical, the skewness value is 0; if the mean distribution of this set of time-domain coherence data is skewed to the right, the skewness value is positive; if the mean distribution of this set of time-domain coherence data is skewed to the left, the skewness value is negative. Through mean_TC_skew, it is determined whether the time series coherence data is concentrated on one side of the mean value, or whether there are outliers, etc.
[0153] The skewness of the mean value of the time domain coherence (mean_TC_skew) is calculated by the following steps:
[0154] Step 1: Calculate the mean value (mean_TC), calculate the mean value of a set of time domain coherence data (TC). Step 2: Calculate the skewness, calculate the skewness of the mean value calculated in step 1. The calculation formula of skewness is usually based on the third-order moment and fourth-order moment of the sample data, as shown in formula 15:
[0155]
[0156] Where n represents the number of sample data, TC irepresents the time domain coherence value of each sample data, mean_TC represents the average value of the time domain coherence data of n sample data, and s is the standard deviation value of the time domain coherence data of n sample data.
[0157] (6) Skewness of the standard deviation of time-domain coherence (F16, std_TC_skew): refers to the statistic obtained after skewness analysis of the standard deviation values of a set of time-domain coherence data, which is used to characterize the skew direction and degree of the standard deviation values of this set of time-domain coherence data. If the standard deviation value distribution of this set of time-domain coherence data is symmetrical, the skewness value is 0; if the standard deviation value distribution of this set of time-domain coherence data is skewed to the right, the skewness value is positive; if the standard deviation value distribution of this set of time-domain coherence data is skewed to the left, the skewness value is negative. Through std_TC_skew, it is determined whether the standard deviation values of the time series coherence data are concentrated on one side, or whether there are outliers, etc.
[0158] The skewness of the standard deviation of the time domain coherence (std_TC_skew) is calculated by the following steps:
[0159] Step 1: Calculate the standard deviation (std_TC) for a set of time domain coherence data (TC) to measure the degree of dispersion of these data. Step 2: Calculate the skewness for the standard deviation value calculated in step 1. The calculation formula for skewness is usually based on the third-order moment and fourth-order moment of the sample data. The specific calculation formula is as shown in formula 16:
[0160]
[0161] Where x is the individual value of std_TC, μ is the average value of std_TC, n is the number of std_TC, and std_TC is the standard deviation of the time domain coherence data.
[0162] (7) Divergence of the mean value of time-domain coherence (F17, mean_TC_kur): used to characterize the sharpness or flatness of the mean value distribution of time-domain coherence data. If the value of mean_TC_kur is greater than 3 (the kurtosis of the normal distribution is 3), it means that the distribution of mean_TC is sharper than the normal distribution, that is, the data is more concentrated near the mean value and the tail is shorter; if the value of mean_TC_kur is less than 3, it means that the distribution of mean_TC is flatter than the normal distribution, that is, the data is more widely distributed and the tail is longer.
[0163] (8) Entropy of the mean value of time-domain coherence (F18, mean_TC_entropy): used to measure the uncertainty or information content of a series of time-domain coherence data. If mean_TC_entropy is low, it indicates that the coherence distribution of the signal is relatively concentrated, that is, the coherence level of the signal is similar at most time points or frequency bands, which indicates that the signal behavior is relatively regular or predictable. If mean_TC_entropy is high, it indicates that the coherence of the signal varies greatly with time or frequency, has high complexity or irregularity, and the signal behavior in different time periods or frequency bands is significantly different and difficult to predict.
[0164] (9) Entropy of the standard deviation of time-domain coherence (F19, std_TC_entropy): used to characterize the uncertainty and complexity of the distribution of time-domain coherence changes. If std_TC_entropy is low, it means that the changes in time-domain coherence are relatively small and regular, and the information uncertainty contained in its standard deviation is low, that is, the fluctuation pattern of time-domain coherence is relatively simple and predictable. If std_TC_entropy is high, it means that the standard deviation of time-domain coherence itself has a high degree of uncertainty or complexity, that is, the change pattern of time-domain coherence is very diverse and difficult to accurately predict, which reflects that the behavior of the signal at different time points or under different conditions is significantly different.
[0165] The above is the information of the derived features of the spatial domain features and the temporal domain features included in Table 1, which includes 29 derived features. In addition, other features can be added based on these 29 features.
[0166] By acquiring the above-mentioned video features of the video image, target encoding parameters for encoding the video to be encoded are analyzed and determined according to the video features, thereby improving the efficiency and accuracy of acquiring the target encoding parameters.
[0167] After obtaining the video features of the videos to be encoded of the multiple videos to be encoded, the target encoding parameters of the videos to be encoded are determined according to the video features of the videos to be encoded. When determining the target encoding parameters of the videos to be encoded, as described in step S102, the target encoding parameters of the videos to be encoded are determined based on the total bit rates corresponding to the multiple videos to be encoded and the video features of the videos to be encoded among the multiple videos to be encoded.
[0168] Among them, the total bit rate corresponding to the multiple videos to be encoded specifically refers to the total bandwidth condition of the multiple videos to be encoded during the video transmission process, which refers to the data transmission rate that the network can support, that is, the amount of data that can be transmitted through the network per unit time.
[0169] In order to satisfy the requirement that the sum of the bit rates of all the encoded videos is less than the total bit rate after the encoding process of the multiple videos to be encoded, the encoding parameters of each of the multiple videos to be encoded need to be adjusted. The target encoding parameters of each of the multiple videos to be encoded that are finally determined can meet the following conditions: the sum of the bit rates of the encoded videos is less than the total bit rate, and the sum of the quality assessment index values of the encoded videos is greater than the standard value of the video quality assessment index required by the video demand end for the multiple videos to be encoded.
[0170] The encoding parameters may include at least one of the following parameters: bit rate, resolution, frame rate, quantization parameter or constant quality rate.
[0171] Bit rate is a key factor that directly determines the bit rate of the encoded video and affects the file size and image quality of the encoded video. Bit rate refers to the amount of information transmitted per unit time. The unit of bit rate is usually bits per second or its multiples, such as kilobits per second, megabits per second, etc. Setting the target bit rate of the video to be encoded in the video encoding software specifies the rate at which the encoder compresses the video to be encoded, so that the encoded video reaches the target file size or meets the target network transmission requirements.
[0172] Resolution is the pixel size of the video, such as 1080p, 720p, etc. Lowering the resolution can significantly reduce the bit rate required to encode the video, but it will also reduce the picture details of the video frame.
[0173] The frame rate is the number of frames displayed per second in a video. A high frame rate provides a smoother dynamic effect, but it increases the bit rate requirement. Properly reducing the frame rate can reduce the bit rate requirement, thereby reducing the bandwidth required for the encoded video.
[0174] Quantization parameter or constant quality rate, these two parameters are used to control the degree of compression in the encoder. The larger the value, the greater the degree of compression, the smaller the bit rate of the encoded video, and the lower the quality assessment index value of the encoded video.
[0175] Based on the above analysis, it can be seen that the coding parameters are particularly important for determining the bit rate and quality assessment index value of the encoded video. Therefore, in order to make the target coding parameters of the video to be encoded among the multiple videos to be encoded meet the above conditions, the target coding parameters can be determined in at least the following ways in the embodiment of the present application, which are described below respectively.
[0176] The first method for determining target encoding parameters: determining the video content type of the video to be encoded among the multiple videos to be encoded according to the video features of the video to be encoded among the multiple videos to be encoded; classifying the videos to be encoded among the multiple videos to be encoded according to the video content type to which the video to be encoded belongs, and obtaining at least one video group to be encoded, wherein the video content types of the videos to be encoded in the video group to be encoded belong to the same video content type; based on the total bit rate corresponding to the multiple videos to be encoded and in combination with the video content type of the video group to be encoded, determining the target encoding parameters of the video group to be encoded as the target encoding parameters of the video to be encoded in the video group to be encoded.
[0177] After obtaining the video features of the video to be encoded, determine the video content type to which the video to be encoded belongs. For example, the first video content type of the video to be encoded is a real-time transmission content type, such as a video stream of a speaker in a meeting, or a live video stream. The second video content type of the video to be encoded is a static transmission content type, such as a recorded course video, or a recorded product introduction video. Among them, compared with the second video content type, the first video content type has higher requirements on video quality. Therefore, the bit rate allocated to the video of the first video content type is higher than the bit rate allocated to the video of the second video content.
[0178] For another example, the third video content type of the video to be encoded is a static display content type. For example, the video to be encoded is a video stream formed by multiple pictures with similar contents, which belongs to a static display picture. The fourth video content type of the video to be encoded is a dynamic content type. For example, the video to be encoded contains a video stream formed by multiple different actions, which belongs to a dynamic picture. Compared with the fourth video content type, the third video content type has a higher video quality requirement. Therefore, the bit rate allocated to the video of the fourth video content type is higher than the bit rate allocated to the video of the third video content type.
[0179] For another example, the fifth video content type of the video to be encoded is a type with rich picture detail information, for example, the proportion of detail information content respectively contained in multiple video frames of the video to be encoded in the video frame is greater than a preset proportion threshold. The sixth video content type of the video to be encoded is a type with poor picture detail information, for example, the proportion of detail information content respectively contained in multiple video frames of the video to be encoded in the video frame is less than or equal to a preset proportion threshold. Compared with the sixth video content type, the fifth video content type has higher video quality requirements, and therefore, the bit rate allocated to the video of the fifth video content type is higher than the bit rate allocated to the video of the sixth video content type.
[0180] The multiple videos to be encoded may be videos to be encoded of the same video content type or videos to be encoded of different video content types. For the latter, the multiple videos to be encoded are classified according to the video content types to which they belong, and according to the difference in the requirements of different video content types on video quality, the bit rate required for the video corresponding to the video content type is determined, thereby determining the target encoding parameters of the video corresponding to the video content type.
[0181] Because the total bit rate corresponding to the multiple videos to be encoded is the total network bandwidth condition currently used by them, under the condition of satisfying the total bandwidth, the target encoding parameters are determined for the videos corresponding to different video content types, so that the sum of the bit rates of all the videos to be encoded after encoding is less than the total bit rate. In this process, after the videos of the same video content type among the multiple videos to be encoded are classified, a target encoding parameter is determined for the videos of the same video content type, avoiding the need to determine the corresponding target encoding parameter for each video to be encoded separately, so as to reduce the amount of calculation in the process of determining the target encoding parameter.
[0182] For example, if the total bandwidth condition of a network is 5Mbps (megabits per second), the multiple videos to be encoded include 5 videos to be encoded. In this case, it is necessary to ensure that the sum of the bit rates of the 5 videos to be encoded after encoding is less than or equal to 5Mbps. Therefore, it is necessary to weigh and allocate the target encoding parameters of the 5 videos to be encoded. If the video content types of the first 2 videos to be encoded are the above-mentioned first category of video content types, and the video content types of the last 3 videos to be encoded are the above-mentioned second category of video content types, then the bit rate allocated to the video belonging to the first category of video content types is higher than the bit rate allocated to the video belonging to the second category of video content types. In order to reduce the amount of calculation of the target encoding parameters of the videos to be encoded, here, one target encoding parameter can be determined for the 2 videos to be encoded belonging to the first category of video content types, and one target encoding parameter can be determined for the last 3 videos to be encoded belonging to the second category of video content types.
[0183] Correspondingly, encoding the video to be encoded according to the target encoding parameter of the video to be encoded includes: performing joint encoding processing on the videos to be encoded included in the video group to be encoded according to the target encoding parameter of the video group to be encoded.
[0184] The target encoding parameters of the videos to be encoded that belong to the same video content type are the same. Therefore, multiple videos to be encoded that belong to the same video content type among the multiple videos to be encoded can be jointly encoded, reducing the amount of calculation in the process of determining the target encoding parameters, thereby improving the encoding efficiency.
[0185] The second method for determining target coding parameters: based on the total bit rate corresponding to the multiple videos to be encoded, determining the coding parameter prediction models corresponding to the multiple videos to be encoded; inputting the video features of the videos to be encoded in the multiple videos to be encoded into the coding parameter prediction model respectively, and obtaining the target coding parameters for the videos to be encoded output by the coding parameter prediction model; wherein the coding parameter prediction model is used to determine the target coding parameters of the video to be encoded according to the video features of the video to be encoded, and the target coding parameters meet the following conditions: after encoding the video to be encoded using the target coding parameters, a target bit rate and a target quality assessment index value of the encoded video are obtained; the sum of the target bit rates corresponding to the encoded videos in the multiple encoded videos corresponding to the multiple videos to be encoded is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos is greater than the standard value of the video quality assessment index required by the video demand end for the multiple encoded videos.
[0186] In order to make the sum of the bit rates of the multiple videos to be encoded less than the total bit rate (total bandwidth condition), the embodiment of the present application can determine the target encoding parameters of the multiple videos to be encoded by a pre-trained encoding parameter prediction model. One total bit rate corresponds to one encoding parameter prediction model.
[0187] First, according to the total bit rates corresponding to the multiple videos to be encoded, the coding parameter prediction models corresponding to the multiple videos to be encoded are determined. Then, the coding parameter prediction model determines the target coding parameters of the videos to be encoded according to the video features of the videos to be encoded. In this process, the coding parameter prediction model determines the target coding parameters according to the video features of the videos to be encoded, rather than performing pre-coding processing on the coding parameters, obtaining coding feature data according to the pre-coding results, and then determining the target coding parameters. This reduces the amount of calculation in the process of determining the target coding parameters and improves the efficiency of determining the target coding parameters.
[0188] Moreover, the target coding parameters obtained by the coding parameter prediction model can meet the following conditions: after the video to be encoded is encoded using the target coding parameters, the target bit rate and target quality evaluation index value of the encoded video are obtained. And the sum of the target bit rates of multiple encoded videos is less than the total bit rate, and the sum of the target quality evaluation index values is less than the standard value of the video quality evaluation index required by the video demand side for multiple encoded videos. Therefore, the process of determining the target coding parameters through the coding parameter prediction model obtained by pre-training, while improving the determination rate of the target coding parameters, also ensures that the video quality of the encoded video meets the requirements of the video demand side, that is, while improving the coding efficiency, it also ensures the video quality of the encoded video.
[0189] The encoding parameter prediction model can be trained as follows:
[0190] Obtain a total bit rate corresponding to a plurality of sample videos, as well as sample video features and sample coding parameters of sample videos in the plurality of sample videos; input the total bit rate corresponding to the plurality of sample videos and the sample video features of the sample videos into an initial coding parameter prediction model to obtain initial coding parameters for the sample videos output by the initial coding parameter prediction model; obtain a loss value between the initial coding parameters and the sample coding parameters of the sample video; sum the loss values corresponding to the sample videos in the plurality of sample videos respectively to obtain a total loss value corresponding to the plurality of sample videos; adjust the parameters of the initial coding parameter prediction model based on the total loss value to obtain a trained coding parameter prediction model.
[0191] Among them, the multiple sample videos can be multiple historical videos obtained in the historical processing process, and the target multiple historical videos are selected as multiple sample videos from the multiple historical videos. The sample coding parameters of the sample videos in the multiple sample videos can meet the following conditions: the sample bit rate obtained after the sample video is encoded by the sample coding parameters is less than the total bit rate corresponding to the multiple sample videos, and the sample quality evaluation index value after the encoding process is greater than the quality evaluation index standard value required by the video demand end after encoding the multiple sample videos. The initial coding parameter prediction model is trained by the total bit rate corresponding to the multiple sample videos and the sample video features of the sample videos in the multiple sample videos until the sum of the loss values between the initial coding parameters obtained by the initial coding parameter prediction model and the sample coding parameters meets the preset conditions, indicating that the coding parameter prediction model training is completed.
[0192] The coding parameter prediction model used in the embodiment of the present application can be a target model obtained by training the support vector regression SVR model. Figure 4 To explain, Figure 4A schematic diagram of a process in which a coding parameter prediction model provided in an embodiment of the present application determines target coding parameters of multiple videos to be encoded and encodes the videos to be encoded respectively according to the target coding parameters. For example, the multiple videos to be encoded include three videos to be encoded, namely, a first video to be encoded A, a second video to be encoded B, and a third video to be encoded C. After the total bit rate of the multiple videos to be encoded is determined, the corresponding coding parameter prediction model under the total bit rate condition is obtained. Then, the coding parameter prediction model determines the target coding parameter Ab of video A according to the video feature data of video A, determines the target coding parameter Bb of video B according to the video feature data of video B, and determines the target coding parameter Cb of video C according to the video feature data of video C. On this basis, the target coding parameter Ab is used to encode video A to obtain the target bit rate and target video evaluation index value of video A after encoding. The target coding parameter Bb is used to encode video B to obtain the target bit rate and target quality evaluation index value of video B after encoding. The target coding parameter Cb is used to encode video C to obtain the target bit rate and target quality evaluation index value of video C after encoding. Among them, the sum of the target bit rate of encoded video A, the target bit rate of encoded video B, and the target bit rate of encoded video C is less than the total bit rate corresponding to multiple videos to be encoded, and the sum of the target quality assessment index value of encoded video A, the target quality assessment index value of encoded video B, and the target quality assessment index value of encoded video C is greater than the standard value of the video quality assessment index required by the video demand end for multiple encoded videos.
[0193] In addition, other machine learning models may also be used, such as Gaussian regression model, extreme tree model, random forest or multi-layer perceptron model, without limitation here.
[0194] The sample encoding parameters of the sample video are obtained as follows:
[0195] A candidate rate-distortion point group obtained by a sample video from a plurality of sample videos under a plurality of candidate encoding parameter conditions is obtained; a predetermined rate-distortion point is selected from the candidate rate-distortion point group corresponding to the sample video, the predetermined rate-distortion point comprising at least the following attribute parameters: a predetermined encoding parameter, a predetermined bit rate, and a predetermined quality assessment index value; after the sample video is encoded using the predetermined encoding parameter, the bit rate of the encoded video is a predetermined bit rate, and the quality assessment index value of the encoded video is a predetermined quality assessment index value; if the above-mentioned attribute parameters of the predetermined rate-distortion points respectively corresponding to the sample videos from the plurality of sample videos meet the following conditions, the predetermined encoding parameters in the predetermined rate-distortion points of the sample video are used as the sample encoding parameters of the sample video: the sum of the predetermined bit rates respectively corresponding to the encoded videos from the plurality of sample videos is less than the total bit rate, and the sum of the predetermined quality assessment index values respectively corresponding to all the encoded videos is greater than the standard value of the video quality assessment index required by the video demand end for the plurality of encoded videos.
[0196] The process of determining the sample encoding parameters of the sample video may be determined in the manner described above.
[0197] Obtain a candidate rate-distortion point group obtained by a sample video from a plurality of sample videos under a plurality of candidate coding parameter conditions. Specifically, the sample video is encoded using the candidate coding parameters to obtain the bit rate and quality assessment index value of the encoded video after the encoding process under the candidate coding parameter conditions; obtain the bit rate and quality assessment index value corresponding to the sample video after the encoding process is performed using a plurality of candidate coding parameters respectively; use the candidate coding parameters and the bit rate and quality assessment index value corresponding to the candidate coding parameters as a candidate rate-distortion point of the encoded video; use the candidate rate-distortion points corresponding to the plurality of candidate coding parameters respectively as the candidate rate-distortion point group obtained by the sample video under the plurality of candidate coding parameter conditions.
[0198] The multiple sample videos include multiple sample videos, and multiple candidate encoding parameters are used to encode each sample video to obtain candidate bit rates and candidate quality assessment index values of the encoded video, wherein a candidate rate distortion point includes at least the following parameters: candidate encoding parameters, candidate bit rates, and candidate quality assessment index values. The multiple candidate encoding parameters are used to encode the sample videos to obtain candidate bit rates and candidate quality assessment index values corresponding to the multiple candidate encoding parameters, that is, multiple candidate rate distortion points. The multiple candidate rate distortion points corresponding to a sample video are used as a candidate rate distortion point group of the sample video.
[0199] After determining the candidate rate-distortion point groups corresponding to all sample videos in the plurality of sample videos, respectively, the predetermined rate-distortion points corresponding to each sample video are respectively determined. Then, the predetermined rate-distortion points are judged as follows. If the judgment result satisfies the following conditions, the predetermined rate-distortion points of the sample video are determined as the sample rate-distortion points of the sample video, and the predetermined coding parameters included in the predetermined rate-distortion points of the sample video are the sample coding parameters of the sample video:
[0200] The sum of the predetermined bit rates corresponding to the encoded videos in multiple sample videos is less than the total bit rate corresponding to the multiple sample videos, and the sum of the predetermined quality assessment index values corresponding to the encoded videos is greater than the video quality assessment index standard value required by the video demand end for the encoded video.
[0201] After determining the sample encoding parameters of multiple sample videos, the initial encoding parameter prediction model is trained using the sample encoding parameters as labels and the sample video features of the sample encoded videos, so as to obtain the corresponding encoding parameter prediction models under different total bit rate conditions.
[0202] The above is a method of determining the target encoding parameters of the video to be encoded through the encoding parameter prediction model.
[0203] The target encoding parameters obtained by the first target encoding parameter determination method and the second target encoding parameter determination method satisfy the condition that: the sum of the target bit rates of the encoded videos in the multiple encoded videos is less than the total bit rate, and the sum of the target quality evaluation index values is greater than the standard value of the video quality evaluation index required by the video demand end for the multiple encoded videos. The standard value of the video quality evaluation index required by the video demand end for the multiple encoded videos varies depending on the specific video type or the requirements of the video demand end.
[0204] Therefore, the embodiment of the present application can also determine the target encoding parameters of the video to be encoded by a third method:
[0205] Obtaining standard values of video quality assessment indicators required by a video demand end for multiple encoded videos; determining target encoding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded, and video features of the video to be encoded among the multiple videos to be encoded, can be achieved in the following way: determining target encoding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded, video features of the video to be encoded among the multiple videos to be encoded, and the standard values of the video quality assessment indicators.
[0206] The total bit rate of multiple videos to be encoded defines the sum of the bit rates that can be used in the encoding process of all videos to be encoded among the multiple videos to be encoded, and the sum of the bit rates in the encoding process of the videos to be encoded cannot exceed the total bit rate. On this basis, in order to ensure that the quality evaluation index values of all videos to be encoded after encoding meet the preset requirements, it is necessary to assign corresponding target encoding parameters to each video to be encoded. The target encoding parameters corresponding to each parameter to be encoded can be determined based on the video characteristics of the video to be encoded and the standard value of the video quality evaluation index required by the video demand end.
[0207] If the video quality evaluation index standard value required by the video demand end is greater than the first preset video quality evaluation index standard threshold, the first preset video quality evaluation index standard threshold is that the video picture quality belongs to standard definition quality. In this case, the bit rate requirement of the target encoding parameter determined for the video to be encoded among the multiple videos to be encoded is the bit rate that satisfies the acquisition of standard definition video picture quality.
[0208] If the video quality evaluation index standard value required by the video demand end is greater than the second preset video quality evaluation index standard threshold, the second preset video quality evaluation index standard threshold is that the video picture quality belongs to ultra-clear quality. The bit rate corresponding to the ultra-clear quality is greater than the bit rate corresponding to the standard-clear quality. The bit rate in the target encoding parameters of the video to be encoded directly determines the bit rate of the encoded video. In this case, the bit rate requirement of the target encoding parameters determined for the video to be encoded among the multiple videos to be encoded is sufficient to meet the bit rate for obtaining ultra-clear video picture quality.
[0209] Based on the different standard values of video quality assessment indicators required by the video demand end for multiple encoded videos, this application can specifically determine the target encoding parameters of the video to be encoded in the following way:
[0210] Specifically, the method of determining the target encoding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded, the video features of the videos to be encoded in the multiple videos to be encoded, and the standard value of the video quality assessment index includes: predicting the predicted bit rate required for the video to be encoded according to the video features of the video to be encoded; determining the predicted encoding parameters required for the video to be encoded according to the predicted bit rate required for the video to be encoded; obtaining the predicted bit rate and predicted quality assessment index value of the video to be encoded after the video to be encoded is encoded with the predicted encoding parameters; if the sum of the predicted bit rates corresponding to the encoded videos in the multiple encoded videos corresponding to the multiple videos to be encoded is less than the total bit rate, and the sum of the predicted quality assessment index values corresponding to the encoded videos is greater than the standard value of the video quality assessment index, then using the predicted encoding parameters as the target encoding parameters of the video to be encoded.
[0211] The video features of the videos to be encoded in the multiple videos to be encoded are different, and the bit rates required in the encoding process of the videos to be encoded are different. For the videos to be encoded whose video features have a higher complexity, the bit rate required is higher than that of the videos to be encoded with a lower complexity. For example, the video to be encoded is a video to be encoded in which the proportion of independent video frames is greater than a preset proportion threshold. For example, the first video to be encoded includes 100 video frames, including 70 independent frames, and the independent frames need to display the entire content of the frame, while the predicted frame determines the content displayed by the current predicted frame based on the difference between the previous independent frame or the predicted frame adjacent to it and the current predicted frame. The second video to be encoded includes 100 video frames, including 30 independent frames, and the rest are predicted frames. In this case, the complexity of the video features of the first video frame is higher than that of the video features of the second video to be encoded. Accordingly, the bit rate required for encoding the first video to be encoded is higher than the bit rate required for encoding the second video to be encoded.
[0212] After determining the prediction coding parameters corresponding to the video to be encoded according to the bit rate required by the video to be encoded, the prediction bit rate and prediction quality evaluation index value of the video to be encoded after being encoded using the prediction coding parameters are obtained.
[0213] The predicted bit rates of all the videos to be encoded are summed up to obtain the sum of the predicted bit rates, and the total bit rate is compared. The predicted quality evaluation index values of the videos to be encoded are summed up to obtain the sum of the predicted bit rates, and the sum is compared with the standard value of the video quality evaluation index.
[0214] If, among the multiple encoded videos corresponding to the multiple videos to be encoded, the sum of the predicted bit rates corresponding to the encoded videos respectively is less than the total bit rate, and the sum of the predicted quality assessment index values corresponding to the encoded videos respectively is greater than the standard value of the video quality assessment index, it means that the predicted coding parameters predicted for the video to be encoded among the multiple videos to be encoded can meet the requirements of the video demand end for the quality of the encoded video, and the predicted coding parameters are used as the target coding parameters of the video to be encoded.
[0215] The above-mentioned determination of the prediction coding parameters for each video to be encoded may include multiple candidate coding parameters. In this case, for the videos to be encoded among the multiple videos to be encoded, the multiple candidate coding parameters are used to encode the videos to be encoded respectively to obtain the corresponding multiple prediction bit rates and multiple prediction quality assessment index values; if the prediction bit rates and prediction quality assessment index values respectively corresponding to the multiple candidate coding parameters are both the following conditions, then the target coding parameter is selected from the multiple candidate coding parameters: the sum of the prediction bit rates respectively corresponding to the encoded videos is less than the total bit rate, and the prediction quality assessment index values respectively corresponding to the encoded videos are less than the video quality assessment index standard value.
[0216] For example, the multiple videos to be encoded include 2 videos to be encoded, and 2 candidate encoding parameters are determined for each video to be encoded. The 2 candidate encoding parameters are used to encode the videos to be encoded respectively to obtain 2 corresponding predicted bit rates and 2 predicted quality evaluation index values.
[0217] The predicted bit rates of the encoded videos corresponding to all the videos to be encoded of the plurality of videos to be encoded are added together to obtain a total predicted bit rate value obtained by adding the multiple predicted bit rates corresponding to each encoded video to the predicted bit rates corresponding to other encoded videos. Similarly, the predicted quality assessment index values of the encoded videos corresponding to all the videos to be encoded of the plurality of videos to be encoded are added together to obtain a total predicted quality assessment index value obtained by adding the multiple predicted quality assessment index values corresponding to each encoded video to the predicted quality assessment index values corresponding to other encoded videos.
[0218] Continuing with the above example, the total bit rate corresponding to the multiple videos to be encoded is 5 Mbps (megabits per second).
[0219] The plurality of videos to be encoded include two videos to be encoded, a first video to be encoded A and a second video to be encoded B. The first video to be encoded A includes two candidate encoding parameters Aa1 and Aa2. The predicted bit rate corresponding to Aa1 is Aa11, and the corresponding predicted quality evaluation index value is Aa12. The predicted bit rate corresponding to Aa2 is Aa21, and the corresponding predicted quality evaluation index value is Aa22.
[0220] The second video to be encoded B includes two candidate encoding parameters Bb1 and Bb2. The predicted bit rate corresponding to Bb1 is Bb11, and the corresponding predicted quality evaluation index value is Bb12. The predicted bit rate corresponding to Bb2 is Bb21, and the corresponding predicted quality evaluation index value is Bb22.
[0221] The sum of the predicted bit rates corresponding to all the videos to be encoded of the multiple videos to be encoded respectively includes the following types: the sum of Aa11 and Bb11, the sum of Aa11 and Bb21, the sum of Aa21 and Bb11, and the sum of Aa21 and Bb21.
[0222] The sum of the predicted quality assessment index values corresponding to all the videos to be encoded of the multiple videos to be encoded respectively includes the following types: the sum of Aa12 and Bb12, the sum of Aa12 and Bb22, the sum of Aa22 and Bb12, and the sum of Aa22 and Bb22.
[0223] Among them, the sum of any of the above-mentioned predicted bit rates is less than the total bit rate of 5Mbps, but the sum of any of the predicted quality assessment index values is less than the standard value of the video quality assessment index corresponding to the video demand end. For example, the standard value of the video quality assessment index corresponding to the video demand end may be greater than the second preset video quality assessment index standard threshold, and the second preset video quality assessment index standard threshold is that the video picture quality belongs to ultra-clear quality. The bit rate corresponding to the ultra-clear quality is greater than the bit rate corresponding to the standard-clear quality.
[0224] Therefore, in this case, the target encoding parameter can be selected from multiple candidate encoding parameters corresponding to each video to be encoded, as follows:
[0225] The selecting a target coding parameter from the plurality of candidate coding parameters comprises:
[0226] The video to be encoded is encoded respectively using the multiple candidate encoding parameters to obtain multiple prediction quality assessment index values after the encoding of the video to be encoded; the multiple prediction quality assessment index values after the encoding of the video to be encoded are compared to obtain a target prediction quality assessment index value, wherein the target prediction quality assessment index value is greater than other prediction quality assessment index values among the multiple prediction quality assessment index values except the target prediction quality assessment index value; and the candidate encoding parameters corresponding to the target prediction quality assessment index values are used as the target encoding parameters of the video to be encoded.
[0227] Continuing with the above example, Aa11 is greater than Aa21, and Aa12 is greater than Aa22. Bb11 is greater than Bb21, and Bb12 is greater than Bb22. Therefore, the target encoding parameter corresponding to the first video to be encoded is the candidate encoding parameter Aa1, and the target encoding parameter corresponding to the second video to be encoded is the candidate encoding parameter Bb1.
[0228] The above is the third method for determining the target encoding parameters.
[0229] According to the above three methods of determining the target encoding parameters, after the target encoding parameters are obtained for encoding the video to be encoded, the target bit rate and target quality assessment index value of the encoded video meet the following conditions: the sum of the target bit rates is less than the total bit rate, and the sum of the target quality assessment index values is greater than the standard value of the video quality assessment index required by the video demand end for the encoded video.
[0230] In addition, in a preferred embodiment, the target encoding parameters of the determined video to be encoded can meet the following conditions: the sum of the bit rates of the encoded videos is less than the total bit rate, and the sum of the quality assessment index values of the encoded videos is greater than the sum of subsequent quality assessment index values corresponding to the encoded videos under other candidate encoding parameter conditions.
[0231] When the encoding parameters of the video to be encoded are target encoding parameters, the bit rate of the encoded video is the target bit rate, and the quality assessment index value of the encoded video is the target quality assessment index value. When the encoding parameters of the video to be encoded are other candidate encoding parameters, the bit rate of the encoded video is the candidate bit rate, and the quality assessment index value of the encoded video is the candidate quality assessment index value.
[0232] Among them, the sum of the target bit rates corresponding to the encoded videos in the multiple encoded videos is less than the total bit rate, and the target quality assessment index values corresponding to the encoded videos are greater than the sum of the candidate quality assessment index values corresponding to the multiple encoded videos under other candidate encoding parameter conditions.
[0233] Combination Figure 4 The example shows that the sum of the target bit rate of encoded video A, the target bit rate of encoded video B, and the target bit rate of encoded video C is less than the total bit rate corresponding to multiple videos to be encoded, and the sum of the target quality assessment index value of encoded video A, the target quality assessment index value of encoded video B, and the target quality assessment index value of encoded video C is greater than the sum of the candidate quality assessment index values of the encoded videos under other candidate encoding parameter conditions (the total value obtained by adding the candidate quality assessment index values corresponding to the above three encoded videos respectively).
[0234] Corresponding to the first embodiment, the second embodiment of the present application provides a video encoding device. For the relevant parts, please refer to the description of the corresponding method embodiment. Figure 5 , which is a schematic diagram of a video encoding device provided by the second embodiment of the present application. The video encoding device shown in the figure includes: a video feature acquisition unit 501, which is used to perform feature extraction processing on multiple videos to be encoded to obtain video features of the videos to be encoded in the multiple videos to be encoded; a target encoding parameter determination unit 502, which is used to determine the target encoding parameters of the videos to be encoded based on the total bit rate corresponding to the multiple videos to be encoded and the video features of the videos to be encoded in the multiple videos to be encoded; an encoding processing unit 503, which is used to perform encoding processing on the videos to be encoded according to the target encoding parameters of the videos to be encoded; wherein, when the encoding parameters of the videos to be encoded in the multiple videos to be encoded are the corresponding target encoding parameters, the bit rate of the encoded video after encoding processing is the target bit rate, the quality assessment index value of the encoded video is the target quality assessment index value, the sum of the target bit rates corresponding to the encoded videos is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos is greater than the video quality assessment index standard value required by the video demand end for the multiple encoded videos.
[0235] Based on the above embodiments, the third embodiment of the present application provides an electronic device. For the relevant parts, please refer to the corresponding description of the above embodiments. Figure 6 , which is a schematic diagram of an electronic device provided in the third embodiment of the present application. The electronic device shown in the figure includes: a memory and a processor; the memory is used to store a computer program, and after the computer program is run by the processor, the method provided in the embodiment of the present application is executed.
[0236] Based on the above embodiments, the fourth embodiment of the present application provides a computer storage medium. For the relevant parts, please refer to the corresponding description of the above embodiments. The schematic diagram of the computer storage medium is similar to Figure 6 The memory in the figure can be understood as the storage medium. The computer storage medium stores a computer program, and the computer execution instructions are used to implement the method provided in the embodiment of the present application when executed by the processor.
[0237] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0238] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0239] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0240] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0241] It should be noted that the embodiments of this application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that the applicable laws and regulations of the country are met (for example, the user's explicit consent, the user's effective notification, etc.). It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation portals for users to choose to authorize or refuse.
Claims
1. A video encoding method, characterized in that: include: Performing feature extraction processing on a plurality of videos to be encoded to obtain video features of a video to be encoded among the plurality of videos to be encoded; Determining a target encoding parameter of the video to be encoded based on a total bit rate corresponding to the multiple videos to be encoded and a video feature of the video to be encoded among the multiple videos to be encoded; Performing encoding processing on the video to be encoded according to the target encoding parameters of the video to be encoded; Among them, when the encoding parameters of the video to be encoded among the multiple videos to be encoded are the corresponding target encoding parameters, the bit rate of the encoded video after the encoding process is the target bit rate, the quality assessment index value of the encoded video is the target quality assessment index value, the sum of the target bit rates corresponding to the encoded videos respectively is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos respectively is greater than the video quality assessment index standard value required by the video demand end for the multiple encoded videos.
2. The method according to claim 1, characterized in that The determining, based on the total bit rate corresponding to the multiple videos to be encoded and the video features of the videos to be encoded among the multiple videos to be encoded, the target encoding parameters of the videos to be encoded include: Determining, according to a video feature of a video to be encoded among the multiple videos to be encoded, a video content type to which the video to be encoded among the multiple videos to be encoded belongs; Classifying the videos to be encoded among the multiple videos to be encoded according to the video content type to which the videos to be encoded belong, to obtain at least one video group to be encoded, wherein the video content types of the videos to be encoded in the video group to be encoded belong to the same video content type; Determining target coding parameters of the video group to be encoded based on the total bit rates corresponding to the multiple videos to be encoded and in combination with the video content type of the video group to be encoded as target coding parameters of the videos to be encoded in the video group to be encoded; Correspondingly, encoding the video to be encoded according to the target encoding parameter of the video to be encoded includes: performing joint encoding processing on the videos to be encoded included in the video group to be encoded according to the target encoding parameter of the video group to be encoded.
3. The method according to claim 1, characterized in that The determining, based on the total bit rate corresponding to the multiple videos to be encoded and the video features of the videos to be encoded among the multiple videos to be encoded, the target encoding parameters of the videos to be encoded include: Determining, based on the total bit rates corresponding to the multiple videos to be encoded, encoding parameter prediction models corresponding to the multiple videos to be encoded; Inputting video features of a video to be encoded among the multiple videos to be encoded into the encoding parameter prediction model respectively, and obtaining target encoding parameters for the video to be encoded output by the encoding parameter prediction model; The coding parameter prediction model is used to determine the target coding parameters of the video to be encoded according to the video features of the video to be encoded, and the target coding parameters meet the following conditions: After encoding the video to be encoded using the target encoding parameters, a target bit rate and a target quality assessment index value of the encoded video are obtained; the sum of the target bit rates corresponding to the encoded videos in the multiple encoded videos corresponding to the multiple videos to be encoded is less than the total bit rate, and the sum of the target quality assessment index values corresponding to the encoded videos is greater than the video quality assessment index standard value required by the video demand end for the multiple encoded videos.
4. The method according to claim 3, characterized in that The coding parameter prediction model is trained and obtained in the following manner: Obtaining a total bit rate corresponding to a plurality of sample videos, and sample video features and sample encoding parameters of sample videos in the plurality of sample videos; Inputting the total bit rates corresponding to the multiple sample videos and the sample video features of the sample videos into an initial coding parameter prediction model to obtain initial coding parameters for the sample videos output by the initial coding parameter prediction model; Obtaining a loss value between the initial encoding parameter of the sample video and the sample encoding parameter; Adding the loss values corresponding to the sample videos in the multiple sample videos respectively to obtain a total loss value corresponding to the multiple sample videos; Based on the total loss value, the parameters of the initial coding parameter prediction model are adjusted to obtain a trained coding parameter prediction model.
5. The method according to claim 4, characterized in that The sample encoding parameters of the sample video are obtained in the following manner: Obtaining a candidate rate-distortion point group obtained by a sample video under multiple candidate encoding parameter conditions from among multiple sample videos; Selecting a predetermined rate-distortion point from the candidate rate-distortion point group corresponding to the sample video, the predetermined rate-distortion point at least comprising the following attribute parameters: a predetermined encoding parameter, a predetermined bit rate, and a predetermined quality assessment index value; after encoding the sample video using the predetermined encoding parameter, the bit rate of the encoded video is the predetermined bit rate, and the quality assessment index value of the encoded video is the predetermined quality assessment index value; If the attribute parameters of the predetermined rate-distortion points respectively corresponding to the sample videos in the multiple sample videos meet the following conditions, the predetermined coding parameters in the predetermined rate-distortion points of the sample videos are used as the sample coding parameters of the sample videos: The sum of the predetermined bit rates corresponding to the encoded videos in the multiple sample videos is less than the total bit rate, and the sum of the predetermined quality assessment index values corresponding to all the encoded videos is greater than the video quality assessment index standard value required by the video demand end for the multiple encoded videos.
6. The method according to claim 5, characterized in that The step of obtaining a candidate rate-distortion point group obtained by a sample video from among the multiple sample videos under multiple candidate encoding parameter conditions includes: The sample video is encoded using the candidate encoding parameters to obtain a bit rate and a quality assessment index value of the encoded video after the encoding process under the candidate encoding parameters; Obtaining the corresponding bit rates and quality assessment index values after encoding the sample video with a plurality of candidate encoding parameters respectively; Using the candidate coding parameter and the bit rate and quality assessment index value corresponding to the candidate coding parameter as a candidate rate-distortion point of the encoded video; The candidate rate-distortion points respectively corresponding to the multiple candidate coding parameters are used as a candidate rate-distortion point group obtained by the sample video under the conditions of the multiple candidate coding parameters.
7. The method according to claim 1, characterized in that Also includes: Obtaining the video quality evaluation index standard values required by the video demand side for multiple encoded videos; The determining, based on the total bit rate corresponding to the multiple videos to be encoded and the video features of the videos to be encoded among the multiple videos to be encoded, the target encoding parameters of the videos to be encoded include: Based on the total bit rates corresponding to the multiple videos to be encoded, the video features of the videos to be encoded among the multiple videos to be encoded, and the standard value of the video quality assessment index, a target encoding parameter of the video to be encoded is determined.
8. The method according to claim 7, characterized in that The determining of the target encoding parameters of the video to be encoded based on the total bit rate corresponding to the multiple videos to be encoded, the video features of the video to be encoded among the multiple videos to be encoded, and the standard value of the video quality assessment index includes: Predicting a predicted bit rate required for the video to be encoded according to the video features of the video to be encoded; Determining the prediction coding parameters required for the video to be encoded according to the prediction bit rate required for the video to be encoded; Obtaining a predicted bit rate and a predicted quality evaluation index value of the video to be encoded after the video to be encoded is encoded using the predicted encoding parameters; If, among the multiple encoded videos corresponding to the multiple videos to be encoded, the sum of the predicted bit rates corresponding to the encoded videos is less than the total bit rate, and the sum of the predicted quality assessment index values corresponding to the encoded videos is greater than the standard value of the video quality assessment index, then the predicted encoding parameters are used as the target encoding parameters of the video to be encoded.
9. The method according to claim 8, characterized in that The predicted coding parameters include a plurality of candidate coding parameters; The method further comprises: For a video to be encoded among the multiple videos to be encoded, the multiple candidate encoding parameters are used to respectively encode the video to be encoded to obtain a corresponding multiple predicted bit rates and a multiple predicted quality assessment index values; If the predicted bit rates and predicted quality assessment index values respectively corresponding to the multiple candidate coding parameters are all under the following conditions, then a target coding parameter is selected from the multiple candidate coding parameters: The sum of the predicted bit rates corresponding to the encoded videos is less than the total bit rate, and the predicted quality assessment index values corresponding to the encoded videos are less than the video quality assessment index standard value.
10. The method according to claim 9, characterized in that The selecting a target coding parameter from the plurality of candidate coding parameters comprises: Encode the video to be encoded respectively using the multiple candidate encoding parameters to obtain multiple predicted quality assessment index values after encoding the video to be encoded; Compare the multiple prediction quality assessment index values after encoding the video to be encoded to obtain a target prediction quality assessment index value, wherein the target prediction quality assessment index value is greater than other prediction quality assessment index values among the multiple prediction quality assessment index values except the target prediction quality assessment index value; The candidate encoding parameters corresponding to the target prediction quality assessment index value are used as target encoding parameters of the video to be encoded.
11. An electronic device, characterized in that: include: processor; as well as The memory is used to store a computer program. After the electronic device is powered on and the computer program is run by the processor, the method according to any one of claims 1 to 10 is executed.
12. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program is executed by a processor to perform the method according to any one of claims 1 to 10.
Citation Information
Cited By
Target tracking method in machine vision integrated system
CN119850684A
A target tracking method in machine vision integrated system
CN119850684B
Video coding method and apparatus
WO2026021082A1
