Video bitrate calculation method and system

By calculating the mapping frame rate and code rate of the target video in the stream pulling scene, the problem of determining the bit rate caused by the unfixed resolution of the target video is solved, and the effect of non-linear reduction of the bit rate is achieved to ensure the video quality.

WO2025123984A1PCT designated stage expired Publication Date: 2025-06-19ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/128640
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-14
Filing Date
2024-10-30
Publication Date
2025-06-19

AI Technical Summary

Technical Problem

In the stream pulling scene, since the resolution of the target video is not fixed, it is difficult to determine the video bit rate based on the resolution through a single mapping method, making it difficult to ensure the video quality.

Method used

By obtaining the frame rates of the source video and the target video, calculate the mapped frame rate of the target video, and calculate the code rate of the target video based on the mapped frame rate and the frame rate and code rate of the source video. This method calculates the bit rate in the frame rate dimension, avoiding the video quality decline caused by linear decrease.

Benefits of technology

It realizes the slow reduction of the code rate in a nonlinear positive correlation method based on the source video code rate, avoiding poor video quality caused by insufficient code rate, and ensuring the production quality of the target video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024128640_19062025_PF_FP_ABST
    Figure CN2024128640_19062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present description are a video bitrate calculation method and system. The method comprises: acquiring a frame rate and a bitrate of a source video, and acquiring a frame rate of a target video; on the basis of the frame rate of the source video and the frame rate of the target video, obtaining a mapping frame rate of the target video by means of calculation; and on the basis of the mapping frame rate of the target video and the frame rate and bitrate of the source video, obtaining a first bitrate of the target video by means of calculation. The system comprises: a frame rate and bitrate acquisition module, which is used for acquiring a frame rate and a bitrate of a source video, and acquiring a frame rate of a target video; a mapping frame rate calculation module, which is used for obtaining, on the basis of the frame rate of the source video and the frame rate of the target video, a mapping frame rate of the target video by means of calculation; and a first bitrate calculation module, which is used for obtaining, on the basis of the mapping frame rate of the target video and the frame rate and bitrate of the source video, a first bitrate of the target video by means of calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Video bit rate calculation method and system Technical Field

[0001] The embodiments of this specification mainly relate to the field of video processing technology, and specifically to a method and system for calculating a video bit rate. Background Art

[0002] Bitrate refers to the number of bits transmitted per second in digital audio or video. It represents the data transmission rate of an audio or video file and is usually expressed in bits per second (bps). Video production requires ensuring clarity, and bitrate is crucial for this. Before producing a video, you must first determine the bitrate based on the video's resolution.

[0003] For streaming scenarios (directly recording video), only a few fixed resolutions are usually used. For example, the resolution is 320x240 pixels, or 640x360 pixels, or 854x480 pixels, or 1280x720 pixels, or 1920x1080 pixels, or 3840x2160 pixels. Therefore, when determining the bit rate, it is usually only necessary to obtain a fixed bit rate based on the resolution mapping (the bit rate corresponding to a certain resolution has been determined in advance). For example, when the resolution is 1280x720 pixels, the corresponding bit rate is 2Mbps; when the resolution is 1920x1080 pixels, the corresponding bit rate is 6Mbps.

[0004] However, in streaming scenarios (producing a target video based on a source video), the target video resolution is not fixed but can be arbitrary. For example, the resolution can be 888x666 pixels, 777x555 pixels, 333x222 pixels, and so on. The bitrates corresponding to these resolutions cannot be determined in advance, making it difficult to determine the bitrate based on resolution through a single mapping method.

[0005] Summary of the Invention

[0006] In a first aspect, an embodiment of the present specification provides a method for calculating a video bit rate, including: obtaining a frame rate and a bit rate of a source video, and obtaining a frame rate of a target video; calculating a mapping frame rate of the target video based on the frame rate of the source video and the frame rate of the target video; and calculating a first bit rate of the target video based on the mapping frame rate of the target video and the frame rate and bit rate of the source video.

[0007] In a second aspect, an embodiment of the present specification provides a video bit rate calculation system, including: a frame rate and bit rate acquisition module, used to obtain the frame rate and bit rate of a source video, and to obtain the frame rate of a target video; a mapping frame rate calculation module, used to calculate the mapping frame rate of the target video based on the frame rate of the source video and the frame rate of the target video; a first bit rate calculation module, used to calculate the first bit rate of the target video based on the mapping frame rate of the target video and the frame rate and bit rate of the source video.

[0008] In a third aspect, an embodiment of this specification provides an electronic device, comprising: a memory for storing a program; and a processor for running the program stored in the memory to execute the video bit rate calculation method of the first aspect.

[0009] In a fourth aspect, an embodiment of this specification provides a computer-readable storage medium having computer program instructions stored thereon, which implement the video bit rate calculation method of the first aspect when the computer program instructions are executed by a processor.

[0010] The video bit rate calculation method and system of the embodiments of this specification calculate the bit rate of the target video in the frame rate dimension. When calculating the bit rate of the target video, the corresponding target video mapping frame rate is first calculated through the target video frame rate, and then the required target video bit rate is calculated through the target video mapping frame rate. The bit rate calculated in this way is not significantly reduced in a linear manner based on the source video bit rate, but is slowly reduced in a nonlinear positive correlation manner based on the source video bit rate. This can avoid the poor quality of the target video produced due to insufficient calculated bit rate.

[0011] Further or more detailed beneficial effects will be described in conjunction with specific examples in the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0013] FIG1 is a flow chart of a method for calculating a video bit rate provided in Example 1 of this specification.

[0014] FIG2 is a schematic diagram of a low-level frame rate curve, a mid-level frame rate curve, a high-level frame rate curve, and a mapped frame rate curve provided in Example 1 of this specification.

[0015] FIG3 is a flow chart of a method for calculating a video bit rate provided in Example 2 of this specification.

[0016] FIG4 is a flow chart of a method for calculating a video bit rate provided in Example 3 of this specification.

[0017] FIG5 is a flow chart of a method for calculating a video bit rate provided in Example 4 of this specification.

[0018] FIG6 is a flow chart of a method for calculating a video bit rate provided in Example 5 of this specification.

[0019] FIG7 is a schematic diagram of the structure of a video bit rate calculation system provided in Example 6 of this specification.

[0020] FIG8 is a schematic diagram of the structure of a video bit rate calculation system provided in Example 7 of this specification.

[0021] FIG9 is a schematic diagram of the structure of a video bit rate calculation system provided in Example 8 of this specification.

[0022] FIG10 is a schematic diagram of the structure of a video bit rate calculation system provided in Example 9 of this specification.

[0023] FIG11 is a schematic diagram of the structure of a video bit rate calculation system provided in Example 10 of this specification.

[0024] FIG12 is a schematic diagram of the structure of the electronic device provided in Example 11 of this specification. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of this specification will be described clearly and completely below in conjunction with the drawings in the embodiments of this specification.

[0026] Throughout this specification, the claims, and the accompanying drawings, the terms "first," "second," "third," and the like are used to distinguish between different items, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may include other steps or elements inherent to the process, method, product, or apparatus.

[0027] The video bit rate calculation method of the embodiment of this specification is only for the video production pull stream scenario (producing the target video based on the source video). Before producing the video, it is necessary to first determine the resolution and frame rate of the target video (i.e., the video to be produced). After the resolution and frame rate of the target video are determined, the frame rate of the source video is considered. If the frame rate of the source video is less than or equal to the frame rate of the target video, then other methods need to be used to calculate the bit rate of the target video. Only when the frame rate of the source video is greater than the frame rate of the target video can the video bit rate calculation method of the embodiment of this specification be used.

[0028] Example 1

[0029] A method for calculating a video bit rate, as shown in FIG1 , includes steps 102 to 106 .

[0030] Step 102: Obtain the frame rate and bit rate of the source video, and obtain the frame rate of the target video.

[0031] In this example, it is assumed that the source video has a resolution of 1920*1080 pixels, a frame rate of 60 fps, and a bit rate of 6 Mbps, and the target video has a resolution of 888*666 pixels and a frame rate of 25 fps.

[0032] In this step, the frame rate and bit rate of the source video are first obtained, namely 60fps and 6Mbps, and the frame rate of the target video is obtained, namely 25fps.

[0033] Step 104 : Calculate the mapping frame rate of the target video according to the frame rate of the source video and the frame rate of the target video.

[0034] This step uses the following formula to calculate the mapping frame rate of the target video:

[0035] Among them, x1 is the frame rate of the target video, E1 is the frame rate of the source video, L1 is the low-level frame rate, M1 is the medium-level frame rate, H1 is the high-level frame rate, d is the bit rate level coefficient of the target video, and F1 is the mapped frame rate of the target video.

[0036] Combined with step 102, in this embodiment, x1 is 25fps and E1 is 60fps. d is the bit rate coefficient of the target video, and the value range of d is greater than or equal to 0 and less than or equal to 1. The bit rate coefficient d is manually set by the user based on the desired bit rate of the target video. If the user wants the bit rate of the target video to be higher, then a value greater than 0.5 can be taken, for example, the bit rate coefficient d can be taken as 0.6; if the user wants the bit rate of the target video to be lower, then a value less than 0.5 can be taken, for example, the bit rate coefficient d can be taken as 0.4; if the user does not want the bit rate of the target video to be higher or lower, then the bit rate coefficient d can be ignored and the bit rate coefficient d can be directly taken as 0.5. This embodiment assumes that the bit rate coefficient d is directly taken as 0.5.

[0037] This embodiment obtains the target video mapping frame rate F1 corresponding to the target video frame rate x1 by using formulas (1) to (4). Formula (1) is a curve formed by a straight line passing through the point (0, 0) and the point (E1, E1) and convexly extending to the upper left thereof (i.e., the low-level frame rate curve L1). Formula (2) is also a curve formed by a straight line passing through the point (0, 0) and the point (E1, E1) and convexly extending to the upper left thereof (i.e., the intermediate frame rate curve M1). The convexity of the intermediate frame rate curve M1 is greater than that of the low-level frame rate curve L1. Formula (3) is also a curve formed by a straight line passing through the point (0, 0) and the point (E1, E1) and convexly extending to the upper left thereof (i.e., the high-level frame rate curve H1). The convexity of the high-level frame rate curve H1 is greater than that of the intermediate frame rate curve M1. Formula (4) is obtained by combining formulas (1) to (3). In fact, it is also a curve formed by a straight line passing through point (0, 0) and point (E1, E1) and bulging toward the upper left (i.e., mapping frame rate curve F1). The bulging amplitude of the mapping frame rate curve F1 needs to be determined according to the value of the bit rate level coefficient d. When the value of d is 0.5, the bulging amplitude of the mapping frame rate curve F1 is the same as the bulging amplitude of the intermediate frame rate curve M1; when the value of d is less than 0.5, the bulging amplitude of the mapping frame rate curve F1 is between the bulging amplitude of the intermediate frame rate curve M1 and the bulging amplitude of the low-level frame rate curve L1; when the value of d is greater than 0.5, the bulging amplitude of the mapping frame rate curve F1 is between the bulging amplitude of the intermediate frame rate curve M1 and the bulging amplitude of the high-level frame rate curve H1.

[0038] In combination with this embodiment, when E1 is 60fps, the low-level frame rate curve L1, the intermediate frame rate curve M1 and the high-level frame rate curve H1 are determined, as shown in Figure 2. Since the value of d in this embodiment is 0.5, the mapping frame rate curve F1 coincides with the intermediate frame rate curve M1. That is, after the source video frame rate E1 and the bit rate level coefficient d are determined, formulas (1) to (4) are determined. At this time, it is only necessary to first input the target video frame rate x1 as 25fps into formula (1), and calculate L1 as 39.58fps through formula (1). Then input L1 as 39.58fps into formula (2), and calculate M1 as 53.05fps through formula (2). Then input M1 as 53.05fps into formula (3), and calculate H1 as 59.19fps through formula (3). Finally, according to the low-level frame rate L1, the medium-level frame rate M1, the high-level frame rate H1, the rate level coefficient d of the target video and formula (4), the target video mapping frame rate F1 corresponding to the target video frame rate x1 is calculated to be 53.05fps.

[0039] In this embodiment, formulas (1) to (4) for calculating the target video mapping frame rate F1 are obtained by first obtaining appropriate curves through a large number of experiments by the inventor, namely, the low-level frame rate curve L1, the intermediate frame rate curve M1, the high-level frame rate curve H1, and the mapping frame rate curve F1, and finally fitting the corresponding curves, that is, formula (1) is obtained by fitting the low-level frame rate curve L1, formula (2) is obtained by fitting the intermediate frame rate curve M1, formula (3) is obtained by fitting the high-level frame rate curve H1, and formula (4) is obtained by fitting the mapping frame rate curve F1.

[0040] Step 106: Calculate a first bit rate of the target video based on the mapped frame rate of the target video and the frame rate and bit rate of the source video.

[0041] This step uses the following formula to calculate the first bit rate of the target video:

[0042] Among them, Y1 is the first bit rate of the target video, F1 is the mapping frame rate of the target video, A1 is the bit rate of the source video, and E1 is the frame rate of the source video.

[0043] Combining steps 102 and 104, F1 is 53.05 fps, A1 is 6 Mbps, and E1 is 60 fps. In this step, Y1 is calculated using formula (5) to be 5.31 Mbps. This embodiment directly uses the first bit rate as the final bit rate to be calculated for the target video. That is, the final bit rate determined for the target video in this embodiment is 5.31 Mbps.

[0044] When calculating the first bit rate Y1, this embodiment does not directly calculate it using the source video bit rate A1, the source video frame rate E1, and the target video frame rate x1 (the bit rate calculated in this way is 2.5Mbps, and directly calculating it using the target video frame rate x1 will cause the first bit rate to be significantly reduced in a linear manner on the basis of the source video bit rate A1). Instead, the target video frame rate x1 is first mapped to a reasonable target video mapping frame rate F1, and then the first bit rate Y1 is calculated using the source video bit rate A1, the source video frame rate E1, and the target video mapping frame rate F1. The first bit rate calculated in this way slowly decreases in a nonlinear positive correlation manner on the basis of the source video bit rate A1, thereby avoiding the situation where the first bit rate of the target video is insufficient due to a significant reduction in a linear manner when the source video bit rate itself is not high (thus affecting the production quality of the target video).

[0045] This embodiment calculates the bit rate of the target video (i.e., the first bit rate of the target video) in the frame rate dimension. When calculating the first bit rate of the target video, the corresponding target video mapping frame rate is first calculated using the target video frame rate, and then the required first bit rate of the target video is calculated using the target video mapping frame rate. The first bit rate calculated in this way is not significantly reduced linearly based on the source video bit rate, but is slowly reduced in a nonlinear positive correlation based on the source video bit rate. This can avoid the poor quality of the target video produced due to insufficient calculated first bit rate. That is, the first bit rate of the target video calculated in this embodiment in the frame rate dimension results in better quality of the target video produced.

[0046] Example 2

[0047] A video bit rate calculation method, based on embodiment 1, as shown in FIG3 , further includes steps 302 to 306 .

[0048] Step 302: Obtain the resolution of the target video.

[0049] The source video has a resolution of 1920*1080 pixels, a frame rate of 60 fps, and a bit rate of 6 Mbps. The target video has a resolution of 888*666 pixels and a frame rate of 25 fps.

[0050] In this step, the resolution of the target video is first obtained, which is 888*666 pixels.

[0051] Step 304: Calculate the upper limit bit rate of the target video according to the resolution of the target video.

[0052] The upper limit bit rate of the target video is calculated using the following formula: Ymax=4*3.29*W1*G1 (6)

[0053] Among them, Ymax is the upper limit bit rate of the target video, W1 is the width value of the resolution of the target video, and G1 is the height value of the resolution of the target video.

[0054] The "4" in formula (6) is the upper limit multiplier value for the bit rate. After extensive experimental research, the inventors found that "4" is an optimal upper limit multiplier value for the bit rate. Therefore, this embodiment directly sets the upper limit multiplier value for the bit rate to "4". The "3.29" in formula (6) is a mid-range value for the pixel bit rate. After extensive experimental research, the inventors found that "3.29" is an optimal mid-range value for the pixel bit rate. Therefore, this embodiment directly sets the mid-range value for the pixel bit rate to "3.29".

[0055] In this step, the width and height of the target video resolution are determined based on the target video resolution. In this embodiment, the target video resolution is 888*666 pixels. Therefore, the width W1 and height G1 of the target video resolution are 888 and 666, respectively. Furthermore, the upper bit rate Ymax of the target video can be calculated to be 7782929 bps (i.e., 7.42 Mbps).

[0056] Step 306 : Determine a second bit rate of the target video according to the upper limit bit rate of the target video and the first bit rate of the target video.

[0057] The second bit rate of the target video is determined using the following formula:

[0058] Among them, Y2 is the second bit rate of the target video, Y1 is the first bit rate of the target video, and Ymax is the upper limit bit rate of the target video.

[0059] As can be seen from Example 1, the first bit rate Y1 of the target video is 5.31 Mbps. In this embodiment, the upper limit bit rate Ymax of the target video is 7.42 Mbps. Substituting the first bit rate Y1 of the target video and the upper limit bit rate Ymax of the target video into formula (7), since the first bit rate Y1 of the target video is less than the upper limit bit rate Ymax of the target video, it is ultimately determined that the second bit rate Y2 of the target video is equal to the first bit rate Y1 of the target video, that is, the second bit rate Y2 of the target video is 5.31 Mbps.

[0060] If the bit rate of the source video itself is seriously too large, then the first bit rate Y1 of the target video obtained by Example 1 is likely to be too large, which will cause the target video obtained in subsequent production to be too large (which will in turn have adverse effects such as the target video uploading time being too long). Therefore, this embodiment needs to limit the upper limit bit rate Ymax of the target video. Only when the first bit rate Y1 of the target video is less than the upper limit bit rate Ymax of the target video will the first bit rate Y1 of the target video continue to be used (that is, the second bit rate Y2 of the target video directly adopts the first bit rate Y1 of the target video); when the first bit rate Y1 of the target video is greater than or equal to the upper limit bit rate Ymax of the target video, the first bit rate Y1 of the target video will not continue to be used, and the upper limit bit rate Ymax of the target video will be directly used (that is, the second bit rate Y2 of the target video adopts the upper limit bit rate Ymax of the target video).

[0061] This embodiment continues to calculate the target video's bit rate (i.e., the target video's second bit rate) under the upper bit rate dimension. The upper bit rate of the target video is first calculated based on the target video's resolution, and then the second bit rate of the target video is determined based on the upper bit rate and the first bit rate of the target video. This method minimizes the amount of the second bit rate calculated, which in turn minimizes the size of the target video produced (avoiding issues such as long upload times for the target video), indirectly improving the quality of the target video. Specifically, this embodiment calculates the target video's second bit rate based on the two dimensions of frame rate and upper bit rate, resulting in a higher quality target video.

[0062] Example 3:

[0063] A video bit rate calculation method, based on embodiment 2, as shown in FIG4 , further includes steps 402 to 408 .

[0064] Step 402: Obtain the resolution of the source video.

[0065] The source video has a resolution of 1920*1080 pixels, a frame rate of 60 fps, and a bit rate of 6 Mbps. The target video has a resolution of 888*666 pixels and a frame rate of 25 fps.

[0066] This step requires obtaining the resolution of the source video, which is 1920*1080 pixels. In addition, in Example 2, the resolution of the target video has been obtained, which is 888*666 pixels.

[0067] Step 404 : Calculate the actual resolution area ratio based on the resolution of the source video and the resolution of the target video.

[0068] The actual resolution area ratio is calculated using the following formula:

[0069] Among them, x2 is the actual resolution area ratio, W1 is the width value of the resolution of the target video, G1 is the height value of the resolution of the target video, W2 is the width value of the resolution of the source video, and G2 is the height value of the resolution of the source video.

[0070] In this step, the width value and the height value of the target video resolution are first determined by the resolution of the target video. Since the resolution of the target video in this embodiment is 888*666 pixels, the width value W1 of the target video resolution can be obtained to be 888, and the height value G1 of the target video resolution can be obtained to be 666. Then, the width value and the height value of the source video resolution are determined by the resolution of the source video. Since the resolution of the source video in this embodiment is 1920*1080 pixels, the width value W2 of the source video resolution can be obtained to be 1920, and the height value G2 of the source video resolution can be obtained to be 1080. Substituting W1 of 888, G1 of 666, W2 of 1920, and G2 of 1080 into formula (8), the actual resolution-to-area ratio x2 can be calculated to be 0.29.

[0071] Step 406 : Calculate the mapping resolution area ratio based on the actual resolution area ratio and the expected resolution area ratio.

[0072] When the actual resolution-area ratio is less than 1, the mapping resolution-area ratio is calculated using the following formula:

[0073] Among them, x2 is the actual resolution area ratio, E2 is the expected resolution area ratio, L2 is the low-level resolution area ratio, M2 is the medium-level resolution area ratio, H2 is the high-level resolution area ratio, d is the bit rate level coefficient of the target video, and F2 is the mapping resolution area ratio.

[0074] Since the frame rate of the source video is greater than that of the target video, the resolution of the source video is usually also greater than that of the target video. In addition, when there are multiple source videos to choose from, the source video with a frame rate and resolution greater than that of the target video will be preferred as the final source video. Therefore, in most cases, the actual resolution-to-area ratio will be less than 1. If the actual resolution-to-area ratio is greater than or equal to 1, the following formula is used to calculate it:

[0075] Among them, x2 is the actual resolution area ratio, and F2 is the mapping resolution area ratio.

[0076] In this embodiment, the actual resolution area ratio x2 is 0.29, which is less than 1. Therefore, the mapping resolution area ratio F2 corresponding to the actual resolution area ratio x2 is obtained using formulas (9) to (12). Similar to the principle of the frame rate curve in Example 1, formula (9) in this embodiment is a curve formed by a slanted straight line passing through points (0, 0) and (E2, E2) that bulges toward the upper left (i.e., the low-resolution area ratio curve L2). Formula (10) is also a curve formed by a slanted straight line passing through points (0, 0) and (E2, E2) that bulges toward the upper left (i.e., the intermediate resolution area ratio curve M2). The amplitude of the bulge of the intermediate resolution area ratio curve M2 is greater than that of the low-resolution area ratio curve L2. Formula (11) is also a curve formed by a slanted straight line passing through the points (0, 0) and (E2, E2) and bulging toward the upper left (i.e., the high-resolution area ratio curve H2). The bulge of the high-resolution area ratio curve H2 is greater than that of the medium-resolution area ratio curve M2. Formula (12) is obtained by combining formulas (9) to (11). In fact, it is also a curve formed by a slant straight line passing through point (0, 0) and point (E2, E2) and bulging toward the upper left thereof (i.e., mapping resolution area ratio curve F2). The bulging amplitude of the mapping resolution area ratio curve F2 needs to be determined according to the value of the bit rate level coefficient d. When the value of d is 0.5, the bulging amplitude of the mapping resolution area ratio curve F2 is the same as the bulging amplitude of the intermediate resolution area ratio curve M2; when the value of d is less than 0.5, the bulging amplitude of the mapping resolution area ratio curve F2 is between the bulging amplitude of the intermediate resolution area ratio curve M2 and the bulging amplitude of the low-resolution area ratio curve L2; when the value of d is greater than 0.5, the bulging amplitude of the mapping resolution area ratio curve F2 is between the bulging amplitude of the intermediate resolution area ratio curve M2 and the bulging amplitude of the high-resolution area ratio curve H2.

[0077] In this embodiment, the expected resolution area ratio E2 is directly set to "1". Once the value of E2 is determined, the low-level resolution area ratio curve L2, the intermediate resolution area ratio curve M2, and the high-level resolution area ratio curve H2 are determined. Since the value of d in this embodiment is 0.5, the mapped resolution area ratio curve F2 coincides with the intermediate resolution area ratio curve M2. That is, once the expected resolution area ratio E2 and the rate level coefficient d are determined, formulas (9) to (12) are determined. At this time, it is only necessary to first input the actual resolution area ratio x2 as 0.29 into formula (9), and calculate L2 as 0.50 through formula (9). Then, input L2 as 0.50 into formula (10), and calculate M2 as 0.75 through formula (10). Then, input M2 as 0.75 into formula (11), and calculate H2 as 0.94 through formula (11). Finally, according to the low-level resolution area ratio L2, the medium-level resolution area ratio M2, the high-level resolution area ratio H2, the bit rate level coefficient d of the target video and formula (12), the mapping resolution area ratio F2 corresponding to the actual resolution area ratio x2 is calculated to be 0.75.

[0078] Step 408 : Calculate a third bit rate of the target video according to the mapped resolution area ratio and the second bit rate of the target video.

[0079] The third bit rate of the target video is calculated using the following formula: Y3=F2*Y2 (13)

[0080] Among them, Y3 is the third bit rate of the target video, F2 is the mapping resolution area ratio, and Y2 is the second bit rate of the target video.

[0081] In combination with Example 2, it can be seen that the second bit rate Y2 of the target video is 5.31 Mbps. In this step, the second bit rate Y2 of the target video is 5.31 Mbps and the mapping resolution area ratio F2 is 0.75. Substituting it into formula (13), the third bit rate Y3 of the target video can be calculated to be 3.98 Mbps.

[0082] This embodiment continues to calculate the bit rate of the target video (i.e., the third bit rate of the target video) under the resolution-area ratio dimension. The resolution-area ratio is first calculated by the resolution of the target video and the resolution of the source video. The mapping resolution-area ratio is then calculated by the resolution-area ratio and the expected resolution-area ratio. Finally, the third bit rate of the target video is calculated by the mapping resolution-area ratio and the second bit rate of the target video. The third bit rate calculated in this way not only considers the frame rate and upper limit bit rate dimensions, but also the resolution-area ratio dimension, making the calculated bit rate better, and thus making the quality of the target video produced better. That is, the third bit rate of the target video calculated in this embodiment under the three dimensions of frame rate, upper limit bit rate, and resolution-area ratio makes the quality of the target video produced better.

[0083] Example 4:

[0084] A video bit rate calculation method, based on embodiment 3, as shown in FIG5 , further includes steps 502 to 504 .

[0085] Step 502: Calculate the general bit rate of the target video according to the resolution of the target video.

[0086] The general bit rate of the target video is calculated using the following formula:

[0087] Wherein, Y is the general bit rate of the target video, W1 is the wide value of the resolution of the target video, G1 is the high value of the resolution of the target video, and d is the bit rate level coefficient of the target video.

[0088] In this embodiment, the resolution of the target video is 888*666 pixels. Therefore, the width value W1 of the target video resolution is 888, and the height value G1 of the target video resolution is 666. In this embodiment, the rate level coefficient d of the target video is 0.5. Substituting the width value W1 of the target video resolution as 888, the height value G1 of the target video resolution as 666, and the rate level coefficient d of the target video as 0.5 into formula (14), the general bit rate Y of the target video can be calculated to be 2130055 bps (i.e., 2.03 Mbps).

[0089] Formula (14) in this embodiment was derived by the inventors themselves through a large amount of experimental data.

[0090] Step 504: Compare the third bit rate of the target video with the general bit rate of the target video. When the third bit rate of the target video is less than the general bit rate of the target video and the difference between the two is greater than a first preset bit rate threshold, calculate the mapping bit rate of the target video based on the third bit rate of the target video and the general bit rate of the target video, and use the mapping bit rate of the target video as the fourth bit rate of the target video. When the third bit rate of the target video is greater than the general bit rate of the target video and the difference between the two is greater than a second preset bit rate threshold, calculate the fourth bit rate of the target video based on the third bit rate of the target video. Otherwise, directly use the third bit rate of the target video as the fourth bit rate of the target video.

[0091] The mapping bit rate of the target video is calculated based on the third bit rate of the target video and the general bit rate of the target video using the following formula:

[0092] Among them, Y3 is the third bit rate of the target video, Y is the general bit rate of the target video, L3 is the low bit rate, M3 is the medium bit rate, H3 is the high bit rate, d is the bit rate level coefficient of the target video, and F3 is the mapping bit rate of the target video.

[0093] The fourth bit rate of the target video is calculated based on the third bit rate of the target video using the following formula: Y4=0.7*Y3 (19)

[0094] Among them, Y4 is the fourth bit rate of the target video, and Y3 is the third bit rate of the target video.

[0095] In this embodiment, the general bit rate Y of the target video is 2.03 Mbps (i.e., 2,130,055 bps), and the third bit rate Y3 of the target video is 3.98 Mbps (i.e., 4,173,332 bps). In addition, the first preset bit rate threshold in this embodiment can be 2,000,000 bps, and the second preset bit rate threshold can also be 2,000,000 bps.

[0096] Specifically, since the third bit rate Y3 of the target video (i.e., 4173332 bps) is greater than the general bit rate Y of the target video (i.e., 2130055 bps), and the difference between the two (i.e., 2043277 bps) is greater than the second preset bit rate threshold, it is necessary to calculate the fourth bit rate of the target video using formula (19). Substituting the third bit rate Y3 of the target video (3.98 Mbps) into formula (19), the fourth bit rate Y4 of the target video is obtained to be 2.79 Mbps.

[0097] If the third bit rate of the target video is less than the general bit rate of the target video and the difference between the two is greater than the first preset bit rate threshold, then it is necessary to calculate the mapping bit rate of the target video based on the third bit rate of the target video and the general bit rate of the target video, and then use the mapping bit rate of the target video as the fourth bit rate of the target video.

[0098] For example, if the third bitrate of a target video is 2,000,000 bps, and the corresponding general bitrate of the target video is 6,000,000 bps, and the first preset bitrate threshold is 2,500,000 bps, then the third bitrate of the target video is lower than the general bitrate of the target video, and the difference between the third bitrate and the general bitrate is higher than the first preset bitrate threshold.

[0099] At this time, first substitute the third bit rate Y3 of the target video as 2000000bps and the general bit rate Y of the target video as 6000000bps into formula (15), and the low-level bit rate L3 is calculated to be 3333333.33bps. Then substitute the low-level bit rate L3 as 3333333.33bps and the general bit rate Y of the target video as 6000000bps into formula (16), and the intermediate bit rate M3 is calculated to be 4814814.81bps. Then substitute the intermediate bit rate M3 as 4814814.81bps and the general bit rate Y of the target video as 6000000bps into formula (17), and the high-level bit rate H3 is calculated to be 5765889.35bps. Assume that the bit rate level coefficient d of the target video here is 0.6. Finally, substitute the low-level bit rate L3, the medium-level bit rate M3, the high-level bit rate H3, and the bit rate level coefficient d into formula (18) to calculate the mapping bit rate F3 of the target video to be 5005029.72 bps (i.e., 4.77 Mbps).

[0100] If the third bit rate of the target video is less than the general bit rate of the target video and the difference between the two is less than or equal to the first preset bit rate threshold, or if the third bit rate of the target video is greater than the general bit rate of the target video and the difference between the two is less than or equal to the second preset bit rate threshold, or if the third bit rate of the target video is equal to the general bit rate of the target video, then the third bit rate of the target video is directly used as the fourth bit rate of the target video.

[0101] This embodiment continues to calculate the bit rate of the target video (i.e., the fourth bit rate of the target video) under the general bit rate dimension. It first calculates the general bit rate of the target video based on the resolution of the target video, then compares the third bit rate of the target video with the general bit rate of the target video, and determines the fourth bit rate of the target video based on the comparison result. The fourth bit rate calculated in this way not only takes into account the dimensions of frame rate, upper limit bit rate, and resolution-to-area ratio, but also the general bit rate dimension. When the third bit rate of the target video differs significantly from the general bit rate of the target video, the fourth bit rate is linearly or nonlinearly approached to the general bit rate, thereby making the calculated fourth bit rate better and ultimately improving the quality of the target video produced. That is, the fourth bit rate of the target video calculated by this embodiment under the four dimensions of frame rate, upper limit bit rate, resolution-to-area ratio, and general bit rate results in a better quality target video.

[0102] Example 5:

[0103] A video bit rate calculation method, based on embodiment 4, as shown in FIG6 , further includes step 602 .

[0104] Step 602: Determine the video coding standard of the target video. When the video coding standard of the target video is HEVC, calculate the fifth bit rate of the target video based on the fourth bit rate of the target video. When the video coding standard of the target video is AVC, determine the fourth bit rate of the target video as the fifth bit rate of the target video.

[0105] Video coding standards refer to the technical specifications and algorithms used to compress and encode digital video. Common video coding standards include: AVC / H.264 (Advanced Video Coding): AVC is a mature video coding standard widely used in online video, Blu-ray Discs, broadcast television, and other fields. It offers excellent compression efficiency and is widely supported by various devices. HEVC / H.265 (High Efficiency Video Coding): HEVC is the successor to H.264, offering even higher compression efficiency and suitable for HD and UHD video. It supports higher resolutions and frame rates and is becoming the mainstream standard in streaming media and video communications.

[0106] In this embodiment, the video coding standard of the target video is first determined. When the video coding standard of the target video is HEVC, the fifth bit rate of the target video is calculated according to the following formula: Y5=0.75*Y4 (20)

[0107] Among them, Y5 is the fifth bit rate of the target video, and Y4 is the fourth bit rate of the target video.

[0108] Specifically, if in this embodiment, the video coding standard of the target video is HEVC, then the fourth bit rate Y4 of the target video is 2.79 Mbps and substituted into formula (20), and finally the fifth bit rate Y5 of the target video can be calculated to be 2.09 Mbps.

[0109] If, in this embodiment, the video coding standard of the target video is AVC, then in this embodiment, the fourth bit rate of the target video can be directly determined as the fifth bit rate of the target video, that is, the fifth bit rate Y5 of the target video is 2.79 Mbps.

[0110] Typically, the target video uses AVC as the video coding standard. If the target video uses AVC as the video coding standard, the fourth bit rate of the target video can be directly determined as the fifth bit rate of the target video. In addition, since the bit rate required by the HEVC video coding standard can be lower than the bit rate required by the AVC video coding standard under the same definition, when the target video uses HEVC as the video coding standard, the bit rate of the target video can be linearly reduced based on the fourth bit rate to obtain the fifth bit rate of the target video.

[0111] This embodiment continues to calculate the target video's bit rate (i.e., the fifth bit rate of the target video) under the video coding standard dimension. The video coding standard of the target video is first determined. If the target video's video coding standard is HEVC, the target video's bit rate can be linearly reduced based on the fourth bit rate to obtain the fifth bit rate of the target video, thereby making the target video's final bit rate more appropriate. That is, the fifth bit rate of the target video calculated in this embodiment under the five dimensions of frame rate, upper bit rate, resolution-to-area ratio, general bit rate, and video coding standard is the most appropriate for producing the target video.

[0112] Example 6:

[0113] A video bit rate calculation system employing the video bit rate calculation method of Example 1, as shown in FIG7 , includes a frame rate bit rate acquisition module 701, a mapping frame rate calculation module 702, and a first bit rate calculation module 703. The frame rate bit rate acquisition module 701 is configured to acquire the frame rate and bit rate of a source video, as well as the frame rate of a target video. The mapping frame rate calculation module 702 is configured to calculate a mapping frame rate of the target video based on the frame rate of the source video and the frame rate of the target video. The first bit rate calculation module 703 is configured to calculate a first bit rate of the target video based on the mapping frame rate of the target video and the frame rate and bit rate of the source video.

[0114] The mapping frame rate calculation module 702 uses the following formula:

[0115] Among them, x1 is the frame rate of the target video, E1 is the frame rate of the source video, L1 is the low-level frame rate, M1 is the medium-level frame rate, H1 is the high-level frame rate, d is the bit rate level coefficient of the target video, and F1 is the mapped frame rate of the target video.

[0116] The first bit rate calculation module 703 uses the following formula:

[0117] Among them, Y1 is the first bit rate of the target video, F1 is the mapping frame rate of the target video, A1 is the bit rate of the source video, and E1 is the frame rate of the source video.

[0118] Example 7:

[0119] A video bit rate calculation system employing the video bit rate calculation method of Example 2, as shown in FIG8 , further includes: a first resolution acquisition module 801, an upper limit bit rate calculation module 802, and a second bit rate calculation module 803. The first resolution acquisition module 801 is configured to acquire the resolution of a target video. The upper limit bit rate calculation module 802 is configured to calculate an upper limit bit rate for the target video based on the resolution of the target video. The second bit rate calculation module 803 is configured to determine a second bit rate for the target video based on the upper limit bit rate of the target video and the first bit rate of the target video.

[0120] The upper limit bit rate calculation module 802 uses the following formula: Ymax=4*3.29*W1*G1 (6)

[0121] Among them, Ymax is the upper limit bit rate of the target video, W1 is the width value of the resolution of the target video, and G1 is the height value of the resolution of the target video.

[0122] The second bit rate calculation module 803 uses the following formula:

[0123] Among them, Y2 is the second bit rate of the target video, Y1 is the first bit rate of the target video, and Ymax is the upper limit bit rate of the target video.

[0124] Example 8:

[0125] A video bit rate calculation system adopts the video bit rate calculation method of Example 3. As shown in Figure 9, the video bit rate calculation system of this embodiment also includes: a second resolution acquisition module 901, an actual resolution area ratio calculation module 902, a mapping resolution area ratio calculation module 903, and a third bit rate calculation module 904. The second resolution acquisition module 901 is used to obtain the resolution of the source video. The actual resolution area ratio calculation module 902 is used to calculate the actual resolution area ratio based on the resolution of the source video and the resolution of the target video. The mapping resolution area ratio calculation module 903 is used to calculate the mapping resolution area ratio based on the actual resolution area ratio and the expected resolution area ratio. The third bit rate calculation module 904 is used to calculate the third bit rate of the target video based on the mapping resolution area ratio and the second bit rate of the target video.

[0126] The actual resolution area ratio calculation module 902 uses the following formula:

[0127] Among them, x2 is the actual resolution area ratio, W1 is the width value of the resolution of the target video, G1 is the height value of the resolution of the target video, W2 is the width value of the resolution of the source video, and G2 is the height value of the resolution of the source video.

[0128] When the actual resolution-area ratio is less than 1, the mapping resolution-area ratio calculation module 903 uses the following formula:

[0129] Among them, x2 is the actual resolution area ratio, E2 is the expected resolution area ratio, L2 is the low-level resolution area ratio, M2 is the medium-level resolution area ratio, H2 is the high-level resolution area ratio, d is the bit rate level coefficient of the target video, and F2 is the mapping resolution area ratio.

[0130] When the actual resolution-area ratio is greater than or equal to 1, the mapping resolution-area ratio calculation module 903 uses the following formula:

[0131] Among them, x2 is the actual resolution area ratio, and F2 is the mapping resolution area ratio.

[0132] The third bit rate calculation module 904 uses the following formula: Y3=F2*Y2 (13)

[0133] Where Y3 is the third bit rate of the target video, F2 is the mapping resolution area ratio, and Y2 is the second bit rate of the target video.

[0134] Example 9:

[0135] A video bit rate calculation system employing the video bit rate calculation method of Example 4, as shown in FIG10 , further includes: a general bit rate calculation module 1001 and a fourth bit rate determination module 1002. The general bit rate calculation module 1001 is configured to calculate the general bit rate of the target video based on the resolution of the target video. The fourth bit rate determination module 1002 is configured to compare the third bit rate of the target video with the general bit rate of the target video. When the third bit rate of the target video is less than the general bit rate of the target video and the difference between the three is greater than a first preset bit rate threshold, the fourth bit rate of the target video is calculated based on the third bit rate of the target video and the general bit rate of the target video, and the fourth bit rate of the target video is used as the fourth bit rate of the target video. When the third bit rate of the target video is greater than the general bit rate of the target video and the difference between the three is greater than a second preset bit rate threshold, the fourth bit rate of the target video is calculated based on the third bit rate of the target video. Otherwise, the third bit rate of the target video is directly used as the fourth bit rate of the target video.

[0136] The general code rate calculation module 1001 uses the following formula:

[0137] Wherein, Y is the general bit rate of the target video, W1 is the wide value of the resolution of the target video, G1 is the high value of the resolution of the target video, and d is the bit rate level coefficient of the target video.

[0138] The fourth code rate determination module 1002 includes a mapping code rate calculation unit 10021. The mapping code rate calculation unit 10021 uses the following formula:

[0139] Among them, Y3 is the third bit rate of the target video, Y is the general bit rate of the target video, L3 is the low bit rate, M3 is the medium bit rate, H3 is the high bit rate, d is the bit rate level coefficient of the target video, and F3 is the mapping bit rate of the target video.

[0140] The fourth code rate determination module 1002 further includes a fourth code rate calculation unit 10022. The fourth code rate calculation unit 10022 uses the following formula: Y4 = 0.7 * Y3 (19)

[0141] Among them, Y4 is the fourth bit rate of the target video, and Y3 is the third bit rate of the target video.

[0142] Example 10:

[0143] A video bit rate calculation system employing the video bit rate calculation method of Example 5, as shown in FIG11 , further includes a fifth bit rate determination module 1101. The fifth bit rate determination module 1101 is configured to determine the video coding standard of a target video. When the video coding standard of the target video is HEVC, the fifth bit rate of the target video is calculated based on the fourth bit rate of the target video. When the video coding standard of the target video is AVC, the fourth bit rate of the target video is determined as the fifth bit rate of the target video.

[0144] The fifth code rate determination module 1101 includes a fifth code rate calculation unit 11011. The fifth code rate calculation unit 11011 uses the following formula: Y5 = 0.75 * Y4 (20)

[0145] Among them, Y5 is the fifth bit rate of the target video, and Y4 is the fourth bit rate of the target video.

[0146] Example 11:

[0147] An electronic device, as shown in FIG12 , includes a memory and a processor. The memory is configured to store a program. The processor is configured to execute the program stored in the memory to perform the video bit rate calculation method of Embodiment 1, Embodiment 2, Embodiment 3, Embodiment 4, or Embodiment 5.

[0148] Specifically, the electronic device of this embodiment may include: at least one processor, at least one network interface, a user interface, a memory, and at least one communication bus.

[0149] The communication bus can be used to realize the connection and communication among the above components.

[0150] The customer interface may include buttons, and the optional customer interface may also include a standard wired interface or a wireless interface.

[0151] The network interface may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, and the like.

[0152] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect the various parts of the entire electronic device, and performs various functions of the routing device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of DSP, FPGA, PLA. The processor can integrate one or a combination of CPU, GPU and modem. Among them, the CPU mainly processes the operating system, customer interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display; the modem is used to handle wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor, but may be implemented separately through a chip.

[0153] The memory may include RAM or ROM. Optionally, the memory includes a non-transitory computer-readable medium. The memory may be used to store instructions, programs, codes, code sets, or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory may also optionally be at least one storage device located away from the aforementioned processor.

[0154] Example 12:

[0155] A computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the video bit rate calculation method of Example 1, Example 2, Example 3, Example 4, or Example 5. If the components of the electronic device of Example 11 are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium of this embodiment.

[0156] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of this specification is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted via a computer-readable storage medium. The computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. Available media may be magnetic media (eg, floppy disks, hard disks, tapes), optical media (eg, digital versatile discs (DVDs)), or semiconductor media (eg, solid state disks (SSDs)).

[0157] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When executed, the program can include the processes of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. The technical features of this embodiment and the implementation scheme can be combined in any manner unless they conflict.

[0158] The above are some embodiments of this specification and are not intended to limit the scope of this specification. Without departing from the design spirit of this specification, various modifications and improvements made to the technical solutions of this specification by ordinary technicians in this field should fall within the scope of protection determined by the claims of this application.

Claims

1. A method for calculating a video bit rate, comprising: Get the frame rate and bit rate of the source video, and get the frame rate of the target video; Calculating a mapping frame rate of the target video according to the frame rate of the source video and the frame rate of the target video; The first bit rate of the target video is calculated according to the mapping frame rate of the target video and the frame rate and bit rate of the source video.

2. The video bit rate calculation method according to claim 1, wherein: The mapping frame rate of the target video is calculated according to the frame rate of the source video and the frame rate of the target video using the following formula: Wherein, x1 is the frame rate of the target video, E1 is the frame rate of the source video, L1 is the low frame rate, M1 is the medium frame rate, H1 is the high frame rate, d is the bit rate level coefficient of the target video, and F1 is the mapping frame rate of the target video; The first bit rate of the target video is calculated according to the mapping frame rate of the target video and the frame rate and bit rate of the source video using the following formula: Among them, Y1 is the first bit rate of the target video, F1 is the mapping frame rate of the target video, A1 is the bit rate of the source video, and E1 is the frame rate of the source video.

3. The video bit rate calculation method according to claim 1, further comprising: Obtaining the resolution of the target video; Calculating an upper limit bit rate of the target video according to the resolution of the target video; The second bit rate of the target video is determined according to the upper limit bit rate of the target video and the first bit rate of the target video.

4. The video bit rate calculation method according to claim 3, wherein: The upper limit bit rate of the target video is calculated according to the resolution of the target video using the following formula: Ymax = 4*3.29*W1*G1 (6) Wherein, Ymax is the upper limit bit rate of the target video, W1 is the width value of the resolution of the target video, and G1 is the height value of the resolution of the target video; The second bit rate of the target video is determined according to the upper limit bit rate of the target video and the first bit rate of the target video using the following formula: Among them, Y2 is the second bit rate of the target video, Y1 is the first bit rate of the target video, and Ymax is the upper limit bit rate of the target video.

5. The video bit rate calculation method according to claim 3, further comprising: Obtaining the resolution of the source video; Calculating an actual resolution area ratio according to the resolution of the source video and the resolution of the target video; Calculate a mapping resolution area ratio according to the actual resolution area ratio and the expected resolution area ratio; A third bit rate of the target video is calculated according to the mapping resolution area ratio and the second bit rate of the target video.

6. The video bit rate calculation method according to claim 5, wherein: The actual resolution area ratio is calculated according to the resolution of the source video and the resolution of the target video using the following formula: Wherein, x2 is the actual resolution area ratio, W1 is the width value of the resolution of the target video, G1 is the height value of the resolution of the target video, W2 is the width value of the resolution of the source video, and G2 is the height value of the resolution of the source video; When the actual resolution area ratio is less than 1, the mapping resolution area ratio is calculated based on the actual resolution area ratio and the expected resolution area ratio using the following formula: Among them, x2 is the actual resolution area ratio, E2 is the expected resolution area ratio, L2 is the low-level resolution area ratio, M2 is the medium-level resolution area ratio, H2 is the high-level resolution area ratio, d is the bit rate level coefficient of the target video, and F2 is the mapping resolution area ratio; When the actual resolution area ratio is greater than or equal to 1, the mapping resolution area ratio is calculated according to the actual resolution area ratio using the following formula: Among them, x2 is the actual resolution area ratio, and F2 is the mapping resolution area ratio; The third bit rate of the target video is calculated according to the mapping resolution area ratio and the second bit rate of the target video using the following formula: Y3=F2*Y2 (13) Among them, Y3 is the third bit rate of the target video, F2 is the mapping resolution area ratio, and Y2 is the second bit rate of the target video.

7. The video bit rate calculation method according to claim 5, further comprising: Calculating a general bit rate of the target video according to the resolution of the target video; The third bit rate of the target video is compared with the general bit rate of the target video. When the third bit rate of the target video is less than the general bit rate of the target video and the difference between the two is greater than a first preset bit rate threshold, the mapping bit rate of the target video is calculated according to the third bit rate of the target video and the general bit rate of the target video, and Using the mapped bit rate of the target video as the fourth bit rate of the target video; When the third bit rate of the target video is greater than the general bit rate of the target video and the difference between the two is greater than a second preset bit rate threshold, the fourth bit rate of the target video is calculated according to the third bit rate of the target video; otherwise, the third bit rate of the target video is directly used as the fourth bit rate of the target video.

8. The video bit rate calculation method according to claim 7, wherein: The general bit rate of the target video is calculated according to the resolution of the target video using the following formula: Wherein, Y is the general bit rate of the target video, W1 is the width value of the resolution of the target video, G1 is the height value of the resolution of the target video, and d is the bit rate level coefficient of the target video; The mapping bit rate of the target video is calculated according to the third bit rate of the target video and the general bit rate of the target video using the following formula: Among them, Y3 is the third bit rate of the target video, Y is the general bit rate of the target video, L3 is the low bit rate, M3 is the medium bit rate, H3 is the high bit rate, d is the bit rate level coefficient of the target video, and F3 is the mapping bit rate of the target video; The fourth bit rate of the target video is calculated according to the third bit rate of the target video using the following formula: Y4=0.7*Y3 (19) Among them, Y4 is the fourth bit rate of the target video, and Y3 is the third bit rate of the target video.

9. The video bit rate calculation method according to claim 7, further comprising: Determining a video coding standard of the target video, and when the video coding standard of the target video is HEVC, calculating a fifth bit rate of the target video according to a fourth bit rate of the target video; When the video coding standard of the target video is AVC, the fourth bit rate of the target video is determined as the fifth bit rate of the target video.

10. The video bit rate calculation method according to claim 9, wherein: The fifth bit rate of the target video is calculated according to the fourth bit rate of the target video using the following formula: Y5 = 0.75*Y4 (20) Among them, Y5 is the fifth bit rate of the target video, and Y4 is the fourth bit rate of the target video.

11. A video bit rate calculation system, comprising: The frame rate and bit rate acquisition module is used to obtain the frame rate and bit rate of the source video, and to obtain the frame rate of the target video; A mapping frame rate calculation module, used to calculate the mapping frame rate of the target video according to the frame rate of the source video and the frame rate of the target video; The first bit rate calculation module is used to calculate the first bit rate of the target video according to the mapping frame rate of the target video and the frame rate and bit rate of the source video.

12. A video bit rate calculation system according to claim 11, wherein: The mapping frame rate calculation module adopts the following formula: Wherein, x1 is the frame rate of the target video, E1 is the frame rate of the source video, L1 is the low frame rate, M1 is the medium frame rate, H1 is the high frame rate, d is the bit rate level coefficient of the target video, and F1 is the mapping frame rate of the target video; The first bit rate calculation module adopts the following formula: Among them, Y1 is the first bit rate of the target video, F1 is the mapping frame rate of the target video, A1 is the bit rate of the source video, and E1 is the frame rate of the source video.

13. The video bit rate calculation system according to claim 11, further comprising: A first resolution acquisition module, used to acquire the resolution of the target video; An upper limit bit rate calculation module, used to calculate the upper limit bit rate of the target video according to the resolution of the target video; The second bit rate calculation module is used to determine the second bit rate of the target video according to the upper limit bit rate of the target video and the first bit rate of the target video.

14. A video bit rate calculation system according to claim 13, wherein: The upper limit bit rate calculation module adopts the following formula: Ymax = 4*3.29*W1*G1 (6) Wherein, Ymax is the upper limit bit rate of the target video, W1 is the width value of the resolution of the target video, and G1 is the height value of the resolution of the target video; The second bit rate calculation module adopts the following formula: Among them, Y2 is the second bit rate of the target video, Y1 is the first bit rate of the target video, and Ymax is the upper limit bit rate of the target video.

15. The video bit rate calculation system according to claim 13, further comprising: A second resolution acquisition module, used to acquire the resolution of the source video; An actual resolution area ratio calculation module, used to calculate the actual resolution area ratio according to the resolution of the source video and the resolution of the target video; A mapping resolution area ratio calculation module, used for calculating the mapping resolution area ratio according to the actual resolution area ratio and the expected resolution area ratio; The third bit rate calculation module is used to calculate the third bit rate of the target video according to the mapping resolution area ratio and the second bit rate of the target video.

16. A video bit rate calculation system according to claim 15, wherein: The actual resolution area ratio calculation module adopts the following formula: Wherein, x2 is the actual resolution area ratio, W1 is the width value of the resolution of the target video, G1 is the height value of the resolution of the target video, W2 is the width value of the resolution of the source video, and G2 is the height value of the resolution of the source video; When the actual resolution-to-area ratio is less than 1, the mapping resolution-to-area ratio calculation module uses the following formula: Among them, x2 is the actual resolution area ratio, E2 is the expected resolution area ratio, L2 is the low-level resolution area ratio, M2 is the medium-level resolution area ratio, H2 is the high-level resolution area ratio, d is the bit rate level coefficient of the target video, and F2 is the mapping resolution area ratio; When the actual resolution area ratio is greater than or equal to 1, the mapping resolution area ratio calculation module adopts the following formula: Among them, x2 is the actual resolution area ratio, and F2 is the mapping resolution area ratio; The third code rate calculation module adopts the following formula: Y3=F2*Y2 (13) Among them, Y3 is the third bit rate of the target video, F2 is the mapping resolution area ratio, and Y2 is the second bit rate of the target video.

17. The video bit rate calculation system according to claim 15, further comprising: A general bit rate calculation module, used for calculating the general bit rate of the target video according to the resolution of the target video; a fourth bit rate determination module, configured to compare the third bit rate of the target video with the general bit rate of the target video, and when the third bit rate of the target video is less than the general bit rate of the target video and the difference between the two is greater than a first preset bit rate threshold, calculate a mapping bit rate of the target video according to the third bit rate of the target video and the general bit rate of the target video, and use the mapping bit rate of the target video as the fourth bit rate of the target video; When the third bit rate of the target video is greater than the general bit rate of the target video and the difference between the two is greater than a second preset bit rate threshold, the fourth bit rate of the target video is calculated according to the third bit rate of the target video; otherwise, the third bit rate of the target video is directly used as the fourth bit rate of the target video.

18. A video bit rate calculation system according to claim 17, wherein the general bit rate calculation module adopts the following formula: in, Y is the general bit rate of the target video, W1 is the width value of the resolution of the target video, G1 is the height value of the resolution of the target video, and d is the bit rate level coefficient of the target video; The fourth code rate determination module includes a mapping code rate calculation unit, and the mapping code rate calculation unit adopts the following formula: Among them, Y3 is the third bit rate of the target video, Y is the general bit rate of the target video, L3 is the low bit rate, M3 is the medium bit rate, H3 is the high bit rate, d is the bit rate level coefficient of the target video, and F3 is the mapping bit rate of the target video; The fourth code rate determination module further includes a fourth code rate calculation unit, and the fourth code rate calculation unit adopts the following formula: Y4=0.7*Y3(19) Among them, Y4 is the fourth bit rate of the target video, and Y3 is the third bit rate of the target video.

19. The video bit rate calculation system according to claim 17, further comprising: a fifth bit rate determination module, configured to determine a video coding standard of the target video, and when the video coding standard of the target video is HEVC, calculate a fifth bit rate of the target video according to the fourth bit rate of the target video; When the video coding standard of the target video is AVC, the fourth bit rate of the target video is determined as the fifth bit rate of the target video.

20. A video bit rate calculation system according to claim 19, wherein: The fifth code rate determination module includes a fifth code rate calculation unit, and the fifth code rate calculation unit adopts the following formula: Y5=0.75*Y4 (20) Among them, Y5 is the fifth bit rate of the target video, and Y4 is the fourth bit rate of the target video.

21. An electronic device, comprising: Memory, used to store programs; A processor, configured to run the program stored in the memory to execute the video bit rate calculation method described in any one of claims 1 to 10.

22. A computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the video bit rate calculation method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Code rate control method and device of video encoding

    CN105282547A

  • Transcoding method and device

    CN106856570A

  • Screen recording and flow pushing method and device, electronic equipment and storage medium

    CN114245196A

  • Video code rate calculation method and system

    CN117714696A

  • Frame rate control method and apparatus, storage medium

    WO2022007300A2