Content-adaptive video encoding method and device
By obtaining video feature information and using machine learning models to output encoding parameters, the problem of difficulty in adaptive encoding in the prior art is solved, and efficient and real-time video encoding effect is achieved.
Patent Information
- Application Number
- CN202210855085.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-19
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-07-19
AI Technical Summary
The existing video encoding technology is difficult to adaptively encode according to the characteristics of the video content, resulting in poor encoding effect when different video scenes and contents change.
By obtaining the feature information of the video to be encoded, including pre-analyzed information and video inherent feature information, the video encoding parameters are output using the pre-trained machine learning model, and then encoding.
It realizes efficient adaptive encoding based on video content, meets real-time requirements, and can better adapt to different video scenes and frequently changing video content.
Smart Images

Figure CN115379229B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video encoding technology, and in particular to a content-adaptive video encoding method and device. Background Art
[0002] With the continuous development of the Internet and video encoding technology, more and more users choose to watch short videos and live broadcasts online on various terminal devices. Most video transcoding systems use common bit rate control modes (such as constant bit rate encoding mode) to achieve a balance between bit rate and video quality, but this method does not fully consider the audience's subjective feelings about the video. There are great differences in users' subjective feelings about the video. Compared with the parts with violent movements in the video, the human eye is more sensitive to the distortion of the slow-moving parts. Therefore, the method of video encoding based on constant quality factor is gradually being used.
[0003] In the traditional coding technology framework, multiple versions of resolutions and corresponding coding parameters (such as bit rate, constant quality factor value, etc.) are generally generated for each source video according to the general coding configuration table. Users can choose the appropriate version to meet their personal viewing needs based on their personal preferences, network conditions and other actual conditions. However, this method often only considers factors such as network bandwidth and resolution, and cannot make corresponding adjustments based on the characteristics of the video itself. At the same time, due to the huge differences in content complexity of different categories of videos, the parameters set in advance may cause more loss of details for complex sports videos due to the low bit rate after encoding, while for simple videos like slides, the bit rate after encoding may be too high, resulting in waste. Summary of the invention
[0004] The embodiments of the present application provide a content-adaptive video encoding method and device, which realize efficient adaptive encoding based on video content without encoding the video, while meeting real-time requirements and being able to better adapt to different video scenes and situations where video content changes frequently.
[0005] In a first aspect, an embodiment of the present application provides a content-adaptive video encoding method, the method comprising:
[0006] Acquire feature information of a video to be encoded, wherein the feature information includes pre-analysis information of the video to be encoded and video inherent feature information;
[0007] Extracting video features recorded in the feature information, and inputting the video features and the set target score values into a pre-trained machine learning model to output video encoding parameters;
[0008] The to-be-encoded video is encoded based on the video encoding parameters.
[0009] In a second aspect, an embodiment of the present application further provides a content-adaptive video encoding device, including:
[0010] A feature information acquisition module, configured to acquire feature information of a video to be encoded, wherein the feature information includes pre-analysis information of the video to be encoded and video inherent feature information;
[0011] A coding parameter determination module is configured to extract the video features recorded in the feature information, input the video features and the set target score value into a pre-trained machine learning model to output video coding parameters;
[0012] The video encoding module is configured to encode the video to be encoded based on the video encoding parameters.
[0013] In a third aspect, an embodiment of the present application further provides a content-adaptive video encoding device, the device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the content adaptive video encoding method described in the embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the content adaptive video encoding method described in the embodiment of the present application.
[0018] In the fifth aspect, an embodiment of the present application also provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium, and at least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the content-adaptive video encoding method described in the embodiment of the present application.
[0019] In the embodiment of the present application, feature information of the video to be encoded is obtained, and the feature information includes pre-analysis information of the video to be encoded and inherent feature information of the video, the video features recorded in the feature information are extracted, the video features and the set target score values are input into a pre-trained machine learning model to output video encoding parameters, and then the video to be encoded is encoded based on the video encoding parameters. This solution realizes efficient adaptive encoding based on video content without encoding the video, while meeting real-time requirements, and can better adapt to different video scenes and situations where video content changes frequently. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a content-adaptive video encoding method provided in an embodiment of the present application;
[0021] Figure 2 A flowchart of a method for determining video encoding parameters based on feature information provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of a method for determining pre-analysis information provided in an embodiment of the present application;
[0023] Figure 4 A flowchart of a method for outputting video encoding parameters based on a machine learning model provided in an embodiment of the present application;
[0024] Figure 5 A flowchart of a method for training a machine learning model provided in an embodiment of the present application;
[0025] Figure 6 A structural block diagram of a content-adaptive video encoding device provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of the structure of a content-adaptive video encoding device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] Figure 1A flowchart of a content-adaptive video encoding method provided in an embodiment of the present application can be used to perform encoding control processing on a video. The method can be executed by a computing device such as a server, a smart terminal, a notebook, a tablet computer, etc., and specifically includes the following steps:
[0030] Step S101: Acquire feature information of a video to be encoded, where the feature information includes pre-analysis information of the video to be encoded and video inherent feature information.
[0031] The video to be encoded is a video that needs to be encoded for storage, transmission, etc. Exemplarily, it may be a live video generated by a terminal device.
[0032] In one embodiment, when transcoding a video to be encoded, feature information of the video to be encoded is first obtained. The feature information may be pre-analysis information of the video to be encoded and video inherent feature information. The feature information is used to characterize the features of the video to be encoded, and different videos to be encoded usually correspond to different feature information. The pre-analysis information and video inherent feature information are both information that can be obtained before encoding the video to be encoded. Optionally, the pre-analysis information may be features obtained when preprocessing the video to be encoded, and the video inherent feature information may be features of the video to be encoded itself, such as resolution.
[0033] Step S102: extract the video features recorded in the feature information, input the video features and the set target score value into a pre-trained machine learning model to output video encoding parameters.
[0034] In one embodiment, after acquiring the feature information, the video features recorded in the feature information are extracted, and the video features and the set target score value are input into a pre-trained machine learning model to output video encoding parameters. The target score value represents the video quality, and optionally, the higher the target score value, the higher the video quality, and the lower the target score value, the lower the video quality.
[0035] Optionally, before inputting the video features and the set target score values into the pre-trained machine learning model to output the video encoding parameters, it also includes: setting the target score value of the video to be encoded, wherein different target score values correspond to different video qualities. In one embodiment, the target score value can be exemplarily a VMAF (Video Multimethod Assessment Fusion) score value. When performing video encoding, the target score value can be input in advance, and the target score value can be changed according to the setting or modification of the user or staff.
[0036] In one embodiment, the pre-trained machine learning model is trained in the early stage, takes the video features and the set target score value as input, and outputs the corresponding video encoding parameters. The video encoding parameters represent the parameters of the video encoding process to control the video encoding. For example, the x264 and x265 encoders are taken as examples. The video encoding parameters can be CRF (Constant Rate Factor, constant quality factor) values. In the video encoding process, the bit rate control is performed based on the CRF value to achieve video encoding at different bit rates.
[0037] Step S103: Encode the video to be encoded based on the video encoding parameters.
[0038] In one embodiment, after the video encoding parameters are determined, the video to be encoded is encoded based on the video encoding parameters to finally complete the video encoding process.
[0039] It can be seen from the above scheme that by obtaining the feature information of the video to be encoded, the feature information includes the pre-analysis information of the video to be encoded and the inherent feature information of the video, extracting the video features recorded in the feature information, inputting the video features and the set target score value into the pre-trained machine learning model to output the video encoding parameters, and then encoding the video to be encoded based on the video encoding parameters. This scheme realizes efficient adaptive encoding based on video content without encoding the video, while meeting the real-time requirements, and can better adapt to different video scenes and situations where the video content changes frequently.
[0040] Figure 2 A flowchart of a method for determining video encoding parameters based on feature information provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, specifically including:
[0041] Step S201: Acquire feature information of a video to be encoded, where the feature information includes pre-analysis information of the video to be encoded and video inherent feature information.
[0042] Step S202: extract the first video feature recorded in the pre-analysis information and the second video feature recorded in the video inherent feature information, and input the first video feature, the second video feature and the set target score value into a pre-trained machine learning model to output video encoding parameters.
[0043] In one embodiment, taking the feature information as pre-analysis information of a video to be encoded and the video inherent feature information as an example, the first video feature recorded in the pre-analysis information and the second video feature recorded in the video inherent feature information are extracted, and the first video feature and the second video feature and the set target score value are input into a pre-trained machine learning model to output video encoding parameters.
[0044] The pre-analysis information may be information obtained when pre-processing the video to be encoded, such as information obtained by identifying any one or more image frames. The inherent feature information of the video may be, for example, transcoding resolution, source video resolution, and the like.
[0045] In one embodiment, the corresponding pre-analysis information may be recorded when the video to be encoded is pre-processed, and the transcoding resolution and source video resolution may be recorded when the video to be encoded is obtained. When determining the first video feature and the second video feature, the corresponding field content is extracted from the record of the pre-analysis information and the video inherent feature information to obtain the first video feature and the second video feature.
[0046] Step S203: Encode the video to be encoded based on the video encoding parameters.
[0047] From the above, it can be seen that when encoding a video to be encoded, the first video feature and the second video feature are obtained based on the pre-analysis information of the video to be encoded and the inherent feature information of the video, and the first video feature and the second video feature are used as input to finally output video encoding parameters. Without encoding the video, efficient adaptive encoding based on the video content is achieved, which can better adapt to different video scenes and situations where the video content changes frequently.
[0048] Figure 3 A flowchart of a method for determining pre-analysis information provided in an embodiment of the present application, such as Figure 3 As shown, specifically including:
[0049] Step S301: Acquire continuous frame images of a preset length in a video to be encoded, and perform pre-analysis and detection processing based on the continuous frame images to obtain the video encoding pre-analysis information.
[0050] In one embodiment, the pre-analysis information of the video to be encoded is further limited. Optionally, continuous frame images of a preset length in the video to be encoded are obtained, and pre-analysis and detection processing are performed based on the continuous frame images to obtain the video encoding pre-analysis information. The preset length can be 4, for example.
[0051] In one embodiment, the pre-analysis information may be video encoding pre-analysis information obtained by pre-analyzing and detecting continuous frame images. For example, relevant information is obtained by performing Lookahead detection on a GOP (Group Of Pictures). Among them, in the Lookahead stage, its main function is to determine the type of input frame and calculate MB-tree. Optionally, taking the x264 encoder as an example, when a frame image is passed into the x264_encoder_encoode function preset in the x264 encoder, the frame image will be added to h->lookahead->next, and the type of the frame image will be marked as automatic type. At this time, the Lookahead thread starts asynchronous calculation, and finally outputs a string of BBBPBPP frame sequences for a group of input continuous frame images, and finally obtains records of information such as frame type, cutree parameters (parameters for adjusting quantization offset according to the degree to which the current block is referenced), and encoding cost as features.
[0052] Step S302: Obtain the video encoding pre-analysis information and the video inherent feature information.
[0053] Step S303: extract the video features recorded in the feature information, input the video features and the set target score value into a pre-trained machine learning model to output video encoding parameters.
[0054] Step S304: Encode the video to be encoded based on the video encoding parameters.
[0055] In one embodiment, for the video to be encoded, the Lookahead information of each group of GOP is obtained as pre-analysis information, and after the final video encoding parameters are determined, the group of GOP images is encoded based on the video encoding parameters, and so on until all images of the video to be encoded are encoded.
[0056] From the above, it can be seen that in the process of video encoding, by obtaining continuous frame images of a preset length in the video to be encoded, pre-analysis and detection processing are performed based on the continuous frame images to obtain video encoding pre-analysis information. This can allow the information of the video to be encoded to be quickly predicted without performing video encoding, and then used to determine subsequent video encoding parameters, thereby ensuring the real-time nature of video encoding, and can be suitable for scenarios with high real-time requirements such as live broadcasts.
[0057] Figure 4 A flowchart of a method for outputting video encoding parameters based on a machine learning model provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, specifically including:
[0058] Step S401, acquiring feature information of a video to be encoded, wherein the feature information includes pre-analysis information of the video to be encoded and inherent feature information of the video;
[0059] Step S402: extract the video features recorded in the feature information, input the video features and the set target score values into the first machine learning model and the second machine learning model respectively, and obtain the first video encoding parameters and the second video encoding parameters.
[0060] The first machine learning model and the second machine learning model are different machine learning models. Optionally, the first machine learning model may be a LightGBM model, and the second machine learning model may be an XGBoost model. Accordingly, the first video encoding parameter output by the first machine learning model may be recorded as CRF LGB , the second video encoding parameter output by the second machine learning model can be recorded as CRF XGB .
[0061] Step S403: Perform weighted averaging on the first video encoding parameter and the second video encoding parameter to obtain a video encoding parameter, and encode the video to be encoded based on the video encoding parameter.
[0062] In one embodiment, after obtaining the first video encoding parameter CRF LGB and the second video coding parameter CRF XGB After that, the first video coding parameter and the second video coding parameter are weighted averaged to obtain the video coding parameter. Exemplarily, the specific calculation method may be:
[0063] λ1*CRF LGB +λ2*CRF XGB
[0064] Among them, λ1+λ2=1, λ i ∈[0,1](i=1,2).
[0065] After further determining the video encoding parameters obtained by weighted averaging, the video to be encoded is encoded based on the video encoding parameters.
[0066] From the above, it can be seen that by setting two machine learning models to output video encoding parameters respectively, the final video encoding parameters used are obtained by weighted average, so that the final determined video encoding parameters are more accurate and reasonable, and the video encoding process is further optimized.
[0067] Figure 5 A flowchart of a method for training a machine learning model is provided in an embodiment of the present application, such as Figure 5 As shown, specifically including:
[0068] Step S501: Acquire sample video data, determine the sample resolution, sample coding parameters and sample characteristics of the sample video data, and combine the sample resolution and the sample coding parameters to obtain a plurality of sample coding information.
[0069] In one embodiment, when training a machine learning model, sample video data is first collected. In order to make the machine learning model better adapt to the live broadcast production environment, when selecting videos as training data, the videos cover as many scenes as possible that may appear in the live broadcast (such as indoor singing and dancing, outdoor, games, stillness, etc.). In this way, a machine learning model with good generalization is trained to make more accurate judgments on the video during prediction. On the contrary, when the various features of the predicted video are very different from the training video, the machine learning model will often fail and output a prediction result with a large error.
[0070] After obtaining the sample video data, the sample resolution, sample encoding parameters and sample features of the sample video data are determined, wherein the sample features include feature information of the sample data, such as pre-analysis information and video inherent feature information.
[0071] When determining the sample resolution and sample coding parameters, it can be: taking the resolution of the sample video data as the maximum resolution, determining multiple different resolutions including the maximum resolution as the sample resolution; selecting multiple sample coding parameter values within the preset sample coding parameter value range as the sample coding parameters. For example, if the resolution of a current sample video data is 720*1280, four resolutions of 720*1280, 540*960, 480*854, and 360*640 can be set as the sample resolution. Among them, the sample coding parameter value can be a CRF value, and its value range is set to [20, 35]. When taking a value, a value can be taken every 0.5, that is, 31 different CRF values are obtained as sample coding parameters.
[0072] After the sample resolution and sample coding parameters are obtained, they are combined, such as combining four sample resolutions with 31 sample coding parameter values in pairs to obtain 124 data as sample coding information.
[0073] Step S502: Calculate the coding score value obtained when encoding the sample video data through each sample coding information, and train the machine learning model based on the sample features and the coding score value.
[0074] In one embodiment, after the sample coding information is generated, the coding score value obtained when the sample video data is encoded by each sample coding information is calculated, and the machine learning model is trained based on the aforementioned determined sample features and the coding score value.
[0075] Specifically, sample features and coding score values are used as training features of the machine learning model, and the values of the sample coding parameter value range are used as training labels for training. Through training, a machine learning model is obtained which takes the feature information of the video to be encoded and the target score value as input and takes the video encoding parameters as output.
[0076] Step S503: Acquire feature information of the video to be encoded, where the feature information includes pre-analysis information of the video to be encoded and video inherent feature information.
[0077] Step S504: extract the video features recorded in the feature information, input the video features and the set target score value into a pre-trained machine learning model to output video encoding parameters.
[0078] Step S505: Encode the video to be encoded based on the video encoding parameters.
[0079] From the above, it can be seen that by setting multiple groups of samples with different resolutions and encoding parameters, model training is performed, wherein the sample selection involves different scene pictures, so that the trained machine learning model has good generalization and can make more accurate judgments on the video during prediction.
[0080] Figure 6 This is a structural block diagram of a content adaptive video encoding device provided in an embodiment of the present application. The device is used to execute the content adaptive video encoding method provided in the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. Figure 6 As shown, the device specifically includes: a feature information acquisition module 101, a coding parameter determination module 102 and a video coding module 103, wherein:
[0081] The feature information acquisition module 101 is configured to acquire feature information of the video to be encoded, wherein the feature information includes pre-analysis information of the video to be encoded and video inherent feature information;
[0082] The coding parameter determination module 102 is configured to extract the video features recorded in the feature information, input the video features and the set target score value into a pre-trained machine learning model to output video coding parameters;
[0083] The video encoding module 103 is configured to encode the video to be encoded based on the video encoding parameters.
[0084] It can be seen from the above scheme that by obtaining the feature information of the video to be encoded, the feature information includes the pre-analysis information of the video to be encoded and the inherent feature information of the video; extracting the video features recorded in the feature information, inputting the video features and the set target score value into the pre-trained machine learning model to output the video encoding parameters; encoding the video to be encoded based on the video encoding parameters. This scheme realizes efficient adaptive encoding based on video content without encoding the video, while meeting the real-time requirements, and can better adapt to different video scenes and situations where the video content changes frequently.
[0085] In a possible embodiment, the encoding parameter determination module 102 is configured as follows:
[0086] Extracting the first video feature recorded in the pre-analysis information and the second video feature recorded in the video inherent feature information;
[0087] The first video feature, the second video feature, and the set target score value are input into a pre-trained machine learning model to output video encoding parameters.
[0088] In a possible embodiment, the pre-analysis information includes video encoding pre-analysis information, and the device further includes a feature information generation module configured to:
[0089] Before obtaining the characteristic information of the video to be encoded, obtaining continuous frame images of a preset length in the video to be encoded;
[0090] The video coding pre-analysis information is obtained by performing pre-analysis and detection processing based on the continuous frame images.
[0091] In a possible embodiment, the device further includes a score setting module configured to:
[0092] Before inputting the video features and the set target score values into a pre-trained machine learning model to output video encoding parameters, the target score value of the video to be encoded is set, wherein different target score values correspond to different video qualities.
[0093] In a possible embodiment, the encoding parameter determination module 102 is configured as follows:
[0094] Inputting the video features and the set target score value into a first machine learning model and a second machine learning model respectively to obtain a first video encoding parameter and a second video encoding parameter, wherein the first machine learning model and the second machine learning model are different machine learning models;
[0095] A video coding parameter is obtained by performing weighted averaging on the first video coding parameter and the second video coding parameter.
[0096] In a possible embodiment, the device further includes a model training module configured to:
[0097] Before obtaining the characteristic information of the video to be encoded, obtaining sample video data, and determining the sample resolution, sample encoding parameters and sample characteristics of the sample video data;
[0098] Combining the sample resolution and the sample encoding parameter to obtain a plurality of sample encoding information;
[0099] Calculating a coding score value obtained when encoding the sample video data using each sample coding information;
[0100] The machine learning model is trained based on the sample features and the encoding score values.
[0101] In a possible embodiment, the model training module is configured as follows:
[0102] Taking the resolution of the sample video data as the maximum resolution, determining a plurality of different resolutions including the maximum resolution as sample resolutions;
[0103] A plurality of sample coding parameter values are selected within a preset sample coding parameter value range as sample coding parameters.
[0104] In a possible embodiment, the model training module is configured as follows:
[0105] The sample features and the coding score values are used as training features of the machine learning model, and the values within the sample coding parameter value range are used as training labels for training.
[0106] Figure 7 A structural diagram of a content adaptive video encoding device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 7 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Figure 7The example of connection via a bus is taken. The memory 202, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the content adaptive video encoding method in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned content adaptive video encoding method. The input device 203 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0107] The embodiment of the present application further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a content adaptive video encoding method described in the above embodiment when executed by a computer processor, including:
[0108] Acquire feature information of a video to be encoded, wherein the feature information includes pre-analysis information of the video to be encoded and video inherent feature information;
[0109] Extracting video features recorded in the feature information, and inputting the video features and the set target score values into a pre-trained machine learning model to output video encoding parameters;
[0110] The to-be-encoded video is encoded based on the video encoding parameters.
[0111] It is worth noting that in the embodiment of the above-mentioned content adaptive video encoding device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0112] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to perform the steps of the method according to various exemplary implementations of the present application described above in this specification. For example, the computer device may perform the content adaptive video encoding method described in the embodiment of the present application. The program product may be implemented in any combination of one or more readable media.
Claims
1. A content-adaptive video encoding method, characterized in that: include: Acquire feature information of a video to be encoded, the feature information including pre-analysis information of the video to be encoded and inherent feature information of the video, the pre-analysis information including video encoding pre-analysis information, the video encoding pre-analysis information is obtained based on pre-analysis and detection processing of continuous frame images of a preset length in the acquired video to be encoded, the pre-analysis and detection processing process comprising: inputting the continuous frame images into a Lookahead list of an encoder, asynchronously calculating the frame images passed in the list based on a Lookahead thread, the video encoding pre-analysis information including any one or more of a frame type, a cutree parameter, and an encoding cost; Extracting video features recorded in the feature information, and inputting the video features and the set target score values into a pre-trained machine learning model to output video encoding parameters; The to-be-encoded video is encoded based on the video encoding parameters.
2. The content adaptive video encoding method according to claim 1, characterized in that: The extracting the video features recorded in the feature information, inputting the video features and the set target score value into a pre-trained machine learning model to output video encoding parameters, includes: Extracting the first video feature recorded in the pre-analysis information and the second video feature recorded in the video inherent feature information; The first video feature, the second video feature, and the set target score value are input into a pre-trained machine learning model to output video encoding parameters.
3. The content-adaptive video encoding method according to any one of claims 1 to 2, characterized in that: Before inputting the video features and the set target score values into a pre-trained machine learning model to output video encoding parameters, the content adaptive video encoding method further includes: A target score value of the video to be encoded is set, wherein different target score values correspond to different video qualities.
4. The content-adaptive video encoding method according to any one of claims 1 to 2, characterized in that: The step of inputting the video features and the set target score value into a pre-trained machine learning model to output video encoding parameters includes: Inputting the video features and the set target score value into a first machine learning model and a second machine learning model respectively to obtain a first video encoding parameter and a second video encoding parameter, wherein the first machine learning model and the second machine learning model are different machine learning models; A video coding parameter is obtained by performing weighted averaging on the first video coding parameter and the second video coding parameter.
5. The content-adaptive video encoding method according to any one of claims 1 to 2, characterized in that: Before acquiring the feature information of the video to be encoded, the content adaptive video encoding method further includes: Acquire sample video data, and determine sample resolution, sample encoding parameters, and sample characteristics of the sample video data; Combining the sample resolution and the sample encoding parameter to obtain a plurality of sample encoding information; Calculating a coding score value obtained when encoding the sample video data using each sample coding information; The machine learning model is trained based on the sample features and the encoding score values.
6. The content adaptive video encoding method according to claim 5, characterized in that: The determining of the sample resolution and sample encoding parameters of the sample video data includes: Taking the resolution of the sample video data as the maximum resolution, determining a plurality of different resolutions including the maximum resolution as sample resolutions; A plurality of sample coding parameter values are selected within a preset sample coding parameter value range as sample coding parameters.
7. The content adaptive video encoding method according to claim 5, characterized in that: The training of the machine learning model based on the sample features and the coding score value includes: The sample features and the coding score values are used as training features of the machine learning model, and the values within the sample coding parameter value range are used as training labels for training.
8. A content-adaptive video encoding device, characterized in that: include: A feature information acquisition module is configured to acquire feature information of a video to be encoded, wherein the feature information includes pre-analysis information of the video to be encoded and inherent feature information of the video, wherein the pre-analysis information includes video encoding pre-analysis information, wherein the video encoding pre-analysis information is obtained based on pre-analysis and detection processing of continuous frame images of a preset length in the acquired video to be encoded, wherein the pre-analysis and detection processing process includes: inputting the continuous frame images into a Lookahead list of an encoder, and asynchronously calculating the frame images passed in the list based on a Lookahead thread, wherein the video encoding pre-analysis information includes any one or more of a frame type, a cutree parameter, and an encoding cost; A coding parameter determination module is configured to extract the video features recorded in the feature information, input the video features and the set target score value into a pre-trained machine learning model to output video coding parameters; The video encoding module is configured to encode the video to be encoded based on the video encoding parameters.
9. A content adaptive video encoding device, the device comprising: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the content adaptive video encoding method described in any one of claims 1-7.
10. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to perform the content adaptive video encoding method according to any one of claims 1 to 7 when executed by a computer processor.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the content adaptive video encoding method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Model training method and device, video coding method and device, equipment and storage medium
CN113014922A
Coding parameter determination method, video transmission method and device
CN113301340A
Content adaptive video coding method and device, equipment and storage medium
CN114554211A