Video encoding method and device, electronic device and computer readable storage medium

By obtaining the encoding characteristics and target video quality evaluation indicators of the video to be encoded, and using neural network or clustering processing to determine encoding parameters, the problem of inconsistent video encoding quality in the existing technology is solved, and the unified video quality and user experience improvement are achieved.

CN117750019BActive Publication Date: 2024-09-24XINGIN INFORMATION TECH (WUHAN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202211480282.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2024-09-24
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

Existing video encoding methods are difficult to ensure that the video quality of the encoded video meets expectations, resulting in inconsistent encoding quality of different videos to be encoded.

Method used

By obtaining the encoding characteristics of the video to be encoded and the target video quality evaluation index, using neural network or clustering processing to determine the encoding parameters, the video to be encoded is encoded to ensure that the video quality of the encoded video meets the target quality evaluation index.

Benefits of technology

Video quality consistency of encoded videos is achieved, user experience is improved, and data processing is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117750019B
    Figure CN117750019B
Patent Text Reader

Abstract

The present application discloses a video encoding method and device, an electronic device and a computer-readable storage medium. The method comprises: obtaining encoding features and a target video quality evaluation index of a video to be encoded; determining encoding parameters of the video to be encoded according to the encoding features, encoding the video to be encoded according to the encoding parameters to obtain an encoded video whose video quality meets the target video quality evaluation index; encoding the video to be encoded using the encoding parameters of the video to be encoded to obtain the encoded video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video encoding technology, and in particular to a video encoding method and device, an electronic device, and a computer-readable storage medium. Background Art

[0002] In order to compress the data volume of a video, it is usually necessary to encode the video, but the video quality of the encoded video obtained by encoding the video using the current method is difficult to meet expectations. Summary of the invention

[0003] The present application provides a video encoding method and device, an electronic device and a computer-readable storage medium, so that the video quality of the encoded video meets expectations.

[0004] In a first aspect, a video encoding method is provided, the method comprising:

[0005] Obtaining encoding features of the video to be encoded and target video quality evaluation indicators;

[0006] Determine encoding parameters of the video to be encoded according to the encoding features, and encode the video to be encoded according to the encoding parameters to obtain an encoded video whose video quality meets the target video quality evaluation index;

[0007] The video to be encoded is encoded using the encoding parameters of the video to be encoded to obtain the encoded video.

[0008] In this aspect, since the coding features of the video to be encoded are features used for video encoding, the video encoding device can determine the coding parameters of the video to be encoded according to the coding features of the video to be encoded, and the video quality of the encoded video obtained by encoding the video to be encoded according to the coding parameters meets the target video quality evaluation index. In addition, by processing the coding features of the video to be encoded to obtain the coding parameters, the amount of data processing can be reduced compared to processing the video to be encoded to obtain the coding parameters. After determining the coding parameters of the video to be encoded, the video encoding device uses the coding parameters of the video to be encoded to encode the video to be encoded, and can obtain a coded video whose video quality meets the target video quality evaluation index.

[0009] In combination with any implementation manner of the present application, determining the encoding parameters of the video to be encoded according to the encoding feature includes:

[0010] The coding features are analyzed using a neural network to obtain coding parameters of the video to be encoded.

[0011] In this implementation, the video encoding device processes the encoding features using a neural network to obtain encoding parameters of the video to be encoded.

[0012] In combination with any implementation manner of the present application, determining the encoding parameters of the video to be encoded according to the encoding feature includes:

[0013] Determine a reference coding feature that belongs to the same class as the coding feature by clustering the coding feature with a reference coding feature set;

[0014] The encoding parameters of the reference encoding features are used as encoding parameters of the video to be encoded.

[0015] In this embodiment, the coding features in the reference coding feature set all have coding parameters of the video corresponding to the coding features. By clustering the coding features with the reference coding feature set, reference coding features belonging to the same category as the coding features can be determined from the reference coding feature set, that is, the reference coding features have a high degree of matching with the coding features of the video to be encoded, that is, the coding parameters of the reference coding features can be used to encode the video to be encoded, so the video encoding device uses the coding parameters of the reference coding features as the coding parameters of the video to be encoded.

[0016] In combination with any implementation manner of the present application, the step of obtaining the encoding features of the video to be encoded includes:

[0017] The video to be encoded is encoded using a video encoder to obtain the encoding feature.

[0018] In this implementation manner, the video encoding device uses a video encoder to encode the video to be encoded, and can obtain encoding features of the video to be encoded.

[0019] In combination with any implementation manner of the present application, after obtaining the encoded video, the method further includes: publishing the encoded video to a video on demand platform.

[0020] In this embodiment, the video encoding device encodes the video to be released to the video on demand platform, so that the video quality of the encoded video can meet the target video quality evaluation index. In this way, publishing the encoded video to the video on demand platform can unify the video quality on the video on demand platform, thereby improving the user experience of watching videos through the video on demand platform.

[0021] In combination with any implementation manner of the present application, the coding feature includes at least one of the following: motion vector, number of intra-frame blocks, number of inter-frame blocks, intra-frame coding complexity, and inter-frame coding complexity.

[0022] In this embodiment, when the coding features include motion vectors, the video coding device can use motion vectors to determine the coding parameters of the video to be encoded; when the coding features include the number of intra-frame blocks, the video coding device can use the number of intra-frame blocks to determine the coding parameters of the video to be encoded; when the coding features include the number of inter-frame blocks, the video coding device can use the number of inter-frame blocks to determine the coding parameters of the video to be encoded; when the coding features include intra-frame coding complexity, the video coding device can use intra-frame coding complexity to determine the coding parameters of the video to be encoded; when the coding features include inter-frame coding complexity, the video coding device can use inter-frame coding complexity to determine the coding parameters of the video to be encoded.

[0023] In combination with any implementation manner of the present application, the target video quality evaluation index includes one of the following: video multi-method assessment fusion (VMAF) and peak signal to noise ratio (PSNR).

[0024] In this implementation, when the target video quality evaluation index includes VMAF, the video encoding device may determine whether the encoding parameters of the video to be encoded are appropriate based on VMAF, and further determine whether the video quality of the encoded video meets expectations based on VMAF. When the target video quality evaluation index includes PSNR, the video encoding device may determine whether the encoding parameters of the video to be encoded are appropriate based on PSNR, and further determine whether the video quality of the encoded video meets expectations based on PSNR.

[0025] In a second aspect, a video encoding device is provided, the device comprising:

[0026] An acquisition unit, used to acquire the encoding features of the video to be encoded and the target video quality evaluation index;

[0027] A feature analysis unit, configured to determine, according to the encoding feature, an encoding parameter of the video to be encoded, and to ensure that the video quality of the encoded video obtained by encoding the video to be encoded according to the encoding parameter meets the target video quality evaluation index;

[0028] The encoding unit is used to encode the video to be encoded by using the encoding parameters of the video to be encoded to obtain the encoded video.

[0029] In conjunction with any implementation manner of the present application, the feature analysis unit is specifically used for:

[0030] The coding features are analyzed using a neural network to obtain coding parameters of the video to be encoded.

[0031] In conjunction with any implementation manner of the present application, the feature analysis unit is specifically used for:

[0032] Determine a reference coding feature that belongs to the same class as the coding feature by clustering the coding feature with a reference coding feature set;

[0033] The encoding parameters of the reference encoding features are used as encoding parameters of the video to be encoded.

[0034] In combination with any implementation manner of the present application, the acquisition unit is specifically used to:

[0035] The video to be encoded is encoded using a video encoder to obtain the encoding feature.

[0036] In combination with any embodiment of the present application, the video encoding device further includes: a publishing unit, configured to publish the encoded video to a video on demand platform.

[0037] In combination with any implementation manner of the present application, the coding feature includes at least one of the following: motion vector, number of intra-frame blocks, number of inter-frame blocks, intra-frame coding complexity, and inter-frame coding complexity.

[0038] In combination with any implementation manner of the present application, the target video quality evaluation index includes one of the following: VMAF, PSNR.

[0039] According to a third aspect, an electronic device is provided, comprising: a processor and a memory, wherein the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes the method according to the first aspect and any possible implementation thereof.

[0040] In a fourth aspect, another electronic device is provided, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation method thereof.

[0041] In a fifth aspect, a computer-readable storage medium is provided, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the method as described in the first aspect above and any possible implementation method thereof.

[0042] In a sixth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is enabled to execute the method of the above-mentioned first aspect and any possible implementation thereof.

[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0045] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0046] Figure 1 A schematic diagram of a video encoding method provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of the architecture of a video on demand system provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of the structure of a video encoding device provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0052] It should be understood that in the present application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that there may be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " can indicate that the objects before and after the association are in an "or" relationship, which means any combination of these items, including any combination of single items (items) or plural items (items). For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple. The character " / " can also represent the division sign in mathematical operations, for example, a / b = a divided by b; 6 / 3 = 2. "At least one of the following" or similar expressions.

[0053] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0054] In order to compress the data volume of a video, it is usually necessary to encode the video, and the current method usually uses the same preset encoding parameters to encode different videos to be encoded. When the data volume of the videos to be encoded is different, the video quality of the encoded videos obtained by encoding the different videos to be encoded will be inconsistent. In other words, it is difficult to obtain an encoded video with expected video quality by encoding the videos to be encoded using the current method. Based on this, an embodiment of the present application provides a video encoding method to obtain an encoded video with expected video quality.

[0055] The execution subject of the embodiment of the present application is a video encoding device, wherein the video encoding device can be any electronic device that can execute the technical solution disclosed in the embodiment of the method of the present application. Optionally, the video encoding device can be one of the following: a mobile phone, a computer, a tablet computer, and a wearable smart device.

[0056] It should be understood that the method embodiment of the present application can also be implemented by a processor executing a computer program code. The following describes the embodiment of the present application in conjunction with the drawings in the embodiment of the present application. Figure 1 , Figure 1 It is a flowchart of a video encoding method provided in an embodiment of the present application.

[0057] 101. Obtain coding features of the video to be encoded and target video quality evaluation indicators.

[0058] In the embodiment of the present application, the video to be encoded may be any video. The encoding feature is a feature used for video encoding, and optionally, the encoding feature includes at least one of the following: motion vector, number of intra-frame blocks, number of inter-frame blocks, intra-frame encoding complexity, and inter-frame encoding complexity.

[0059] The motion vector is used to measure the intensity of the motion of the scene in the video. Specifically, the larger the motion vector, the more intense the motion of the scene. The number of intra-frame blocks is the number of intra-frame blocks in the image of the video to be encoded. Optionally, the number of intra-frame blocks is the average number of intra-frame blocks in each frame of the video to be encoded, wherein the intra-frame block is a block encoded by intra-frame encoding. The number of intra-frame blocks can represent the correlation between different frames in the video to be encoded. Specifically, the number of intra-frame blocks is negatively correlated with the correlation. The number of inter-frame blocks is the number of inter-frame blocks in the image of the video to be encoded. Optionally, the number of inter-frame blocks is the average number of inter-frame blocks in each frame of the video to be encoded, wherein the inter-frame block is a block encoded by inter-frame encoding. The number of inter-frame blocks can represent the correlation between different frames in the video to be encoded. Specifically, the number of inter-frame blocks is positively correlated with the correlation. The intra-frame coding complexity represents the complexity of intra-frame coding, and the inter-frame coding complexity represents the complexity of inter-frame coding.

[0060] In an implementation of obtaining coding features of a video to be coded, a video coding apparatus receives coding features of the video to be coded input by a user through an input component. The input component includes at least one of the following: a keyboard, a mouse, a touch screen, a touch pad, and an audio input device.

[0061] In another implementation of obtaining the coding features of the video to be coded, the video coding apparatus receives the coding features of the video to be coded sent by a terminal. The terminal may be any of the following: a mobile phone, a computer, a tablet computer, or a server.

[0062] In another implementation of obtaining the coding feature of the video to be encoded, the video encoding device obtains the video to be encoded and encodes the video to be encoded using a video encoder to obtain the coding feature of the video to be encoded.

[0063] Optionally, the video encoder is divided into a low-complexity video encoder and a high-complexity video encoder, wherein the low-complexity video encoder has poor encoding effect compared to the high-complexity video encoder, but the encoding speed is fast and the required computing resources are small, wherein the encoding effect includes the accuracy of the encoding features obtained by encoding. For example, the x264 video encoder is a low-complexity video encoder compared to the x265. For another example, the x265 video encoder is a low-complexity video encoder compared to the Fraunhofer Multifunctional Video Encoder (vvenc). For another example, the x265 video encoder is a low-complexity video encoder compared to the open source video encoder (libaom).

[0064] In practical applications, a low-complexity video encoder or a high-complexity video encoder can be selected according to actual needs to encode the video to be encoded to obtain encoding features. Specifically, selecting a low-complexity video encoder can consume less computing resources and increase the encoding speed, while selecting a high-complexity video encoder can improve the accuracy of the encoding features.

[0065] Optionally, for the same video encoder, different execution parameter combinations can be set, and the encoding complexity of different execution parameter combinations is also different. For example, using execution parameter combination A as the parameter of the x264 video encoder is faster and consumes less computing resources than using execution parameter combination B as the parameter of the x264 video encoder. Therefore, execution parameter combination A has lower encoding complexity than execution parameter combination B. In practical applications, after determining the video encoder, the execution parameter combination can also be determined for the video encoder according to actual needs. Specifically, selecting a low-complexity execution parameter combination can consume fewer computing resources and increase the encoding speed, while selecting a high-complexity execution parameter combination can improve the accuracy of the encoding features.

[0066] In an embodiment of the present application, the target video quality evaluation index is used to evaluate the video quality. Optionally, the target video quality evaluation index includes one of the following: VMAF, PSNR. For example, when the target video quality evaluation index is VMAF, the video quality of the encoded video satisfies VMAF. When the target video quality evaluation index is PSNR, the video quality of the encoded video satisfies PSNR.

[0067] In an implementation method of obtaining a target video quality evaluation index, the target video quality evaluation index is stored in a storage medium of a video encoding device, and the video encoding device obtains the target video quality evaluation index by reading the target video quality evaluation index from the storage medium.

[0068] In another implementation of obtaining a target video quality evaluation index, a video encoding device receives a target video quality evaluation index input by a user through an input component.

[0069] In yet another implementation of obtaining a target video quality evaluation index, a video encoding device receives a target video quality evaluation index sent by a terminal.

[0070] 102. Determine encoding parameters of the video to be encoded according to the encoding features.

[0071] In the embodiment of the present application, the encoding parameters of the video to be encoded are used to encode the video to be encoded. Since the encoding feature is a feature used for video encoding, that is, the encoding feature carries information that affects the encoding effect, wherein the encoding effect includes the bit rate of the encoded video and the video quality of the encoded video. Therefore, the video encoding device can use the information carried by the encoding feature to determine appropriate encoding parameters for the video to be encoded.

[0072] In an embodiment of the present application, the video quality of the encoded video obtained by encoding the video to be encoded according to the encoding parameters meets the target video quality evaluation index. In one possible implementation method, the video encoding device uses a neural network to process the encoding features of the video to be encoded to obtain the encoding parameters of the video to be encoded. The training process of the neural network includes: using the neural network to process the training video and predict the encoding parameters of the training video. Based on the difference between the predicted encoding parameters of the training video and the label of the training video, the loss of the neural network is obtained, wherein the label of the training video includes the real encoding parameters of the training video, and the video quality of the video obtained by encoding the training video according to the real encoding parameters also meets the target video quality evaluation index. The parameters of the neural network are updated according to the loss until the loss converges, and the training of the neural network is completed.

[0073] In another possible implementation, the video encoding device determines a reference encoding feature that belongs to the same category as the encoding feature by clustering the encoding feature with the reference encoding feature set. The encoding parameters of the reference encoding feature are used as the encoding parameters of the video to be encoded. The reference video corresponding to the reference encoding feature is encoded according to the encoding parameters of the reference encoding feature, so that the video quality of the encoded reference video meets the target video quality evaluation index. For example, the reference encoding feature set includes reference encoding feature a and reference encoding feature b, wherein reference encoding feature a is the encoding feature of reference video A, and reference encoding feature b is the encoding feature of reference video B. Then, the reference video A is encoded according to the encoding parameters of the reference encoding feature a, so that the video quality of the encoded reference video A meets the target video quality evaluation index, and the reference video B is encoded according to the encoding parameters of the reference encoding feature b, so that the video quality of the encoded reference video B meets the target video quality evaluation index.

[0074] In this implementation, the coding features in the reference coding feature set all have coding parameters of the video corresponding to the coding features. By clustering the coding features with the reference coding feature set, reference coding features belonging to the same category as the coding features can be determined from the reference coding feature set, that is, the reference coding features have a high degree of matching with the coding features of the video to be encoded, that is, the coding parameters of the reference coding features can be used to encode the video to be encoded, so the video encoding device uses the coding parameters of the reference coding features as the coding parameters of the video to be encoded.

[0075] In other implementations, the video encoding device may also use a machine learning method to analyze the encoding features of the video to be encoded to obtain encoding parameters of the video to be encoded.

[0076] 103. Encode the video to be encoded using the encoding parameters of the video to be encoded to obtain an encoded video.

[0077] The video encoding device encodes the parameters to be encoded using the encoding parameters determined based on step 102, so that the video quality of the encoded video obtained by encoding satisfies the target video quality evaluation index.

[0078] In the embodiment of the present application, since the coding feature of the video to be encoded is a feature used for video encoding, the video encoding device can determine the coding parameters of the video to be encoded according to the coding feature of the video to be encoded, and the video quality of the encoded video obtained by encoding the video to be encoded according to the coding parameter meets the target video quality evaluation index. In addition, by processing the coding feature of the video to be encoded to obtain the coding parameter, the amount of data processing can be reduced compared to processing the video to be encoded to obtain the coding parameter. After determining the coding parameter of the video to be encoded, the video encoding device uses the coding parameter of the video to be encoded to encode the video to be encoded, and can obtain a coded video whose video quality meets the target video quality evaluation index.

[0079] It should be understood that the video to be encoded in the embodiment of the present application generally refers to any video that needs to be encoded, that is, based on the technical solution provided in the embodiment of the present application, the encoding of any video is completed, and the video quality of the encoded video can meet the target video quality evaluation index. In a possible application scenario, different videos to be encoded are encoded based on the technical solution provided in the embodiment of the present application, and the difference between the video qualities of different encoded videos can be reduced. For example, the scene in video A is a motion scene, and the scene in video B is a static scene. Since the amount of data in the motion scene is larger than the amount of data in the static scene, the amount of data in video A is larger than the amount of data in video B. If video A and video B are encoded using the same encoding parameters, there will be a large difference between the video quality of the encoded video of video A and the video quality of the encoded video of video B.

[0080] If the encoding parameters of video A and the encoding parameters of video B are determined respectively based on the technical solution provided in the embodiment of the present application, and then video A is encoded according to the encoding parameters of video A, and video B is encoded according to the encoding parameters of video B, the difference between the video quality of the encoded video of video A and the video quality of the encoded video of video B can be narrowed.

[0081] In another possible application scenario, the encoding parameters used for encoding will also affect the bit rate of the encoded video. When the data amounts of different videos to be encoded are different, if the same encoding parameters are used to encode different videos to be encoded, not only the video quality of the encoded videos is not uniform, but also the bit rate of the encoded video obtained by encoding the video with a large data amount is high. By determining the encoding parameters of different videos to be encoded based on this implementation, more information can be discarded through encoding while ensuring the video quality of the encoded video, thereby reducing the bit rate of the encoded video obtained by encoding the video with a large data amount.

[0082] For example, the scene in video A is a moving scene, and the scene in video B is a static scene. Since the amount of data in the moving scene is larger than that in the static scene, the amount of data in video A is larger than that in video B. If the same encoding parameters are used to encode video A and video B, not only will there be a large difference between the video quality of the encoded video of video A and the video quality of the encoded video of video B, but the bit rate of the encoded video of video B may also be high.

[0083] If the encoding parameters of video A and the encoding parameters of video B are determined respectively based on the technical solution provided in the embodiment of the present application, and then video A is encoded according to the encoding parameters of video A, and video B is encoded according to the encoding parameters of video B, the difference between the video quality of the encoded video of video A and the video quality of the encoded video of video B can be reduced while the bit rate of the encoded video of video B can be reduced.

[0084] As an optional implementation, the video to be encoded includes a foreground area and a background area. The encoding features of the video to be encoded include a first encoding feature of the foreground area and a second encoding feature of the background area. For example, if the video to be encoded includes a person, then in the video to be encoded, the pixel area covered by the person is the foreground area, and the pixel area other than the foreground area is the background area. The first encoding feature is the encoding feature of the pixel area covered by the person, and the second encoding feature is the encoding feature of the pixel area not covered by the person.

[0085] In the process of determining the encoding parameters of the video to be encoded according to the encoding features of the video to be encoded, the video encoding device determines the first encoding parameter of the foreground area according to the first encoding feature, and determines the second encoding parameter of the background area according to the first encoding feature, that is, the encoding parameters include the first encoding parameter and the second encoding parameter.

[0086] The target video quality evaluation index includes a first target video quality evaluation index and a second target video quality evaluation index, wherein the video quality of the encoded foreground area obtained by encoding the foreground area according to the first encoding parameter meets the first target video quality evaluation index, and the video quality of the encoded background area obtained by encoding the background area according to the second encoding parameter meets the second target video quality evaluation index, and the video quality indicated by the first target video quality evaluation index is higher than the video quality indicated by the second target video quality evaluation index.

[0087] For example, if the foreground area is a pixel area covered by a person, and the background area is a pixel area covered by no person, then the first encoding parameter is used to encode the pixel area covered by the person, and the second encoding parameter is used to encode the pixel area covered by no person. Moreover, the video quality of the encoded foreground area obtained by encoding the pixel area covered by the person according to the first encoding parameter satisfies the first target video quality evaluation index, and the video quality of the encoded background area obtained by encoding the pixel area covered by no person according to the second encoding parameter satisfies the second target video quality evaluation index. Since the video quality indicated by the first target video quality evaluation index is higher than the video quality indicated by the second target video quality evaluation index, the video quality of the encoded foreground area is higher than the video quality of the encoded background area.

[0088] That is to say, when the foreground area of ​​the video to be encoded is encoded using the first encoding parameter obtained through this implementation mode, and the background area of ​​the video to be encoded is encoded using the second encoding parameter obtained through this implementation mode, the video quality of the encoded video can be made to meet the target video quality evaluation index while the video quality of the encoded foreground area is higher than the video quality of the encoded background area. That is, while ensuring the video quality of the encoded video, the video quality of the foreground area is prioritized.

[0089] As an optional implementation, after obtaining the encoded video, the video encoding device publishes the encoded video to the video-on-demand platform. By publishing the encoded video to the video-on-demand platform, the video encoding device allows users to order the encoded video through the video-on-demand platform.

[0090] In this embodiment, the video encoding device can encode the video to be released to the video on demand platform so that the video quality of the encoded video meets the target video quality evaluation index. In this way, publishing the encoded video to the video on demand platform can unify the video quality on the video on demand platform, thereby improving the user experience of watching videos through the video on demand platform.

[0091] In one possible scenario, Figure 2 The following is the architecture diagram of the video on demand system. Figure 2 As shown, the video on demand system 1 includes a client 11, a client 12, and a server 13, wherein there is a communication connection between the client 11 and the client 12 and the server 13, and the client 11 and the client 12 can upload videos to the server 13 through the communication connection, and the client 11 and the client 12 can also order videos released by the server 13 through the communication connection.

[0092] Optionally, the client 11 and the client 12 can be one of the following: a mobile phone, a computer, a tablet computer, a wearable smart device, for example, the client 11 is a mobile phone, the client 12 is a computer, and for another example, the client 11 and the client 12 are both tablet computers. Optionally, the server 13 is a server.

[0093] It should be understood that Figure 2 The client 11 and client 12 shown are only examples, and it should not be understood that there can only be two clients communicating with the server 13. In actual applications, the number of clients communicating with the server 13 can be m, where m is a positive integer.

[0094] The server 13 can run a video-on-demand platform, and the client 11 and the client 12 can log in to the video-on-demand platform. The user can then upload a video to the video-on-demand platform through the client 11 or the client 12 to publish the uploaded video on the video-on-demand platform. After receiving the video uploaded by the user, the server 13 can use the technical solution described above to encode the video uploaded by the user, and then publish the encoded video to the video-on-demand platform. In this way, the user can order the encoded video through any client.

[0095] In the video on demand system 1, after receiving the videos uploaded by the user, the server 13 can act as the encoding device mentioned above to encode all the uploaded videos and publish the encoded videos to the video on demand platform. In this way, the video quality of the encoded videos published to the video on demand platform can be unified while encoding and compressing the uploaded videos, thereby improving the user's experience of ordering videos through the video on demand platform.

[0096] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0097] The method of the embodiment of the present application is described in detail above, and the device of the embodiment of the present application is provided below.

[0098] See also Figure 3 , Figure 3 The schematic diagram of the structure of a video encoding device provided in an embodiment of the present application is as follows. The video encoding device 2 includes: an acquisition unit 21, a feature analysis unit 22, and an encoding unit 23. Optionally, the video encoding device 2 also includes a publishing unit 24. Specifically:

[0099] An acquisition unit 21, used to acquire encoding features of a video to be encoded;

[0100] A feature analysis unit 22 is used to determine the encoding parameters of the video to be encoded according to the encoding features, and the video quality of the encoded video obtained by encoding the video to be encoded according to the encoding parameters meets the target video quality evaluation index;

[0101] The encoding unit 23 is used to encode the video to be encoded by using the encoding parameters of the video to be encoded to obtain the encoded video.

[0102] In combination with any embodiment of the present application, the feature analysis unit 22 is specifically used for:

[0103] The coding features are processed using a neural network to obtain coding parameters of the video to be encoded.

[0104] In combination with any embodiment of the present application, the feature analysis unit 22 is specifically used for:

[0105] Determine a reference coding feature that belongs to the same class as the coding feature by clustering the coding feature with a reference coding feature set;

[0106] The encoding parameters of the reference encoding features are used as encoding parameters of the video to be encoded.

[0107] In combination with any embodiment of the present application, the acquisition unit 21 is specifically used for:

[0108] The video to be encoded is encoded using a video encoder to obtain the encoding feature.

[0109] In combination with any embodiment of the present application, the video encoding device 2 further includes: a publishing unit 24, configured to publish the encoded video to a video on demand platform.

[0110] In combination with any implementation manner of the present application, the coding feature includes at least one of the following: motion vector, number of intra-frame blocks, number of inter-frame blocks, intra-frame coding complexity, and inter-frame coding complexity.

[0111] In combination with any implementation manner of the present application, the target video quality evaluation index includes one of the following: VMAF, PSNR.

[0112] In the embodiment of the present application, since the coding feature of the video to be encoded is a feature used for video encoding, the video encoding device can determine the coding parameters of the video to be encoded according to the coding feature of the video to be encoded, and the video quality of the encoded video obtained by encoding the video to be encoded according to the coding parameter meets the target video quality evaluation index. In addition, by processing the coding feature of the video to be encoded to obtain the coding parameter, the amount of data processing can be reduced compared to processing the video to be encoded to obtain the coding parameter. After determining the coding parameter of the video to be encoded, the video encoding device uses the coding parameter of the video to be encoded to encode the video to be encoded, and can obtain a coded video whose video quality meets the target video quality evaluation index.

[0113] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.

[0114] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device 3 includes a processor 31 and a memory 32. Optionally, the electronic device 3 also includes an input device 33 and an output device 34. The processor 31, the memory 32, the input device 33 and the output device 34 are coupled via a connector, and the connector includes various interfaces, transmission lines or buses, etc., which are not limited in the embodiments of the present application. It should be understood that in each embodiment of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, it can be connected through various interfaces, transmission lines, buses, etc.

[0115] The processor 31 may include one or more processors, for example, one or more central processing units (CPUs). When the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU. Optionally, the processor 31 may be a processor group consisting of multiple CPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present application.

[0116] The memory 32 can be used to store computer program instructions and various computer program codes including the program code for executing the program code of the present application. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0117] The input device 33 is used to input data and / or signals, and the output device 34 is used to output data and / or signals. The input device 33 and the output device 34 can be independent devices or an integrated device.

[0118] It can be understood that in the embodiment of the present application, the memory 32 can be used not only to store relevant instructions, but also to store relevant data. For example, the memory 32 can be used to store the encoding features of the video to be encoded obtained through the input device 33, or the memory 32 can also be used to store the encoding parameters and encoded video of the video to be encoded obtained by the processor 31, etc. The embodiment of the present application does not limit the specific data stored in the memory.

[0119] Understandably, Figure 4 Only a simplified design of an electronic device is shown. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all electronic devices that can implement the embodiments of the present application are within the protection scope of the present application.

[0120] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present application have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.

[0122] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0124] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0125] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0126] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Claims

1. A video encoding method, It is characterized in that The method comprises: Obtaining encoding features of the video to be encoded and target video quality evaluation indicators; Determine encoding parameters of the video to be encoded according to the encoding features, and encode the video to be encoded according to the encoding parameters to obtain an encoded video whose video quality meets the target video quality evaluation index; The step of determining the encoding parameters of the video to be encoded according to the encoding features includes: Determining a reference coding feature that belongs to the same class as the coding feature by clustering the coding feature with a reference coding feature set, wherein the coding feature includes at least one of the following: a motion vector, a number of intra-frame blocks, a number of inter-frame blocks, an intra-frame coding complexity, and an inter-frame coding complexity; Using the encoding parameters of the reference encoding features as encoding parameters of the video to be encoded; The video to be encoded is encoded using the encoding parameters of the video to be encoded to obtain the encoded video.

2. The method according to claim 1, It is characterized in that The obtaining of the encoding features of the video to be encoded includes: The video to be encoded is encoded using a video encoder to obtain the encoding feature.

3. The method according to claim 1, It is characterized in that After obtaining the encoded video, the method further includes: publishing the encoded video to a video-on-demand platform.

4. The method according to claim 1, It is characterized in that The target video quality evaluation index includes one of the following: video multi-method evaluation fusion and peak signal-to-noise ratio.

5. A video encoding device, It is characterized in that The device comprises: An acquisition unit, used to acquire the encoding features of the video to be encoded and the target video quality evaluation index; A feature analysis unit, configured to determine, according to the encoding feature, an encoding parameter of the video to be encoded, and to obtain an encoded video by encoding the video to be encoded according to the encoding parameter so that the video quality satisfies the target video quality evaluation index; The step of determining the encoding parameters of the video to be encoded according to the encoding features includes: Determining a reference coding feature that belongs to the same class as the coding feature by clustering the coding feature with a reference coding feature set, wherein the coding feature includes at least one of the following: a motion vector, a number of intra-frame blocks, a number of inter-frame blocks, an intra-frame coding complexity, and an inter-frame coding complexity; Using the encoding parameters of the reference encoding features as encoding parameters of the video to be encoded; The video to be encoded is encoded using the encoding parameters of the video to be encoded to obtain the encoded video.

6. An electronic device, It is characterized in that include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and when the processor executes the computer instructions, the electronic device executes the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor is enabled to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Partition method and partition system for intra-frame prediction block

    CN104410858A

  • Video uploading method and device, electronic equipment and storage medium

    CN110536168A

  • Image coding method, equipment and computer readable storage medium

    CN111316326A

  • Model training method and device, video coding method and device, equipment and storage medium

    CN113014922A

  • Content adaptive video coding method and device, equipment and storage medium

    CN114554211A