A video bitrate control method, apparatus and device

By setting the upper and lower limits of the code rate value of the target scene category for the video in the video library and optimizing video encoding, the problem of excessive overall video bit rate in the CRF bit rate control method is solved, and the balance of picture quality and bit rate is achieved.

CN118972595BActive Publication Date: 2025-07-18ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411441077.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-07-18
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

The existing CRF code rate control method results in a large overall code rate of the video in the video library, and it is impossible to effectively control the code rate of the video, affecting the overall picture quality of the video.

Method used

By determining the target scene category of the target video, setting a targeted upper limit of the code rate value and lower limit of the code rate value, optimizing the encoding process of the video, ensuring that the overall picture quality of the video is reduced while also reducing the overall code rate.

Benefits of technology

While ensuring the overall picture quality of the video in the video library, it effectively reduces the overall bit rate of the video in the video library, avoiding the problem of greatly increasing the bit rate in order to improve the small-scale picture quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972595B_ABST
    Figure CN118972595B_ABST
Patent Text Reader

Abstract

An embodiment of this specification discloses a video bitrate control method, apparatus, and device. The solution may include: when encoding videos in a video library, determining, according to the target scene category to which each target video in the video library belongs, an upper limit and a lower limit of the bitrate value for encoding each target video, and then encoding the target video based on the upper limit and the lower limit of the bitrate value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video coding technology, and in particular, to a video bitrate control method, apparatus, and device. Background Art

[0002] In the prior art, when using an encoder to encode video data in a video library using the Constant Rate Factor (CRF) control method, a quality factor is usually set, and the encoder automatically adjusts the bitrate according to the set quality factor to control the encoding quality of the video, so that the encoded video quality reaches a specified quality level, and thus the user's subjective perception of the overall quality of the encoded video is relatively the same. When encoding a video in a video library using the CRF bitrate control method, a maximum bitrate is sometimes also set, and the encoder controls the encoding bitrate of the video according to the set maximum bitrate, so that the encoding bitrate of the video is less than the maximum bitrate.

[0003] In the prior art, the set maximum bitrate is usually determined according to the transmission bandwidth; and the maximum bitrate determined according to the transmission bandwidth is usually large, and the encoding bitrate of the video cannot be effectively controlled, resulting in a relatively large overall bitrate of the video. Based on this, how to ensure the overall quality of the videos in the video library while reducing the overall bitrate of the videos in the video library has become an urgent technical problem to be solved. Summary of the Invention

[0004] A video bitrate control method, apparatus, and device provided in the embodiments of this specification are used to solve the technical problem of relatively large overall bitrate of the video under the same video quality in the existing CRF bitrate control method.

[0005] To solve the above technical problem, the embodiments of this specification are implemented as follows:

[0006] A video bitrate control method provided in the embodiments of this specification includes:

[0007] Obtain a target video;

[0008] Determine the target scene category to which the target video belongs;

[0009] According to the target scene category to which the target video belongs, determine the upper limit of the bitrate value for encoding the target video; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control method;

[0010] According to the target scene category to which the target video belongs, determine the lower limit of the bitrate value for encoding the target video;

[0011] Encode the target video according to the upper limit and the lower limit of the bitrate value.

[0012] A video bitrate control device provided by an embodiment of this specification includes:

[0013] A first acquisition module, configured to acquire a target video;

[0014] A first determination module, configured to determine a target scene category to which the target video belongs;

[0015] A second determination module, configured to determine an upper limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode;

[0016] A third determination module, configured to determine a lower limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs;

[0017] An encoding module, configured to encode the target video according to the upper limit of the bitrate value and the lower limit of the bitrate value.

[0018] A video bitrate control device provided by an embodiment of this specification includes:

[0019] At least one processor; and,

[0020] A memory communicatively connected to the at least one processor; wherein,

[0021] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to:

[0022] Acquire a target video;

[0023] Determine a target scene category to which the target video belongs;

[0024] Determine an upper limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode;

[0025] Determine a lower limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs;

[0026] Encode the target video according to the upper limit of the bitrate value and the lower limit of the bitrate value.

[0027] At least one embodiment provided in this specification can achieve the following beneficial effects:

[0028] When encoding videos in a video library, the upper limit and lower limit of the bitrate value for encoding a target video are determined according to the target scene category to which each target video in the video library belongs. Then, the target video is encoded based on the upper limit and lower limit of the bitrate value. The upper limit and lower limit of the bitrate value are first obtained by encoding a video set of the target scene category to get the encoded video picture quality and video bitrate, and then the more reasonable maximum bitrate and minimum bitrate are determined based on the encoded video picture quality and video bitrate, which can reduce the overall bitrate of the video set of the target scene category while ensuring the overall picture quality of the video set of the target scene category. Since setting the upper limit of the bitrate value can reduce the encoding bitrate of the target video in the video library, and setting the lower limit of the bitrate value can improve the encoding picture quality of the target video in the video library, when encoding the videos in the video library using the upper limit and lower limit of the bitrate value, the overall bitrate of the videos in the video library can be effectively reduced while ensuring the overall picture quality of the videos in the video library. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0030] Figure 1 FIG. is a schematic diagram of an application scenario of a video bitrate control method provided by an embodiment of this specification;

[0031] Figure 2 FIG. is a schematic flowchart of a video bitrate control method provided by an embodiment of this specification;

[0032] Figure 3 FIG. is a schematic diagram of the relationship between bitrate and picture quality provided by an embodiment of this specification;

[0033] Figure 4 FIG. is a schematic diagram of the relationship between average bitrate and average picture quality provided by an embodiment of this specification;

[0034] Figure 5 FIG. is a schematic flowchart of another video bitrate control method provided by an embodiment of this specification;

[0035] Figure 6 corresponding to the embodiment of this specification Figure 2 FIG. is a schematic structural diagram of a video bitrate control device;

[0036] Figure 7 corresponding to the embodiment of this specification Figure 2Schematic structural diagram of a video bitrate control device. Detailed implementation manners

[0037] To make the objectives, technical solutions, and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by one or more embodiments of this specification.

[0038] The following details the technical solutions provided in each embodiment of this specification in conjunction with the drawings.

[0039] With the development of live streaming and short video services, the application of video coding technology has become increasingly widespread. The application of video coding technology can compress video data and control the bitrate to reduce the size of video files, save the storage space and transmission bandwidth required for video files, and at the same time maintain the quality of the video as much as possible.

[0040] Existing bitrate control methods generally include the Constant Bit Rate (CBR) control method and the Variable Bit Rate (VBR) control method. Among them, the CBR bitrate control method means encoding a video at a fixed bitrate. During the encoding process, the bitrate of the video is not affected by the image complexity and remains fixed. The CBR bitrate control method can ensure a stable bitrate during the video encoding process, but cannot guarantee the image quality. Usually, the CBR bitrate control method is applicable to scenarios where the network bandwidth is fixed and stable. The VBR bitrate control method means encoding a video at a variable bitrate. During the encoding process, the bitrate of the video is adjusted according to the complexity of the image content. For example, if the image has rich details or contains a large amount of motion, a higher bitrate is allocated; if the image is relatively flat, a lower bitrate is allocated, which not only ensures the quality but also takes into account the bandwidth limitation to adapt to the change of the network bandwidth.

[0041] VBR can be further divided into an average bit rate (ABR) control method, a constant quantization parameter (CQP) control method, and a constant rate factor (CRF) control method. Among them, the ABR bit rate control method means that the average bit rate of a certain continuous video frame block is a target bit rate; the CQP bit rate control method means that video is encoded based on a fixed quantization parameter value (such as QP); the CRF bit rate control method means that the encoding quality of the video is controlled by setting a quality factor (for example, the CRF value), rather than using a fixed bit rate. Generally, the lower the CRF value, the higher the quality of the compressed video, and the larger the compressed video file; conversely, the higher the CRF value, the lower the quality of the compressed video, and the smaller the compressed video file. In the CRF bit rate control method, sometimes a maximum bit rate is also set, and the maximum bit rate is usually determined according to the transmission bandwidth value to ensure that there is no frame freezing when the user plays the video; for example, if the user's network transmission bandwidth value is 3 Mbps, the maximum bit rate can be 2.5 Mbps. The encoder automatically adjusts the bit rate according to the set quality factor and the maximum bit rate to control the encoding bit rate of the video while trying to ensure that the video picture quality reaches the specified quality level, so that the encoding bit rate of the video is less than the maximum bit rate.

[0042] Generally speaking, increasing the bit rate will improve the picture quality of the encoded video. However, in actual applications, the increase in the bit rate is not directly proportional to the improvement in the picture quality. For example, for some videos, only a small increase in the bit rate will result in a significant improvement in the video picture quality; while for some videos, even if a large amount of bit rate is increased, there is no obvious improvement in the video picture quality. When the existing CRF bit rate control method encodes the videos in the video library using the set quality factor and the maximum bit rate determined according to the transmission bandwidth value, there is a problem that more bit rate is allocated to the video to ensure the picture quality of the video, but the improvement rate of the video picture quality is low. Therefore, the existing CRF bit rate control method has an unreasonable bit rate allocation, resulting in a large overall bit rate of the videos in the video library when the overall video picture quality of the videos is the same.

[0043] Based on this, how to ensure the picture quality of the videos in the video library while reducing the bit rate has become an urgent technical problem to be solved.

[0044] To solve the defects in the prior art, the present solution provides the following embodiments.

[0045] Figure 1 It is a schematic diagram of an application scenario of a video bit rate control method in the embodiments of this specification.

[0046] AsFigure 1 As shown, before sending a video from the first device 101 to the second device 102, the video can be encoded for ease of transmission. The first device 101 may include an encoding module for encoding the video before sending the video out. The first device 101 and the second device 102 can be communicatively connected via a wired or wireless network.

[0047] Although in Figure 1 it is shown that the first device 101 is a server and the second device 102 is a terminal device, in actual applications, the first device may include a server or a terminal device, and the second device may include a terminal device or a server. Moreover, the type and data of the server and the type and data of the terminal device may not be limited to those as Figure 1 shown. For example, the type of the terminal device may include but is not limited to mobile phones, tablets, desktop computers, smart home devices, smart wearable devices, vehicle-mounted terminals, etc.

[0048] Optionally, the first device may be a server and the second device may be a terminal device. In actual applications, a user using the terminal device can obtain a video from the video library of the server. For example, in scenarios such as network video on demand and cloud disk video download. Specifically, before the server sends the target video to the terminal device in response to the video acquisition request sent by the terminal device, the encoding module in the server can be used to encode the target video by adopting the video bitrate control method of the embodiments of this specification.

[0049] Optionally, the first device may be a terminal device and the second device may be a server. In actual applications, a user using the terminal device can upload a video to the server. For example, in scenarios such as a user uploading a video to a video platform and a user uploading a video to a cloud disk. Specifically, a user using the terminal device can initiate the matter of transmitting the target video to the server. Before transmitting the target video to the server, the encoding module in the terminal device can be used to encode the target video by adopting the video bitrate control method of the embodiments of this specification.

[0050] Optionally, the first device may be a terminal device and the second device may be another terminal device. In actual applications, a video can be transmitted from one user terminal device to another user terminal device. For example, in scenarios such as video live broadcast and video chat. Specifically, before transmitting the video of the first terminal device to the second terminal device, the encoding module in the first terminal device can be used to encode the target video by adopting the video bitrate control method of the embodiments of this specification.

[0051] Optionally, the first device may be a server or a server cluster, and the second device may be another server or a server cluster. In practical applications, according to the needs of the actual business, the video may be transmitted from one server or server cluster to another server or server cluster. Specifically, before transmitting the video of the first server or server cluster to another server or server cluster, the encoding module in the first server or server cluster may be utilized, and the video bitrate control method of the embodiments of this specification may be adopted to encode the target video.

[0052] Next, a video bitrate control method provided in the embodiments of the specification will be specifically described in conjunction with the accompanying drawings.

[0053] Figure 2 It is a schematic flowchart of a video bitrate control method provided in the embodiments of this specification. From a program perspective, the execution subject of this process may be a program running on a terminal device or a server. From a hardware perspective, the execution subject of this process may be an encoding device or an encoding equipment. As Figure 2 shown, this process may include the following steps.

[0054] Step 202: Obtain the target video.

[0055] In the embodiments of this specification, the target video may be a video in the video library that has not undergone bitrate control.

[0056] In practical applications, when a video in the video library is transmitted to another terminal by a transmission terminal, or when a user plays a video using a user terminal, the video library may send the target video to be transmitted or played to the encoding module, so that after the encoding module obtains the target video, it can perform compression encoding on the target video.

[0057] Step 204: Determine the target scene category to which the target video belongs.

[0058] In the embodiments of this specification, the target scene category may be obtained by screening from multiple preset scene categories in advance.

[0059] In the embodiments of this specification, each video in the video library including the target video may include category tags in multiple dimensions. Specifically, the category tags of the video may include tags in multiple dimensions such as the first dimension tag and the second dimension tag. Among them, the first dimension tag may be used to reflect the application scenario and business scenario of the video. For example, the first dimension tag may be live broadcast, video on demand, etc. The second dimension tag may be used to reflect the content scenario of the video. For example, the second dimension tag may be indoor, outdoor, etc. Of course, the category tags of the video may also include the third dimension tag, the fourth dimension tag, and other dimension tags. The category tags in multiple dimensions of the video may also be tags used to reflect other content of the video, which is not specifically limited here.

[0060] In practical applications, the preset scene category may be determined according to the scene category reflected by the category tags inherent in the videos in the video library. Specifically, the preset scene category may be the scene category reflected by a single dimension category tag. For example, the preset scene category may be the scene category reflected by the category tag of live broadcast and / or the scene category reflected by the category tag of video on demand. It may also be the scene category reflected by the category tag of indoor and / or the scene category reflected by the category tag of outdoor. Of course, the preset scene category may also be the scene category jointly reflected by the combination of category tags in multiple dimensions. For example, the preset scene category may be the scene category jointly reflected by the combination of the category tag of live broadcast and the category tag of indoor, and / or the scene category jointly reflected by the combination of the category tag of live broadcast and the category tag of outdoor.

[0061] Generally, videos of different scene categories have different requirements for image quality and real-time performance. Therefore, in the embodiments of this specification, the maximum bitrate and minimum bitrate set during the encoding process for the video may be different. For example, when the overall image quality requirement for the videos in the video library is relatively high, if the set maximum bitrate is small, it may not be possible to guarantee the overall image quality of the video. Therefore, the maximum bitrate needs to be set larger. In the embodiments of this specification, when determining the target scene category from the preset scene categories, more reasonable maximum bitrates and minimum bitrates are also determined respectively for different target scene categories to ensure that when encoding the videos in the video library using the maximum bitrate and minimum bitrate, the overall image quality of the videos in the video library can be guaranteed while reducing the overall bitrate of the videos. Among them, the overall bitrate of the videos in the video library may be the characteristic bitrate of all the videos in the video library. The characteristic bitrate may be the sum of the bitrates of all the videos in the video library, or it may be the average value of the bitrates of all the videos in the video library.

[0062] In the embodiments of this specification, after determining the target scene category from the preset scene categories, the target scene category to which the target video belongs can be determined according to the category label of the target video. If the target video itself does not have a category label, a pre-trained deep learning model can also be used to identify the target scene category to which the target video belongs. Since using a deep learning model to identify the target scene category to which the target video belongs is relatively common in the prior art, it will not be elaborated here. In practical applications, other image recognition technologies can also be used to determine the target scene category to which the target video belongs, and no specific limitation is made here.

[0063] Step 206: Determine the upper limit of the bitrate value for encoding the target video according to the target scene category to which the target video belongs; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode.

[0064] In practical applications, the bitrate refers to the number of data bits transmitted per unit time during data transmission, also called the bit rate, which indicates how many bits of data are required per second for the encoded video data or audio data to be transmitted. The unit generally used for the bitrate is kilobits per second (kbps) or megabits per second (Mbps). The bitrate can be the sampling rate. The larger the sampling rate per unit time, the higher the bitrate, the clearer the details of the video image, and the more bandwidth and storage space the encoded video file will occupy.

[0065] In the embodiments of this specification, the upper limit of the bitrate value can be the maximum bitrate set when encoding the target video.

[0066] In the CRF bitrate control mode, the maximum bitrate can be determined according to the transmission bandwidth value. Specifically, the maximum bitrate can be determined according to the transmission bandwidth value and the video content to ensure that there is no video freezing at the user end while ensuring the video image quality to a certain extent.

[0067] Figure 3 It is the bitrate-quality curve after encoding three different videos using multiple quality factors respectively. Among them, the three different videos can be any three different videos. In actual operation, in order to more clearly show the differences between the bitrate-quality curves of different videos, three different types of videos can be selected.

[0068] In Figure 3Among them, a curve can correspond to a bitrate - image quality curve after video encoding. A (bitrate, image quality) data point on the curve can represent the bitrate data and image quality data obtained by encoding a video using a quality factor. Different (bitrate, image quality) data points on the same curve can correspond to different quality factors.

[0069] Specifically, for each video in the video library, multiple different quality factors (as Figure 3 shown, 4 different quality factors can be used) can be used to encode each video separately to obtain the encoded (bitrate, image quality) data points corresponding to each quality factor for each video. Furthermore, based on the multiple encoded (bitrate, image quality) data points of each video, the encoded bitrate - image quality curve of each video can be drawn.

[0070] According to Figure 3 it can be known that for some videos, even if a large amount of bitrate is increased, the image quality of the video does not improve significantly, as shown by the third - group data in Figure 3 . For videos where increasing the bitrate by a large amount does not result in a significant improvement in video image quality, even if a part of the allocated bitrate is reduced, it will not significantly affect their image quality; and the maximum bitrate determined according to the transmission bandwidth value is usually large, and it is impossible to effectively reduce the bitrate of videos where increasing the bitrate by a large amount does not result in a significant improvement in video image quality. Therefore, in the embodiments of this specification, by setting a more reasonable upper limit of the bitrate value to control the encoding bitrate of the video, the overall bitrate of the videos in the encoded video library can be reduced.

[0071] In the embodiments of this specification, the upper limit of the bitrate value can be pre - screened from multiple bitrate values based on the average bitrate and average image quality after encoding a video set of the target scene category, and can be used to reduce the overall bitrate of the video set of the target scene category and ensure the overall image quality of the video set of the target scene category.

[0072] In the embodiments of this specification, since the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value, and the upper limit of the bitrate value is screened from multiple bitrate values, which can optimize the overall bitrate and overall image quality of the video set of the target scene category; therefore, when encoding the target videos of the corresponding target scene category in the video library using the upper limit of the bitrate value corresponding to each target scene category, the overall bitrate of the videos in the video library can be effectively reduced without affecting or not significantly affecting the overall image quality of the videos in the video library.

[0073] Step 208: Determine the lower limit of the bitrate value for encoding the target video according to the target scene category to which the target video belongs.

[0074] In the embodiments of this specification, the lower limit of the bitrate value can be the minimum bitrate set when encoding the target video.

[0075] In the prior art, the minimum bit rate is usually not set during the encoding of videos using the CRF method. Through research, the present application has found that for some videos, the video image quality will be significantly improved only by increasing a relatively small bit rate value. As shown by the first and second groups of data in Figure 3 For videos whose video image quality will be significantly improved only by increasing a relatively small bit rate value, even if a part of their image quality is improved, it is not necessary to significantly increase their bit rate. Therefore, in the embodiments of this specification, by setting a more reasonable lower limit of the bit rate value to improve the video image quality, the overall image quality of the videos in the encoded video library can be improved.

[0076] In the embodiments of this specification, the lower limit of the bit rate value is pre-screened from multiple bit rate values based on the average bit rate and average image quality after encoding the video set of the target scene category, and can be used to improve the overall image quality of the video set of the target scene category without increasing or not significantly increasing the overall bit rate of the video set of the target scene category.

[0077] In the embodiments of this specification, since the lower limit of the bit rate value is pre-screened from multiple bit rate values and can be used to optimize the overall bit rate and overall image quality of the video set of the target scene category; therefore, by using the lower limit of the bit rate value corresponding to each target scene category to encode the target videos of the corresponding target scene category in the video library, the overall image quality of the videos in the video library can be effectively improved without increasing or not significantly increasing the overall bit rate of the videos in the video library.

[0078] In the embodiments of this specification, a correspondence relationship between the target scene category and the upper limit and lower limit of the bit rate value can also be established in advance, so that according to the correspondence relationship, the upper limit and lower limit of the bit rate value used for encoding the target video can be quickly determined. For example, if the target scene category is live broadcast and the determined upper limit of the bit rate value is 3000 kbps and the lower limit of the bit rate value is 500 kbps, the live broadcast can be associated and stored with the upper limit of the bit rate value 3000 kbps and the lower limit of the bit rate value 500 kbps.

[0079] Step 210: Encode the target video according to the upper limit and the lower limit of the bit rate value.

[0080] In the embodiments of this specification, among the numerous videos in the video library, there are usually videos with a relatively large increase in bitrate but no obvious improvement in video quality, and there are also videos where only a relatively small increase in bitrate value can significantly improve the video quality. When the target video is a video with a relatively large increase in bitrate value but no obvious improvement in video quality, encoding the target video using the upper limit and lower limit of the bitrate value can effectively reduce the bitrate of the target video without significantly affecting the video quality of the target video. When the target video is a video where only a relatively small increase in bitrate value can significantly improve the video quality, encoding the target video using the upper limit and lower limit of the bitrate value can effectively improve the video quality of the target video without significantly increasing the bitrate of the target video.

[0081] In the embodiments of this specification, when encoding all the videos in the video library using the upper limit and lower limit of the bitrate value, although encoding the videos with a relatively large increase in bitrate value but no obvious improvement in video quality using the upper limit and lower limit of the bitrate value reduces the overall video quality in the video library, encoding the videos where only a relatively small increase in bitrate value can significantly improve the video quality using the upper limit and lower limit of the bitrate value effectively improves the overall video quality in the video library, thereby effectively ensuring the overall video quality in the video library. And since the reduction in bitrate value when encoding the videos with a relatively large increase in bitrate value but no obvious improvement in video quality using the upper limit and lower limit of the bitrate value is much greater than the increase in bitrate value when encoding the videos where only a relatively small increase in bitrate value can significantly improve the video quality using the upper limit and lower limit of the bitrate value. Therefore, based on the embodiments of this specification, it is possible to effectively reduce the overall bitrate of the videos in the video library without affecting the overall video quality of the videos in the video library.

[0082] Figure 2In the method, when encoding the videos in the video library, the upper limit and the lower limit of the bitrate value for encoding the target video are determined according to the target scene category to which each target video in the video library belongs, and then the target video is encoded based on the upper limit and the lower limit of the bitrate value. Since the upper limit and the lower limit of the bitrate value are more reasonable maximum bitrate and minimum bitrate determined in advance based on the video quality and the video bitrate of the video set of the target scene category, the overall video quality of the video set of the target scene category can be ensured, and at the same time, the overall bitrate of the video set of the target scene category can be reduced. Since the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value, therefore, by setting the upper limit of the bitrate value to encode the videos in the video library, the overall bitrate of the videos in the video library can be effectively reduced. And by applying the upper limit of the bitrate value to encode the target video, the problem that the bitrate of the target video increases significantly in order to improve the video quality by a small margin during the encoding process can be avoided, so that the encoding bitrate of the target video can be further significantly reduced, and the encoding video quality of the target video will not be significantly reduced. Furthermore, by applying the lower limit of the bitrate value to encode the target video, the encoding bitrate of the target video can be increased when the encoding bitrate of the target video is small; especially when the target video can significantly improve the encoding video quality by increasing the encoding bitrate slightly, by applying the lower limit of the bitrate value to encode the target video, the video quality of the target video can be significantly improved without significantly increasing the encoding bitrate of the target video. Since setting the upper limit of the bitrate value can reduce the encoding bitrate of the target video in the video library, and setting the lower limit of the bitrate value can improve the encoding video quality of the target video in the video library, thus, by using the upper limit and the lower limit of the bitrate value to encode the videos in the video library, the overall video quality of the videos in the video library can be ensured, and at the same time, the overall bitrate of the videos in the video library can be effectively reduced.

[0083] In practical applications, the upper limit and the lower limit of the bitrate value corresponding to different scene categories may be different, and the upper limit and the lower limit of the bitrate value for encoding the videos of each target scene category can be determined in advance for subsequent applications.

[0084] Specifically, before determining the target scene category to which the target video belongs, it may further include:

[0085] Obtain the video set of the preset scene categories.

[0086] Based on the video set of the preset scene categories, determine the upper limit and the lower limit of the bitrate value for encoding the videos of the preset scene categories.

[0087] In the embodiments of this specification, the preset scene categories can be filtered based on the category labels of the videos in the video library. Specifically, based on the category labels of the videos, the preset scene categories can be determined according to the business scenario; for example, the preset scene categories can be determined based on the first - dimension labels, and the preset scene categories can be live broadcast and on - demand. Of course, the preset scene categories can also be determined based on the category labels of the videos according to the video content; for example, the preset scene categories can be determined based on the second - dimension labels, and the preset scene categories can be movies, TV dramas, or indoor and outdoor. Of course, the preset scene categories can also be determined according to other actual requirements, which are not specifically limited here.

[0088] Among them, the video set can be obtained from the video library. Specifically, it can be determined whether a video is a video to be obtained according to the category label of the video; when the category label of the video includes multiple dimensions, as long as the category label of the video includes a category label that can reflect that the video is a video of the preset scene category, then it can be determined that the above - mentioned video is a video in the video set. Specifically, assume that the preset scene category is a movie. If the category label of the target video includes on - demand, movie, and indoor, since the category label of the target video contains a category label used to reflect that the target video is a movie, it can be determined that the target video is a video in the video set to be obtained. For another example, if the preset scene category is a movie and the category label of the target video includes on - demand, TV drama, and indoor, since the category label of the target video does not contain a category label reflecting that the target video is a movie, it can be determined that the target video is not a video in the video set to be obtained.

[0089] In the embodiments of this specification, the upper limit and lower limit of the bitrate value can be determined based on the average bitrate and average image quality of the encoded video set encoded based on the upper limit of the preset bitrate value and the lower limit of the preset bitrate value, as well as the average bitrate and average image quality of the encoded video set encoded based on the traditional CRF bitrate control method.

[0090] In the embodiments of this specification, determining in advance the upper limit and lower limit of the bitrate value for encoding videos for each target scene category can facilitate subsequent applications and improve the video encoding efficiency.

[0091] To facilitate the understanding of this solution, the embodiments of this specification also provide the specific content for determining the upper limit and lower limit of the bitrate value for encoding videos of the preset scene category based on the video set of the preset scene category.

[0092] Specifically, determining the upper limit and lower limit of the bitrate value for encoding the video of the preset scene category may specifically include:

[0093] Obtain the first video set of the first preset scene category.

[0094] Use multiple first constant quality factors to encode the first video set respectively to obtain a bitrate-quality curve;

[0095] Obtain a preset second constant quality factor.

[0096] Use the second constant quality factor and multiple groups of preset bitrates to encode the first video set to obtain an encoding result; any one of the preset bitrate pairs includes a preset bitrate value upper limit and a preset bitrate value lower limit.

[0097] According to the encoding result, obtain multiple first data points in the bitrate-quality coordinate system; the bitrate-quality coordinate system is the coordinate system where the bitrate-quality curve is located.

[0098] According to the positional relationship between the multiple first data points and the bitrate-quality curve, determine the upper limit and lower limit of the bitrate value of the first preset scene category.

[0099] In the embodiments of this specification, the first preset scene category may be any scene category in the preset scene categories. The first video set may be obtained from a video library. The obtaining method of the first video set is basically the same as the obtaining method of the video set of the preset scene category in the foregoing, and will not be elaborated here.

[0100] In the embodiments of this specification, the first constant quality factor may be the CRF value set during CRF bitrate control for a video. Generally, the CRF value can be any value between 0 and 51, where 0 represents lossless compression and 51 represents the highest compression rate. Since the purpose of the user terminal to watch videos of different scene categories may be different, the specific value of the first constant quality factor can be determined according to the scene category. For example, when the first preset scene category is live streaming with goods, since the user terminal may pay more attention to the explanation content of the live streamer when watching live streaming with goods videos and less attention to the details of the live stream video, and usually the surrounding environment changes little during live streaming, the requirement for the picture quality of the live stream video may generally be lower. At this time, the multiple first constant quality factors can be set to 22, 23, 24, 25, and 26 respectively. When the first preset scene category is on-demand, specifically, the on-demand video can be an online teaching video, a movie, or a TV series. For on-demand videos, the user terminal may pay more attention to the video picture content. Therefore, the requirement for the picture quality of on-demand videos may generally be higher. At this time, the multiple first constant quality factors can be set to 7, 8, 9, 10, and 11 respectively to ensure meeting the requirements of the user side.

[0101] In the embodiments of this specification, the second constant quality factor may be any one of the first constant quality factors. Preferably, the second constant quality factor may be the middle value among the multiple first constant quality factors. Specifically, when the multiple first constant quality factors are 22, 23, 24, 25, and 26, the second constant quality factor may be 24. For another example, when the multiple first constant quality factors are 7, 8, 9, 10, and 11, the second constant quality factor may be 9. Of course, the second constant quality factor may also be a specified value within a preset range from the first constant quality factor. For example, when the first constant quality factors are 22, 23, 24, 25, and 26, the second constant quality factor may be 21 or 27. No specific limitation is made here.

[0102] Figure 4 It is a schematic diagram of the relationship between the average bitrate and the average picture quality. Figure 4 In the bitrate-picture quality coordinate system in [reference], the abscissa is the average bitrate and the ordinate is the average picture quality. Each first constant quality factor can be used to encode the first video set respectively, so as to obtain the average bitrate and the average picture quality of the encoded first video set corresponding to each first constant quality factor. According to the average bitrate and the average picture quality of the encoded first video set corresponding to each first constant quality factor, a bitrate-picture quality curve can be plotted in the bitrate-picture quality coordinate system, as shown by the curve in [reference]. Figure 4 shown in the figure.

[0103] In Figure 4Among them, each data point represented by a dot on the curve is used to represent the average bitrate and average image quality of the encoded first video set corresponding to each first constant quality factor. For example, it successively represents that when the first constant quality factor is 22, 23, 24, 25, 26, the (average bitrate, average image quality) of the encoded first video set is (400, 42), (500, 43), (700, 44), (970, 44.7), (1200, 45.4).

[0104] In the embodiments of this specification, the upper limit of the preset bitrate value can be determined according to the bitrate that the first video set of the first preset scene category usually may have, and the upper limit of the preset bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value.

[0105] In the embodiments of this specification, the encoding result may include the encoded bitrates and image qualities obtained by encoding each video in the first video set using the second constant quality factor and each group of preset bitrate pairs. Specifically, each video in the first video set can be encoded using the second constant quality factor and a group of preset bitrate pairs, so as to obtain a set of encoded data including the encoded bitrates and image qualities of each video in the first video set; then, each video in the first video set can be encoded using the second constant quality factor and another group of preset bitrate pairs, so as to obtain another set of encoded data including the encoded bitrates and image qualities of each video in the first video set; according to the above method, the encoded data corresponding to each group of preset bitrate pairs can be obtained, so as to obtain the encoding result.

[0106] In the embodiments of this specification, each first data point can represent the average bitrate and average image quality of the first video set encoded using the second constant quality factor and a group of preset bitrate pairs. Specifically, for any set of encoded data obtained above, the average bitrate of the first video set can be obtained according to the encoded bitrates of each video in the set, and the average image quality of the first video set can be obtained according to the encoded image qualities of each video in the set. According to the average bitrate and average image quality, a first data point can be marked in the bitrate-image quality coordinate system. Similarly, other first data points can be obtained according to other sets of encoded data, which will not be elaborated here.

[0107] To facilitate the understanding of this solution, the embodiments of this specification also provide the specific content of determining the upper limit and lower limit of the bitrate value of the first preset scene category according to the positional relationship between the multiple first data points and the bitrate-image quality curve.

[0108] Specifically, the determining of the upper limit and lower limit of the bitrate value of the first preset scene category according to the positional relationship between the multiple first data points and the bitrate-image quality curve may specifically include:

[0109] If the position relationship indicates the existence of second data points among the multiple first data points, calculate the distances from each of the second data points to the bitrate-quality curve; the second data points are data points whose quality coordinates are greater than the quality coordinates of a specific point in the bitrate-quality curve, and the bitrate coordinate of the specific point is the same as the bitrate coordinate of the second data point.

[0110] Determine the upper limit of the bitrate value in the preset bitrate pair corresponding to the second data point with the largest distance as the upper limit of the bitrate value for the first preset scenario category.

[0111] Determine the lower limit of the bitrate value in the preset bitrate pair corresponding to the second data point with the largest distance as the lower limit of the bitrate value for the first preset scenario category.

[0112] In the embodiments of this specification, among the first data points, there may be data points above the bitrate-quality curve, and there may also be data points below the bitrate-quality curve, as Figure 4 shown; the second data points can be understood as data points above the bitrate-quality curve, as Figure 4 shown, where there are four first data points above the bitrate-quality curve; the quality coordinates of the second data points are greater than the quality coordinates of a specific point in the bitrate-quality curve with the same bitrate coordinate. If there are second data points among the first data points, that is, when the quality coordinates are the same, the bitrate coordinate of the second data point is less than the bitrate coordinate of the specific point in the bitrate-quality curve; or when the bitrate coordinates are the same, the quality coordinate of the second data point is greater than the quality coordinate of the specific point in the bitrate-quality curve, it can indicate that there is a bitrate pair in the preset bitrate pair that can optimize the bitrate and quality of the encoded first video set.

[0113] In the embodiments of this specification, since the second data points are obtained by encoding the first video set using the second constant quality factor and different preset bitrate pairs, therefore, the upper limit and lower limit of the bitrate value for the first preset scenario category can be determined based on the second data points. In practical applications, the upper limit of the bitrate value in the preset bitrate pair corresponding to the second data point with the largest distance from the second data point to the bitrate-quality curve can be determined as the upper limit of the bitrate value for the first preset scenario category, and the lower limit of the bitrate value in the preset bitrate pair corresponding to the second data point with the largest distance can be determined as the lower limit of the bitrate value for the first preset scenario category.

[0114] In practical applications, the distance from the second data point to the bitrate-quality curve can be the vertical distance from the second data point to the bitrate-quality curve, or the longitudinal distance from the second data point to the bitrate-quality curve, and no specific limitation is made here.

[0115] In the embodiments of the present specification, in order to facilitate quickly determining the upper limit and lower limit of the bit rate value corresponding to the target scene category in subsequent applications, the target scene category can also be associated and stored with the corresponding upper limit and lower limit of the bit rate value.

[0116] Specifically, after determining the upper limit and lower limit of the bit rate value of the first preset scene category, it may further include:

[0117] Determine that the first preset scene category is the target scene category.

[0118] Associate and store the target scene category with the upper limit and lower limit of the bit rate value.

[0119] In the embodiments of the present specification, if there is a second data point in the first data points, it means that it is relatively reasonable to divide the videos in the video library using the first preset scene category, and the upper limit and lower limit of the bit rate values of the videos in the video set of the first preset scene category are relatively unified. Therefore, the first preset scene category can be determined as the target scene category.

[0120] In the embodiments of the present specification, the target scene category can be associated and stored with the corresponding upper limit and lower limit of the bit rate value, and the upper limit and lower limit of the bit rate value corresponding to the target scene category can be quickly determined in subsequent applications, thereby improving the video encoding efficiency.

[0121] In practical applications, if the selected first preset scene category is unreasonable, for example, the videos included in the first preset scene category are relatively complex, it may result in the bit rate obtained by encoding the first video set using the preset bit rate being no smaller than the bit rate obtained by encoding without using the preset bit rate under the same picture quality. That is, there is no second data point in the first data points. Based on this, the embodiments of the present specification also provide the following technical solutions.

[0122] Specifically, according to the positional relationship between the multiple first data points and the bit rate-picture quality curve to determine the upper limit and lower limit of the bit rate value of the first preset scene category, it may further include:

[0123] If the positional relationship indicates that there is no second data point in the multiple first data points, then screen out the second video set of the second preset scene category from the first video set of the first preset scene category; the second data point is a data point whose picture quality coordinate is greater than the picture quality coordinate of a specific point in the bit rate-picture quality curve, and the bit rate coordinate of the specific point is the same as the bit rate coordinate of the second data point.

[0124] Based on the second video set, determine the upper limit and lower limit of the bit rate value of the second preset scene category under the first preset scene category.

[0125] In the embodiments of this specification, if there is no second data point in the first data points, it may be because the range represented by the first preset scenario category is relatively large, making the types of videos in the first video set determined according to the first preset scenario category relatively complex, and thus there is no preset bitrate pair that can optimize the first video set as a whole. Therefore, the scenario categories of the videos in the first video set can be subdivided. Specifically, a second video set of the second preset scenario category can be screened out from the first video set to determine the upper limit and lower limit of the bitrate value for encoding the videos of the second preset scenario category under the first preset scenario category based on the second video set.

[0126] In practical applications, a second video set of the second preset scenario category can also be directly screened out from the video library to determine the upper limit and lower limit of the bitrate value for encoding the videos of the second preset scenario category based on the second video set, which is not limited here.

[0127] In practical applications, the method for determining the upper limit and lower limit of the bitrate value for encoding the videos of the second preset scenario category or the videos of the second preset scenario category under the first preset scenario category based on the second video set is generally the same as the method for determining the upper limit and lower limit of the bitrate value for encoding the videos of a preset scenario category, which will not be elaborated here.

[0128] To facilitate the understanding of this application, in the embodiments of this specification, the specific content of using multiple first constant quality factors to encode the first video set respectively to obtain a bitrate-quality curve is also provided.

[0129] Specifically, using multiple first constant quality factors to encode the first video set respectively to obtain a bitrate-quality curve may specifically include:

[0130] Encoding the first video set respectively using each of the first constant quality factors to obtain third data points respectively corresponding to each of the first constant quality factors, where the third data points are used to reflect the average bitrate and average image quality of the encoded first video set.

[0131] Drawing the bitrate-quality curve based on each of the third data points.

[0132] In the embodiments of this specification, for each first constant quality factor, each video in the first video set can be encoded using the first constant quality factor to obtain the encoded bitrate and picture quality of each video in the first video set; specifically, when the first constant quality factor is 7, 8, 9, 10, or 11, each video in the first video set can be encoded using 7, 8, 9, 10, and 11 respectively to obtain the encoded bitrate and picture quality of each video when the first constant quality factor is 7, the encoded bitrate and picture quality of each video when the first constant quality factor is 8, and the encoded bitrate and picture quality of each video when the first constant quality factors are 9, 10, and 11 respectively.

[0133] After obtaining the encoded bitrate and picture quality of each of the above videos, the average value of the encoded bitrates of each video obtained when encoding using the specified first constant quality factor can be calculated to obtain the average encoded bitrate of the first video set corresponding to the specified first constant quality factor; and the average value of the encoded picture qualities of each video obtained when encoding using the specified first constant quality factor can be calculated to obtain the average encoded picture quality of the first video set corresponding to the specified first constant quality factor.

[0134] Specifically, the average value of the encoded bitrates of each video obtained when the first constant quality factor is 7 can be calculated to obtain the average bitrate of the first video set when the first constant quality factor is 7; and the average value of the encoded picture qualities of each video obtained when the first constant quality factor is 7 can be calculated to obtain the average picture quality of the first video set when the first constant quality factor is 7; according to the above method, the average bitrate and average picture quality of the first video set when the first constant quality factors are 8, 9, 10, and 11 can be obtained respectively, which will not be elaborated here.

[0135] In the embodiments of this specification, the third data point can be a data point representing the average encoded bitrate and average picture quality of the first video set; it can be understood that the number of third data points is the same as the number of first constant quality factors. Based on the third data points, a bitrate-picture quality curve can be plotted in the bitrate-picture quality coordinate system.

[0136] To facilitate the understanding of this application, in the embodiments of this specification, the specific content of encoding the first video set using the second constant quality factor and multiple groups of preset bitrates to obtain the encoding results is also provided.

[0137] Specifically, encoding the first video set using the second constant quality factor and multiple groups of preset bitrates to obtain the encoding results can specifically include:

[0138] For a set of preset bitrate pairs among the multiple sets of preset bitrate pairs, each video in the first video set is encoded by using the second constant quality factor and the set of preset bitrate pairs to obtain the encoded bitrate and encoded image quality of each video corresponding to the set of preset bitrate pairs.

[0139] In the embodiments of this specification, multiple sets of preset bitrate pairs can be as shown in Table 1.

[0140] Table 1:

[0141]

[0142] In the embodiments of this specification, each video in the first video set can be encoded by using the second constant quality factor and a set of preset bitrate pairs to obtain the encoded bitrate and image quality of each video in the first video set; for example, each video in the first video set can be encoded by using CRF = 9, the upper limit of the preset bitrate value = 3000 kbps, and the lower limit of the preset bitrate value = 500 kbps, so as to obtain a set of encoded data including the encoded bitrate and image quality of each video when CRF = 9, the upper limit of the preset bitrate value = 3000 kbps, and the lower limit of the preset bitrate value = 500 kbps.

[0143] It can be understood that each video in the first video set can be encoded by using the second constant quality factor and each set of preset bitrate pairs according to the method described above, so as to obtain multiple sets of encoded data respectively corresponding to each set of preset bitrate pairs, and then the encoding result can be obtained.

[0144] To facilitate the understanding of this application, in the embodiments of this specification, the specific content of obtaining multiple first data points in the bitrate-image quality coordinate system according to the encoding result is also provided.

[0145] Specifically, obtaining multiple first data points in the bitrate-image quality coordinate system according to the encoding result may specifically include:

[0146] Determine the average bitrate of the first video set encoded based on the second constant quality factor and the set of preset bitrate pairs according to the encoded bitrate of each video.

[0147] Determine the average image quality of the first video set encoded based on the second constant quality factor and the set of preset bitrate pairs according to the encoded image quality of each video.

[0148] Determine the first data point corresponding to the second constant quality factor and the set of preset bitrate pairs based on the average image quality and the average bitrate.

[0149] In practical applications, in the above-mentioned obtained encoding results, according to the bitrates of each video in one set of encoded first video sets, an average bitrate of the first video set can be determined; according to the image qualities of each video in one set of encoded first video sets, an average image quality of the first video set can be determined, so that a first data point representing the average bitrate and average image quality of the encoded first video set can be marked on the bitrate-image quality curve; it can be understood that according to the bitrates and image qualities of each video in multiple sets of encoded first video sets, multiple average bitrates and average image qualities of the encoded first video set can be determined, and further multiple first data points representing the average bitrate and average image quality of the encoded first video set can be marked on the bitrate-image quality curve.

[0150] To facilitate the understanding of the present application, in the embodiments of this specification, the specific content of encoding the target video according to the upper limit of the bitrate value and the lower limit of the bitrate value is also provided during the encoding process of the target video.

[0151] Specifically, the encoding of the target video according to the upper limit of the bitrate value and the lower limit of the bitrate value may specifically include:

[0152] If the bitrate value of the target video is greater than the upper limit of the bitrate value, then encode the target video according to the upper limit of the bitrate value.

[0153] If the bitrate value of the target video is less than the lower limit of the bitrate value, then encode the target video according to the lower limit of the bitrate value.

[0154] If the bitrate value of the target video is less than the upper limit of the bitrate value and greater than the lower limit of the bitrate value, then encode the target video according to the bitrate value of the target video.

[0155] In the embodiments of this specification, the bitrate value of the target video may be the real-time bitrate of the target video obtained based on setting a constant quality factor during the encoding process of the target video. If the bitrate value of the target video is greater than the upper limit of the bitrate value, then the target video can be encoded according to the upper limit of the bitrate value. If the bitrate value of the target video is less than the lower limit of the bitrate value, then the target video can be encoded according to the lower limit of the bitrate value, thereby effectively controlling the bitrate and image quality of the target video.

[0156] Of course, if the bitrate value of the target video is between the upper limit of the bitrate value and the lower limit of the bitrate value, then the target video can be directly encoded according to the bitrate value of the target video.

[0157] In the embodiments of this specification, a video usually may include multiple different target scene categories. When the scene of a video frame changes, the scene category of the video usually also changes. Therefore, in order to ensure the overall picture quality of the video and effectively reduce the overall bit rate of the video, after obtaining the video to be encoded, the embodiments of this specification also split the video to be encoded according to the scene of the video frame.

[0158] Specifically, before obtaining the target video, it further includes: obtaining the video to be encoded; for the video to be encoded, starting from the first frame image, determining whether the scene of the subsequent frame image is the same as the scene of the previous frame image, and obtaining a first determination result; if the first determination result indicates that the scene of the Nth frame image of the video to be encoded is different from the scene of the (N - 1)th frame image, then determining the first frame image to the (N - 1)th frame image of the video to be encoded as the sub-video to be encoded.

[0159] To improve the efficiency of scene determination, the video to be encoded can also be divided into video sequences containing a preset number of frames, so as to perform scene determination for each video frame sequence simultaneously.

[0160] Specifically, before starting from the first frame image to determine whether the scene of the subsequent frame image is the same as the scene of the previous frame image and obtaining a first determination result, it can further include:

[0161] For the video to be encoded, perform frame sequence division according to the preset number of frames to obtain video frame sequences including the preset number of frames.

[0162] The step of starting from the first frame image to determine whether the scene of the subsequent frame image is the same as the scene of the previous frame image and obtaining a first determination result can specifically include:

[0163] For each video frame sequence including the preset number of frames, starting from the first frame image, determine whether the scene of the subsequent frame image is the same as the scene of the previous frame image, and obtain a first determination result.

[0164] In the embodiments of this specification, the target video can be a sub-video to be encoded or multiple sub-videos to be encoded. It can be understood that the scene categories of the video frame images in any of the sub-videos to be encoded are the same.

[0165] In the embodiments of this specification, the preset number of frames can be 256 frames. Of course, the preset number of frames can also be other values set according to actual needs, and no specific limitation is made here.

[0166] In the embodiments of this specification, image recognition technology can be used to determine whether the scene of the subsequent frame image is the same as that of the previous frame image. Specifically, it can be determined whether the scene of the subsequent frame image is the same as that of the previous frame image according to the similarity between the subsequent frame image and the previous frame image. If the similarity between the subsequent frame image and the previous frame image is greater than the preset value, it can be considered that the scene of the subsequent frame image is the same as that of the previous frame image. If the similarity between the subsequent frame image and the previous frame image is less than the preset value, it can be considered that the scene of the subsequent frame image has changed compared with that of the previous frame image. Then, video frames of the same scene can be determined as a sub-video to be encoded.

[0167] In the embodiments of this specification, when the scene of a video frame image changes, the target scene category of the video frame image may change. When the scene of a video frame image does not change, the target scene category of the video frame image generally does not change either. Therefore, video frame images of the same scene can be used as a sub-video to be encoded, and when it is determined that the scene of a video frame image has changed, the target scene category to which the video frame image belongs can be re-determined, so as to effectively reduce the overall bit rate of the video while ensuring the overall picture quality of the video.

[0168] In the embodiments of this specification, when the target video includes only one sub-video to be encoded, determining the target scene category to which the target video belongs may specifically include: determining the target scene category to which the sub-video to be encoded belongs. When the target video includes multiple sub-videos to be encoded, determining the target scene category to which the target video belongs may specifically include: respectively determining the target scene categories to which the respective sub-videos to be encoded belong. It can be understood that when the target video includes multiple sub-videos to be encoded, for encoding the target video according to the upper limit value and the lower limit value of the bit rate, specifically, it can be: respectively using the upper limit value and the lower limit value of the bit rate associated with the target scene category to which each sub-video to be encoded belongs, and encoding each sub-video to be encoded.

[0169] In the embodiments of this specification, based on the same idea as the Figure 2 scheme shown in, the embodiments of this specification also provide another video bit rate control method. Figure 5 It is a schematic flowchart of another video bit rate control method provided by the embodiments of this specification. As Figure 5 shown, this process may include the following steps.

[0170] Step 502: Obtain a target video frame sequence.

[0171] In the embodiments of this specification, the target video frame sequence may be a set of video frame sequences with the same scene and continuous video frames in the video to be encoded in the video library.

[0172] Since the video frames in the video to be encoded may undergo scene transitions, that is, the scene of the subsequent frame image may be different from that of the previous frame image. For example, the scene of the video frame may change from indoor to outdoor. When the scene of the video frame changes, the scene category of the video is very likely to change; while when the scene of the video frame remains unchanged, the scene category of the video usually remains unchanged. Therefore, for the video frames in the video to be encoded, it is possible to first determine whether the scene of the video frame has changed, and group a set of video frames with the same scene and consecutive video frames as a target video frame sequence. It can be understood that the video to be encoded can be divided into multiple target video frame sequences.

[0173] Since the method for determining whether the scene of the video frame has changed is basically the same as the method described above for determining whether the scene of the subsequent frame image is consistent with that of the previous frame image starting from the first frame image, it will not be elaborated here.

[0174] Step 504: Determine the target scene category to which the target video frame sequence belongs.

[0175] In the embodiments of this specification, the target video frame sequence may include category labels in multiple dimensions. Since the category labels have been elaborated in Figure 2 Step 204, it will not be elaborated here.

[0176] In the embodiments of this specification, the target scene category in Step 504 and Figure 2 the target scene category mentioned in Step 204 may be the same. At the same time, the method for determining the target scene category to which the video to be encoded belongs in Step 504 is basically the same as Figure 2 the method for determining the target scene to which the target video belongs in Step 204, and it will not be elaborated here.

[0177] Step 506: Determine the upper limit and lower limit of the bitrate value for encoding the target video frame sequence according to the target scene category to which the target video frame sequence belongs; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode.

[0178] In the embodiments of this specification, the upper limit of the bitrate value in Step 506 and Figure 2 the upper limit of the bitrate value mentioned in Step 206 may be the same; it can be understood that the sameness here refers to the meaning and determination method of the upper limit of the bitrate value, rather than the specific value of the upper limit of the bitrate value. At the same time, the method for determining the upper limit of the bitrate value for encoding the target video frame sequence in Step 506 may be basically the same as the method for determining the upper limit of the bitrate value for encoding the target video in Step 206, and it will not be elaborated here.

[0179] In the embodiments of this specification, the lower limit of the bitrate value in Step 506 and Figure 2The lower limit of the bitrate value mentioned in step 208 can be the same; it can be understood that the sameness here refers to the meaning and determination method of the lower limit of the bitrate value, rather than the specific value of the lower limit of the bitrate value. At the same time, the method for determining the lower limit of the bitrate value for encoding the target video frame sequence in step 506 can be basically the same as the method for determining the lower limit of the bitrate value for encoding the target video in step 206, which will not be elaborated here.

[0180] Step 508: Encode the target video frame sequence according to the upper limit of the bitrate value and the lower limit of the bitrate value.

[0181] In the embodiments of this specification, the method for encoding the target video frame sequence by using the upper limit of the bitrate value and the lower limit of the bitrate value corresponding to the target video frame sequence can be basically the same as the method for encoding the target video according to the upper limit of the bitrate value and the lower limit of the bitrate value in the foregoing, which will not be elaborated here.

[0182] Step 510: Determine whether the target video frame sequence in the video to be encoded is encoded completely. If not, return to step 502. If it is encoded completely, end the encoding process for the video to be encoded.

[0183] Specifically, in the embodiments of this specification, when it is determined that multiple target video frame sequences in a video to be encoded are not encoded completely, the next target video frame sequence can be obtained after one target video frame sequence is encoded completely, and then encoded in the same way until all the target video frame sequences in the video to be encoded are encoded completely.

[0184] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 6 For the embodiments of this specification, it is provided a Figure 2 structural schematic diagram of a video bitrate control device corresponding to Figure 6 As shown in

[0185] The first acquisition module 602 is configured to acquire a target video.

[0186] The first determination module 604 is configured to determine the target scene category to which the target video belongs.

[0187] The second determination module 606 is configured to determine the upper limit of the bitrate value for encoding the target video according to the target scene category to which the target video belongs; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode.

[0188] The third determination module 608 is configured to determine the lower limit of the bitrate value for encoding the target video according to the target scene category to which the target video belongs.

[0189] An encoding module 610, configured to perform encoding on the target video according to the upper limit and the lower limit of the bitrate value.

[0190] Based on Figure 6 For the device of, embodiments of this specification also provide some specific implementation solutions of the device, which will be described below.

[0191] Optionally, Figure 6 The device described in may further include:

[0192] A second acquisition module, configured to acquire a video set of a preset scene category.

[0193] A fourth determination module, configured to determine an upper limit and a lower limit of a bitrate value for encoding the video of the preset scene category based on the video set of the preset scene category.

[0194] Optionally, the fourth determination module may specifically include:

[0195] A first acquisition unit, configured to acquire a first video set of a first preset scene category.

[0196] A first encoding unit, configured to perform encoding on the first video set respectively by using a plurality of first constant quality factors to obtain a bitrate-quality curve.

[0197] A second acquisition unit, configured to acquire a preset second constant quality factor.

[0198] A second encoding unit, configured to perform encoding on the first video set by using the second constant quality factor and multiple groups of preset bitrates to obtain an encoding result; any one of the preset bitrate pairs includes a preset upper limit of a bitrate value and a preset lower limit of a bitrate value.

[0199] A data point processing unit, configured to obtain a plurality of first data points in a bitrate-quality coordinate system according to the encoding result; the bitrate-quality coordinate system is the coordinate system where the bitrate-quality curve is located.

[0200] A bitrate value determination unit, configured to determine an upper limit and a lower limit of the bitrate value of the first preset scene category according to the positional relationship between the plurality of first data points and the bitrate-quality curve.

[0201] Optionally, the bitrate value determination unit may specifically be used for:

[0202] If the positional relationship indicates the existence of second data points among the multiple first data points, calculate the distances from each of the second data points to the bitrate-quality curve; the second data points are data points whose quality coordinates are greater than the quality coordinates of a specific point on the bitrate-quality curve, and the bitrate coordinate of the specific point is the same as the bitrate coordinate of the second data point.

[0203] Determine the upper limit of the bitrate value in the preset bitrate pair corresponding to the second data point with the largest distance as the upper limit of the bitrate value for the first preset scene category.

[0204] Determine the lower limit of the bitrate value in the preset bitrate pair corresponding to the second data point with the largest distance as the lower limit of the bitrate value for the first preset scene category.

[0205] Optionally, Figure 6 the device described in

[0206] A fifth determination module, configured to determine the first preset scene category as the target scene category;

[0207] An association module, configured to store the target scene category in association with the upper limit and the lower limit of the bitrate value.

[0208] Optionally, the bitrate value determination unit may further be configured to:

[0209] If the positional relationship indicates the non-existence of second data points among the multiple first data points, screen a second video set of a second preset scene category from the first video set of the first preset scene category; the second data points are data points whose quality coordinates are greater than the quality coordinates of a specific point on the bitrate-quality curve, and the bitrate coordinate of the specific point is the same as the bitrate coordinate of the second data point.

[0210] Determine the upper limit and the lower limit of the bitrate value of the second preset scene category under the first preset scene category based on the second video set.

[0211] Optionally, the first encoding unit may specifically be configured to:

[0212] Encode the first video set respectively using each of the first constant quality factors to obtain third data points respectively corresponding to each of the first constant quality factors, where the third data points are used to reflect the average bitrate and the average quality of the encoded first video set.

[0213] Draw the bitrate-quality curve based on each of the third data points.

[0214] Optionally, the second encoding unit may specifically be configured to:

[0215] For a set of preset bitrate pairs among the multiple sets of preset bitrate pairs, use the second constant quality factor and the set of preset bitrate pairs to encode each video in the first video set, and obtain the encoded bitrate and encoded video quality of each video corresponding to the set of preset bitrate pairs.

[0216] Optionally, the data point processing unit may specifically be configured to:

[0217] Determine the average bitrate of the first video set encoded based on the second constant quality factor and the set of preset bitrate pairs according to the encoded bitrates of the respective videos.

[0218] Determine the average video quality of the first video set encoded based on the second constant quality factor and the set of preset bitrate pairs according to the encoded video qualities of the respective videos.

[0219] Determine a first data point corresponding to the second constant quality factor and the set of preset bitrate pairs based on the average video quality and the average bitrate.

[0220] Optionally, the encoding module 610 may specifically be configured to:

[0221] If the bitrate value of the target video is greater than the upper limit of the bitrate value, encode the target video according to the upper limit of the bitrate value.

[0222] If the bitrate value of the target video is less than the lower limit of the bitrate value, encode the target video according to the lower limit of the bitrate value.

[0223] If the bitrate value of the target video is less than the upper limit of the bitrate value and greater than the lower limit of the bitrate value, encode the target video according to the bitrate value of the target video.

[0224] Figure 7 This is a schematic structural diagram of a video bitrate control device provided in an embodiment of this specification corresponding to Figure 2 . As Figure 7 shown, the device 700 may include:

[0225] At least one processor 710; and,

[0226] A memory 730 communicatively connected to the at least one processor; wherein,

[0227] The memory 730 stores instructions 720 executable by the at least one processor 710, and when the instructions are executed by the at least one processor 710, the at least one processor 710 is enabled to:

[0228] Obtain a target video;

[0229] Determine the target scene category to which the target video belongs.

[0230] According to the target scene category to which the target video belongs, determine the upper limit of the bitrate value for encoding the target video; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode.

[0231] According to the target scene category to which the target video belongs, determine the lower limit of the bitrate value for encoding the target video.

[0232] According to the upper limit of the bitrate value and the lower limit of the bitrate value, encode the target video.

[0233] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0234] Each embodiment in this specification is described in a progressive manner. For the parts that are the same or similar among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for Figure 7 the device shown, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, reference can be made to the partial description of the method embodiment.

[0235] In the 1990s, it was obvious to distinguish whether an improvement to a technology was an improvement in hardware (e.g., improvement to the circuit structures of diodes, transistors, switches, etc.) or an improvement in software (improvement to the method flow). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. The designer programs by himself to "integrate" a digital system on a piece of PLD, without having to ask the chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development writing, and the original code before compilation also has to be written in a specific programming language, which is called a hardware description language (HDL), and there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be clear that as long as the method flow is slightly logically programmed with the above-mentioned several hardware description languages and programmed into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.

[0236] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or the structures within the hardware component.

[0237] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0238] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0239] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0240] The present invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each flow and / or block in the flowchart illustrations and / or block diagrams, and combinations of flows and / or blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus create means for implementing the functions specified in the flowchart Figure 1 one flow or more flows and / or blocks Figure 1 one block or more blocks

[0241] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means that implement the functions specified in the flowchart Figure 1 one flow or more flows and / or blocks Figure 1 one block or more blocks

[0242] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart Figure 1 one flow or more flows and / or blocks Figure 1 one block or more blocks

[0243] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0244] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.

[0245] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0246] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0247] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0248] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0249] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various modifications and changes can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. A video bitrate control method, comprising: Obtaining a target video; Determining a target scene category to which the target video belongs; Determining an upper limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs; The upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode; Determining a lower limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs; the upper limit of the bitrate value and the lower limit of the bitrate are determined based on the positional relationship between a plurality of data points in a bitrate-picture quality coordinate system and a bitrate-picture quality curve; The bitrate-picture quality curve is obtained by encoding a video set of the target scene category respectively using a plurality of first constant quality factors; the plurality of data points are obtained based on the encoding results of encoding the video set of the target scene category using a second constant quality factor and multiple groups of preset bitrates; Encoding the target video according to the upper limit of the bitrate value and the lower limit of the bitrate value.

2. The method according to claim 1, before determining the target scene category to which the target video belongs, further comprising: Obtaining a video set of preset scene categories; Based on the video set of the preset scene categories, determining an upper limit of a bitrate value and a lower limit of a bitrate value for encoding the video of the preset scene categories.

3. The method according to claim 2, the determining an upper limit of a bitrate value and a lower limit of a bitrate value for encoding the video of the preset scene categories based on the video set of the preset scene categories specifically comprises: Obtaining a first video set of a first preset scene category; Encoding the first video set respectively using a plurality of first constant quality factors to obtain a bitrate-picture quality curve; Obtaining a preset second constant quality factor; Encoding the first video set using the second constant quality factor and multiple groups of preset bitrates to obtain encoding results; Any one of the preset bitrate pairs includes a preset upper limit of a bitrate value and a preset lower limit of a bitrate value; Based on the encoding results, obtaining a plurality of first data points in a bitrate-picture quality coordinate system; the bitrate-picture quality coordinate system is the coordinate system where the bitrate-picture quality curve is located; Determining an upper limit of a bitrate value and a lower limit of a bitrate value of the first preset scene category according to the positional relationship between the plurality of first data points and the bitrate-picture quality curve.

4. The method according to claim 3, the determining an upper limit of a bitrate value and a lower limit of a bitrate value of the first preset scene category according to the positional relationship between the plurality of first data points and the bitrate-picture quality curve specifically comprises: If the positional relationship indicates that there are second data points among the plurality of first data points, calculating the distances from each of the second data points to the bitrate-picture quality curve; The second data point is a data point whose picture quality coordinate is greater than the picture quality coordinate of a specific point in the bitrate-picture quality curve, and the bitrate coordinate of the specific point is the same as the bitrate coordinate of the second data point; Determine the upper limit of the code rate value in the preset code rate pair corresponding to the second data point with the largest distance as the upper limit of the code rate value for the first preset scenario category; Determine the lower limit of the code rate value in the preset code rate pair corresponding to the second data point with the largest distance as the lower limit of the code rate value for the first preset scenario category.

5. The method according to claim 3, after determining the upper limit and the lower limit of the code rate value for the first preset scenario category, further comprising: Determine that the first scenario category is the target scenario category; Associate and store the target scenario category with the upper limit and the lower limit of the code rate value.

6. The method according to claim 3, when determining the upper limit and the lower limit of the code rate value for the first preset scenario category according to the positional relationship between the multiple first data points and the code rate-quality curve, further comprising: If the positional relationship indicates that there is no second data point among the multiple first data points, screen the second video set of the second scenario category from the first video set of the first scenario category; the second data point is a data point whose picture quality coordinate is greater than the picture quality coordinate of a specific point in the code rate-quality curve, and the code rate coordinate of the specific point is the same as the code rate coordinate of the second data point; Determine the upper limit and the lower limit of the code rate value of the second scenario category under the first scenario category based on the second video set.

7. The method according to claim 3, when using multiple first constant quality factors to encode the first video set respectively to obtain a code rate-quality curve, specifically comprising: Encode the first video set respectively using each of the first constant quality factors to obtain third data points respectively corresponding to each of the first constant quality factors, and the third data points are used to reflect the average code rate and the average picture quality of the encoded first video set; Draw the code rate-quality curve based on each of the third data points.

8. The method according to claim 3, when using the second constant quality factor and multiple groups of preset code rate pairs to encode the first video set to obtain an encoding result, specifically comprising: For a group of preset code rate pairs in the multiple groups of preset code rate pairs, use the second constant quality factor and the group of preset code rate pairs to encode each video in the first video set to obtain the encoding code rate and the encoding picture quality of each video corresponding to the group of preset code rate pairs.

9. The method according to claim 8, when obtaining multiple first data points in the code rate-quality coordinate system according to the encoding result, specifically comprising: Determine the average code rate of the first video set encoded based on the second constant quality factor and the group of preset code rate pairs according to the encoding code rate of each video; Determine the average picture quality of the first video set encoded based on the second constant quality factor and the group of preset code rate pairs according to the encoding picture quality of each video; Determine the first data point corresponding to the second constant quality factor and the group of preset code rate pairs based on the average picture quality and the average code rate.

10. The method according to claim 1, wherein encoding the target video according to the upper limit and the lower limit of the bitrate value specifically includes: If the bitrate value of the target video is greater than the upper limit of the bitrate value, encoding the target video according to the upper limit of the bitrate value; If the bitrate value of the target video is less than the lower limit of the bitrate value, encoding the target video according to the lower limit of the bitrate value; If the bitrate value of the target video is less than the upper limit of the bitrate value and greater than the lower limit of the bitrate value, encoding the target video according to the bitrate value of the target video.

11. A video bitrate control device, comprising: A first acquisition module, configured to acquire a target video; A first determination module, configured to determine a target scene category to which the target video belongs; A second determination module, configured to determine an upper limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs; The upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode; A third determination module, configured to determine a lower limit of a bitrate value for encoding the target video according to the target scene category to which the target video belongs; The upper limit of the bitrate value and the lower limit of the bitrate are determined based on the positional relationship between a plurality of data points in the bitrate-picture quality coordinate system and the bitrate-picture quality curve; The bitrate-picture quality curve is obtained by encoding a video set of the target scene category respectively using a plurality of first constant quality factors; the plurality of data points are obtained according to the encoding results obtained by encoding the video set of the target scene category using a second constant quality factor and multiple groups of preset bitrates; An encoding module, configured to encode the target video according to the upper limit and the lower limit of the bitrate value.

12. The device according to claim 11, wherein the device further comprises: A second acquisition module, configured to acquire a video set of a preset scene category; A fourth determination module, configured to determine an upper limit and a lower limit of a bitrate value for encoding the video of the preset scene category based on the video set of the preset scene category.

13. The device according to claim 12, wherein the fourth determination module specifically comprises: A first acquisition unit, configured to acquire a first video set of a first preset scene category; A first encoding unit, configured to encode the first video set respectively using a plurality of first constant quality factors to obtain a bitrate-picture quality curve; A second acquisition unit, configured to acquire a preset second constant quality factor; A second encoding unit, configured to encode the first video set using the second constant quality factor and multiple groups of preset bitrates to obtain an encoding result; Any one of the preset bitrate pairs includes a preset upper limit of the bitrate value and a preset lower limit of the bitrate value; A data point processing unit, configured to obtain a plurality of first data points in the bitrate-picture quality coordinate system according to the encoding result; the bitrate-picture quality coordinate system is the coordinate system where the bitrate-picture quality curve is located; A bitrate value determination unit, configured to determine an upper limit and a lower limit of the bitrate value of the first preset scene category according to the positional relationship between the multiple first data points and the bitrate-picture quality curve.

14. A video bitrate control device, comprising: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to: Obtain a target video; Determine the target scene category to which the target video belongs; Determine an upper limit of the bitrate value for encoding the target video according to the target scene category to which the target video belongs; the upper limit of the bitrate value is less than the maximum bitrate determined according to the transmission bandwidth value in the CRF bitrate control mode; Determine a lower limit of the bitrate value for encoding the target video according to the target scene category to which the target video belongs; the upper limit of the bitrate value and the lower limit of the bitrate are determined based on the positional relationship between multiple data points in the bitrate-picture quality coordinate system and the bitrate-picture quality curve; the bitrate-picture quality curve is obtained by encoding a video set of the target scene category using multiple first constant quality factors respectively; the multiple data points are obtained according to the encoding results obtained by encoding the video set of the target scene category using a second constant quality factor and multiple groups of preset bitrates; Encode the target video according to the upper limit and the lower limit of the bitrate value.

Citation Information

Patent Citations

  • Self-adaptive video coding method based on scene

    CN110545418A

  • Video data transmission control method and device, equipment and storage medium

    CN116962844A

  • Video coding method and device, equipment and storage medium

    CN117528084A