A method and device for determining transcoding bit rate

By analyzing the video complexity curve and calculating the transcoding code rate of video segments, the problem in the existing technology that segment duration has little impact on video quality is solved, achieving higher video quality or lower bandwidth costs.

CN113949877BActive Publication Date: 2025-01-21HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111211002.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-18
Publication Date
2025-01-21
Estimated Expiration
2041-10-18

AI Technical Summary

Technical Problem

When adjusting the segmentation time, the existing video segmentation transcoding method does not consider the impact of segmentation time on the video quality, resulting in the transcoding effect not meeting the needs of improving the video quality.

Method used

By encoding the target video file based on the target encoding method, the video complexity curve is obtained, the peaks and troughs of the curve are analyzed, the video segment dividing points are determined, and the transcoding bit rate of each video segment is calculated based on the complexity parameters and the target bit rate.

Benefits of technology

It is possible to dynamically adjust the transcoding bit rate of video segments to improve video quality or reduce bandwidth costs, which is more flexible and effective than fixed bit rate encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113949877B_ABST
    Figure CN113949877B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for determining a transcoding bit rate, including: encoding a target video file based on a target encoding method to obtain a video complexity curve of the target video file; analyzing the peaks and troughs of the video complexity curve to obtain video segment division points of the target video file; dividing the target video file by the video segment division points to obtain a plurality of video segments; and calculating the transcoding bit rate of each video segment according to the complexity parameter in the video complexity curve and the target bit rate of the target video file, so that the encoding process of the target video file is realized by the transcoding bit rate corresponding to each video segment. The present invention uses the bit rate distribution obtained by the target encoding method as a video complexity reference to determine the transcoding bit rates corresponding to different segments, and can obtain higher image quality or lower bandwidth cost compared to the encoding method using a fixed bit rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing technology, and in particular to a method and device for determining a transcoding bit rate. Background Art

[0002] Since video files have a variety of different encoding formats and different quality levels, in order to meet the playback requirements of different application fields, the video production platform needs to convert the video files multiple times to generate target video files of different formats and quality levels.

[0003] At present, video segment transcoding is widely used in major video production platforms. Compared with whole-film transcoding, segment transcoding can greatly improve transcoding efficiency due to its concurrent capability. The commonly used video segmentation method is to divide the video according to the system transcoding performance, equal duration or variable duration. This division method is mainly triggered by improving transcoding efficiency and adjusting the segment duration according to the current transcoding capability of the system. However, it does not consider the impact of segment duration on transcoding quality, so that the final transcoding effect does not meet the demand for improving video quality. Summary of the invention

[0004] In view of the above problems, the present invention provides a method and device for determining a transcoding bit rate, thereby achieving the purpose of improving video quality.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A method for determining a transcoding bit rate, comprising:

[0007] Encoding a target video file based on a target encoding method to obtain a video complexity curve of the target video file, wherein the target encoding method is an encoding method of constant quality, the horizontal axis of the video complexity curve represents time, and the vertical axis represents a complexity parameter, and the complexity parameter matches the encoding bit rate of the target encoding method;

[0008] Analyzing the peaks and valleys of the video complexity curve to obtain the video segment division points of the target video file;

[0009] Dividing the target video file according to the video segment division points to obtain a plurality of video segments;

[0010] According to the complexity parameters in the video complexity curve and the target bit rate of the target video file, the transcoding bit rate of each video segment is calculated, so that the encoding process of the target video file is realized by the transcoding bit rate corresponding to each video segment.

[0011] Optionally, analyzing the peaks and valleys of the video complexity curve to obtain the video segment division points of the target video file includes:

[0012] Analyzing the peaks and valleys of the video complexity curve to obtain initial division points of video segments of the target video file;

[0013] Performing scene switching detection on the target video file to obtain a shot switching frame of the target video file;

[0014] The initial division points are optimized according to the shot switching frames to obtain the video segment division points of the target video file.

[0015] Optionally, dividing the target video file according to the video segment division points to obtain a plurality of video segments includes:

[0016] Initially dividing the target video file based on the video segment division points to obtain initial video segments;

[0017] The duration of the initial video segment is obtained, and the initial video segment is adjusted according to a video segment duration threshold to obtain a plurality of video segments.

[0018] Optionally, the calculating the transcoding bit rate of each video segment according to the complexity parameter in the video complexity curve and the target bit rate of the target video file includes:

[0019] According to the complexity parameters in the video complexity curve, the average complexity of each video segment and the average complexity of the target video file are calculated;

[0020] Obtaining a target bit rate of the target video file, wherein the target bit rate includes a basic bit rate and a floating bit rate;

[0021] Based on the target bit rate of the target video file, the average complexity of each video segment and the average complexity of the target video file, the transcoding bit rate of each video segment is calculated.

[0022] Optionally, the calculating the transcoding bitrate of each video segment based on the target bitrate of the target video file, the average complexity of each video segment and the average complexity of the target video file includes:

[0023] Based on the average complexity of each segment and the average complexity of the target video file, calculate the complexity ratio coefficient of each video segment;

[0024] Calculating an initial bit rate for each video segment according to the complexity ratio coefficient of each video segment, the floating bit rate and the basic bit rate;

[0025] Calculating an expected file size of the target file according to a target bit rate of the target file and a total duration of the target video file;

[0026] Calculating the actual file size of the target file under the initial bit rate allocation of each video segment;

[0027] Calculate a bit rate deviation based on the actual file size and the expected file size;

[0028] The transcoding bit rate of each video segment is calculated according to the bit rate deviation and the initial bit rate of each video segment.

[0029] A transcoding bit rate determination device, comprising:

[0030] An initial encoding unit, used for encoding a target video file based on a target encoding method to obtain a video complexity curve of the target video file, wherein the target encoding method is a constant quality encoding method, the horizontal axis of the video complexity curve represents time, and the vertical axis represents a complexity parameter, and the complexity parameter matches the encoding bit rate of the target encoding method;

[0031] An analysis unit, used for analyzing the peaks and valleys of the video complexity curve to obtain the video segment division points of the target video file;

[0032] A division unit, used for dividing the target video file according to the video segment division points to obtain a plurality of video segments;

[0033] The calculation unit is used to calculate the transcoding bit rate of each video segment according to the complexity parameter in the video complexity curve and the target bit rate of the target video file, so that the encoding processing of the target video file can be realized through the transcoding bit rate corresponding to each video segment.

[0034] Optionally, the analysis unit comprises:

[0035] An analysis subunit, used for analyzing the peaks and valleys of the video complexity curve to obtain initial division points of the video segments of the target video file;

[0036] A detection subunit, configured to perform scene switching detection on the target video file to obtain a shot switching frame of the target video file;

[0037] The optimization subunit is used to optimize the initial division points according to the shot switching frames to obtain the video segment division points of the target video file.

[0038] Optionally, the dividing unit includes:

[0039] A division subunit, used for initially dividing the target video file based on the video segment division points to obtain initial video segments;

[0040] The adjusting subunit is used to obtain the duration of the initial video segment and adjust the initial video segment according to the video segment duration threshold to obtain a plurality of video segments.

[0041] Optionally, the computing unit includes:

[0042] A first calculation subunit, configured to calculate the average complexity of each video segment and the average complexity of the target video file according to the complexity parameter in the video complexity curve;

[0043] An acquisition subunit, used for acquiring a target bit rate of the target video file, wherein the target bit rate includes a basic bit rate and a floating bit rate;

[0044] The second calculation subunit is used to calculate the transcoding bit rate of each video segment based on the target bit rate of the target video file, the average complexity of each video segment and the average complexity of the target video file.

[0045] Optionally, the second computing subunit is specifically configured to:

[0046] Based on the average complexity of each segment and the average complexity of the target video file, calculate the complexity ratio coefficient of each video segment;

[0047] Calculating an initial bit rate for each video segment according to the complexity ratio coefficient of each video segment, the floating bit rate and the basic bit rate;

[0048] Calculating an expected file size of the target file according to a target bit rate of the target file and a total duration of the target video file;

[0049] Calculating the actual file size of the target file under the initial bit rate allocation of each video segment;

[0050] Calculate a bit rate deviation based on the actual file size and the expected file size;

[0051] The transcoding bit rate of each video segment is calculated according to the bit rate deviation and the initial bit rate of each video segment.

[0052] Compared with the prior art, the present invention provides a method and device for determining a transcoding bit rate, including: encoding a target video file based on a target encoding method to obtain a video complexity curve of the target video file; analyzing the peaks and troughs of the video complexity curve to obtain video segment division points of the target video file; dividing the target video file by the video segment division points to obtain a plurality of video segments; calculating the transcoding bit rate of each video segment according to the complexity parameters in the video complexity curve and the target bit rate of the target video file, so that the encoding process of the target video file is realized by the transcoding bit rate corresponding to each video segment. The present invention uses the bit rate distribution obtained by the target encoding method as a reference for video complexity to determine the transcoding bit rates corresponding to different segments. Compared with the encoding method using a fixed bit rate, higher image quality or lower bandwidth cost can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0054] Figure 1 A schematic diagram of a flow chart of a method for determining a transcoding bit rate provided by an embodiment of the present invention;

[0055] Figure 2 A schematic diagram of a flow chart of another method for determining a transcoding bit rate provided by an embodiment of the present invention;

[0056] Figure 3 A schematic diagram of the structure of a transcoding bit rate determination device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] The terms "first" and "second" and the like in the specification and claims of the present invention and the above drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0059] In an embodiment of the present invention, a method for determining a transcoding bitrate is provided, wherein the transcoding bitrate refers to the encoding bitrate of converting a video file into a target bitrate. The method is a segmented transcoding bitrate allocation method based on video scenes, which can significantly improve video quality or reduce bandwidth costs while ensuring that the output video file size is controllable.

[0060] See also Figure 1 , is a flow chart of a method for determining a transcoding bit rate provided by an embodiment of the present invention, the method may include the following steps:

[0061] S102: Encode the target video file based on the target encoding method to obtain a video complexity curve of the target video file.

[0062] In the embodiment of the present invention, the target encoding method is a constant quality encoding method, for example, it can be CRF encoding in a relatively constant quality encoding algorithm. Taking CRF encoding as an example, its CRF bit rate is relatively high for complex scenes in the video, and its CRF bit rate is relatively low for simple scenes in the video. First, the target video file is subjected to a low-resolution CRF encoding, and the bit rate after encoding with a period of 1 second is counted as the evaluation data of the video complexity, that is, the video complexity curve of the target video file is generated. The horizontal axis of the video complexity curve represents time, and the vertical axis represents the complexity parameter, and the complexity parameter matches the encoding bit rate of the target encoding method. A quantitative index of video complexity is obtained through the bit rate distribution of CRF encoding, and the subsequent segmentation time point planning and the determination of the final transcoding bit rate of the segment are carried out based on the index, so that the final transcoding bit rate of each segment matches its complexity.

[0063] S102: Analyze the peaks and valleys of the video complexity curve to obtain video segment division points of the target video file.

[0064] S103: Divide the target video file according to the video segment division points to obtain a plurality of video segments.

[0065] After encoding the target video file in a target encoding manner, the video complexity curve of the target video file can be obtained, and then the peaks and troughs in the curve are analyzed to obtain the corresponding paragraph divisions. For example, taking the target video file as a variety show video as an example, the video complexity curve of the target video file has a relatively low value at the time point of a simple scene with a host's dialogue. Its value is relatively high at the time point of a scene with complex lighting, singing and dancing. In one embodiment of the present invention, the peaks and troughs are first found, and then they are used as the center of the paragraph to expand to both sides, forming a paragraph that ultimately has no intersection.

[0066] It should be noted that, corresponding to the specific citation process, on the basis of the above-mentioned video segment division, the divided video segments can be adjusted in combination with the video scene and the optimal duration of the video segments that are easy to process. The specific implementation method is described in the subsequent embodiments of the present invention and will not be described in detail here.

[0067] S104: Calculate the transcoding bitrate of each video segment according to the complexity parameter in the video complexity curve and the target bitrate of the target video file, so that the encoding process of the target video file is realized by the transcoding bitrate corresponding to each video segment.

[0068] Taking CRF encoding as the target encoding method as an example, the average CRF bitrate value in the paragraph is used as the average complexity of the paragraph, and the average CRF bitrate value of the entire video is used as the average complexity of the video. Then, based on the above paragraphs and overall complexity combined with the target bitrate, the transcoding bitrate of each video paragraph is calculated.

[0069] After the above processing, differentiated encoding of segments of different complexity in the video is achieved. The more complex the segment, the higher the bit rate, and the simpler the segment, the lower the bit rate. At the same time, it ensures that the transcoded output file fully meets the target average bit rate requirements. Compared with conventional ABR encoding, the bandwidth cost is controllable and the image quality experience is greatly improved.

[0070] In order to accurately divide the target video file, the embodiment of the present invention also divides it in combination with the video scene. In a possible implementation, the peaks and troughs of the video complexity curve are analyzed to obtain the video segment division points of the target video file, including: analyzing the peaks and troughs of the video complexity curve to obtain the initial video segment division points of the target video file; performing scene switching detection on the target video file to obtain the shot switching frame of the target video file; optimizing the initial division point according to the shot switching frame to obtain the video segment division points of the target video file.

[0071] Specifically, the target video file is first roughly divided using the peaks and valleys on the curve, and then the duration of the divided video segments is adjusted according to the shot switching frames. The video is composed of some shots or scenes. Through scene switching detection, the shot switching frames in the target video file can be located. The shot switching frames will be used for the final refinement of the video segmentation, so that each video segment contains a complete scene, avoiding the impact of the continuity of the image quality due to the scene segmentation at the software level.

[0072] In another embodiment, in order to achieve efficient processing of video transcoding, it is also necessary to adjust according to the optimal duration, wherein the target video file is divided according to the video segment division point to obtain a plurality of video segments, including: initially dividing the target video file according to the video segment division point to obtain an initial video segment; obtaining the duration of the initial video segment, and adjusting the initial video segment according to a video segment duration threshold to obtain a plurality of video segments. In this embodiment, the video segment duration threshold can be determined according to the target transcoding bit rate, and can also be determined according to a specific application scenario and processing requirements.

[0073] Specifically. Perform peak and trough analysis on the curve corresponding to the video complexity data to generate a rough segment division. The difference in duration between different segments in segmented transcoding will affect the output efficiency of the transcoding system. Short segments need to wait for the transcoding of long segments to be completed before the final finished file can be output. After the rough segment division is generated by the peaks and troughs, the segments that are too long need to be split. Similarly, the segment division duration should not be too short. When transcoding, the bit rate control algorithm will not converge in time, which will affect the transcoded image quality. Therefore, the segments that are too short need to be merged.

[0074] It should be noted that in the embodiment of the present invention, the division point can be determined first according to the peak and trough analysis, and then the video is segmented according to the division point, and then the duration of the divided video segment is adjusted according to the lens switching frame and the paragraph length threshold. It can also be based on the lens switching frame and the paragraph length threshold, as well as the analysis results of the peak and trough, to first determine the division point, and then divide the video segment according to the division point. The segment division is often in units of several minutes, and the lens scene is often within tens of seconds. Therefore, the embodiment of the present invention refines the segment division point so that the segment division point starts from the nearest scene switching point.

[0075] In an implementation manner of the embodiment of the present invention, the step of calculating the transcoding bit rate of each video segment according to the complexity parameter in the video complexity curve and the target bit rate of the target video file includes:

[0076] According to the complexity parameters in the video complexity curve, the average complexity of each video segment and the average complexity of the target video file are calculated;

[0077] Obtaining a target bit rate of the target video file, wherein the target bit rate includes a basic bit rate and a floating bit rate;

[0078] Based on the target bit rate of the target video file, the average complexity of each video segment and the average complexity of the target video file, the transcoding bit rate of each video segment is calculated.

[0079] Furthermore, the calculating the transcoding bitrate of each video segment based on the target bitrate of the target video file, the average complexity of each video segment and the average complexity of the target video file includes:

[0080] Based on the average complexity of each segment and the average complexity of the target video file, calculate the complexity ratio coefficient of each video segment;

[0081] Calculating an initial bit rate for each video segment according to the complexity ratio coefficient of each video segment, the floating bit rate and the basic bit rate;

[0082] Calculating an expected file size of the target file according to a target bit rate of the target file and a total duration of the target video file;

[0083] Calculating the actual file size of the target file under the initial bit rate allocation of each video segment;

[0084] Calculate a bit rate deviation based on the actual file size and the expected file size;

[0085] The transcoding bit rate of each video segment is calculated according to the bit rate deviation and the initial bit rate of each video segment.

[0086] For example, the average CRF bitrate value in a paragraph is used as the average complexity Complex(i) of the paragraph. The average CRF bitrate value of the entire video is used as the average complexity ComplexAvg of the video. The transcoding bitrate of each video segment is calculated as follows:

[0087] (1) Set the target bitrate of the video to BitrateTarget and the total duration of the video to DurationTotal.

[0088] (2) The target bitrate is divided into two parts: the base bitrate BitrateBase, the final bitrate of all segments is greater than or equal to the base bitrate, and the floating bitrate BitrateDynamic, which is used to perform floating processing between different segments. The specific division ratio Dynamic ratio can adopt different strategies according to different videos.

[0089] BitrateTarget=BitrateBase+BitrateDynamic

[0090] DynamicRatio=BitrateDynamic / BitrateTarget

[0091] (3) Calculate the complexity ratio coefficient of the i-th video segment:

[0092] ComplexRatio(i)=Complex(i) / ComplexAvg

[0093] (4) Calculate the initial bit rate allocation of the i-th video segment:

[0094] BitrateInit(i)=ComplexRatio(i)*BitrateDynamic+BitrateBase

[0095] (5) Calculate the expected size of the target video file:

[0096] SizeTarget=BitrateTarget*DurationTotal

[0097] (6) Calculate the actual target video file size under the initial bit rate allocation:

[0098] SizeReal = BitrateInit(i)*Duration(i)+…+BitrateInit(n)*Duration(n), where n is the total number of fragments.

[0099] (7) Calculate the bit rate deviation:

[0100] SizeDiff=(SizeReal-SizeTarget)

[0101] BitrateDiff=SizeDiff / DurationTotal

[0102] (8) Calculate the final transcoding bitrate of the i-th video segment:

[0103] BitrateFinal(i)=BitrateInit(i)+BitrateDiff

[0104] A method for determining a transcoding bit rate provided by an embodiment of the present invention uses CRF low-resolution pre-transcoding to obtain a bit rate distribution as a reference for video complexity, roughly divides the video into paragraphs according to the bit rate peaks and troughs, and uses the lens scene switching time point to divide the video into fine paragraphs. Compared with ordinary equal-length division, this method can place scenes with similar content complexity into the same transcoded segment, which is convenient for targeted bit rate allocation, thereby improving the image quality of complex paragraphs and reducing the bandwidth cost of simple paragraphs. At the same time, the same video scene does not cross paragraphs, avoiding the discontinuity of image quality in the same scene. Referring to the video complexity of the fine paragraph, a paragraph bit rate allocation method with controllable volatility and controllable total file size is used to determine the paragraph ABR bit rate. Compared with using fixed bit rate ABR encoding for the entire piece, this method can obtain higher image quality or lower bandwidth cost. Compared with using CRF encoding, this method can accurately control the output file size and make the bandwidth cost controllable. For one-to-many transcoding scenarios, that is, outputting multiple coding standards, multiple resolutions, and multiple bitrates, this method only needs to be calculated once to guide the transcoding of all coding standards, resolutions, and bitrates. In actual application, this method is not coupled with specific video encoders and video coding standards, and can achieve seamless integration.

[0105] See also Figure 2, which shows a schematic diagram of another transcoding bit rate determination method provided by an embodiment of the present invention. In this embodiment, the video source is a variety show video as an example. First, the video source is CRF encoded at a low resolution, and the bit rate value after encoding with a period of 1 second is counted as the evaluation data of the video complexity. After obtaining the complexity data, it is a curve, with the horizontal axis being time and the vertical axis being the complexity level. The value of this curve is relatively low at the time point of the simple scene of the host's dialogue. The value is relatively high at the time point of the scene with complex lighting, singing and dancing. This curve is divided into paragraphs according to time, and the peaks and troughs are first found, and then they are used as the center of the paragraph to expand to both sides, forming a paragraph with no intersection in the end. For example, a rough paragraph allocation method is obtained, such as 0.00~203.00 seconds is the first paragraph, 203.00~600.00 seconds is the second paragraph, 600.00~900.00 seconds is the third paragraph, and so on. It is worth noting that the 203.00 second position may be the middle of a shot, which makes a shot artificially divided into two segments. Because different segments are transcoded separately, different encoding bit rates, parameters, etc. may be adopted. Such artificial splitting is easy to produce a sense of discontinuity in the final transcoded output video. For this reason, 0.00 to 203.00 seconds are further refined by scene detection, and 0.00 to 201.08 are finally divided as the first segment. Then, based on the calculation method in the above embodiment, the bit rate of each segment is calculated. However, in actual application, this method is often used in a one-to-many transcoding environment, and a film source needs to transcode multiple target videos with different resolution bit rates corresponding to the smooth, high-definition, ultra-clear and other grade options that the user finally sees. In the embodiment of the present invention, it is not necessary to execute once for each grade, but only once, and different grades share the segmentation time point and bit rate guidance information output by this method. In order to achieve the purpose of sharing, the final average bit rate will use a relative value instead of a specific bit rate of a certain level. For example, if it is set to 100, the bit rate calculated for a simple paragraph may be 80, and the bit rate for a complex paragraph may be 120. When finally encoding a certain definition level, its actual bit rate is calculated based on the above ratio relationship.

[0106] Based on the above embodiments, a device for determining a transcoding rate is also provided in an embodiment of the present invention. Figure 3 , the device comprises:

[0107] The initial encoding unit 10 is used to encode the target video file based on the target encoding method to obtain a video complexity curve of the target video file, wherein the target encoding method is a constant quality encoding method, the horizontal axis of the video complexity curve represents time, and the vertical axis represents a complexity parameter, and the complexity parameter matches the encoding bit rate of the target encoding method;

[0108] An analysis unit 20, configured to analyze the peaks and valleys of the video complexity curve to obtain video segment division points of the target video file;

[0109] A division unit 30, configured to divide the target video file according to the video segment division points to obtain a plurality of video segments;

[0110] The calculation unit 40 is used to calculate the transcoding bit rate of each video segment according to the complexity parameter in the video complexity curve and the target bit rate of the target video file, so that the encoding process of the target video file can be realized through the transcoding bit rate corresponding to each video segment.

[0111] Furthermore, the analysis unit comprises:

[0112] An analysis subunit, used for analyzing the peaks and valleys of the video complexity curve to obtain initial division points of the video segments of the target video file;

[0113] A detection subunit, configured to perform scene switching detection on the target video file to obtain a shot switching frame of the target video file;

[0114] The optimization subunit is used to optimize the initial division points according to the shot switching frames to obtain the video segment division points of the target video file.

[0115] Furthermore, the division unit includes:

[0116] A division subunit, used for initially dividing the target video file based on the video segment division points to obtain initial video segments;

[0117] The adjusting subunit is used to obtain the duration of the initial video segment and adjust the initial video segment according to the video segment duration threshold to obtain a plurality of video segments.

[0118] Optionally, the computing unit includes:

[0119] A first calculation subunit, configured to calculate the average complexity of each video segment and the average complexity of the target video file according to the complexity parameter in the video complexity curve;

[0120] An acquisition subunit, used for acquiring a target bit rate of the target video file, wherein the target bit rate includes a basic bit rate and a floating bit rate;

[0121] The second calculation subunit is used to calculate the transcoding bit rate of each video segment based on the target bit rate of the target video file, the average complexity of each video segment and the average complexity of the target video file.

[0122] Optionally, the second computing subunit is specifically configured to:

[0123] Based on the average complexity of each segment and the average complexity of the target video file, calculate the complexity ratio coefficient of each video segment;

[0124] Calculating an initial bit rate for each video segment according to the complexity ratio coefficient of each video segment, the floating bit rate and the basic bit rate;

[0125] Calculating an expected file size of the target file according to a target bit rate of the target file and a total duration of the target video file;

[0126] Calculating the actual file size of the target file under the initial bit rate allocation of each video segment;

[0127] Calculate a bit rate deviation based on the actual file size and the expected file size;

[0128] The transcoding bit rate of each video segment is calculated according to the bit rate deviation and the initial bit rate of each video segment.

[0129] The embodiment of the present invention provides a transcoding bit rate determination device, comprising: an initial encoding unit encodes a target video file based on a target encoding method to obtain a video complexity curve of the target video file; an analysis unit analyzes the peaks and troughs of the video complexity curve to obtain video segment division points of the target video file; a division unit divides the target video file according to the video segment division points to obtain a plurality of video segments; a calculation unit calculates the transcoding bit rate of each video segment according to the complexity parameters in the video complexity curve and the target bit rate of the target video file, so that the encoding process of the target video file is realized by the transcoding bit rate corresponding to each video segment. The present invention uses the bit rate distribution obtained by the target encoding method as a video complexity reference to determine the transcoding bit rates corresponding to different segments. Compared with the encoding method using a fixed bit rate, higher image quality or lower bandwidth cost can be obtained.

[0130] Based on the foregoing embodiments, an embodiment of the present invention provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any of the above transcoding bit rate determination methods.

[0131] An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the method for determining a transcoding bit rate are implemented when the processor executes the program.

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

[0133] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0134] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0135] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for determining a transcoding bit rate, characterized in that: include: Encoding a target video file based on a target encoding method to obtain a video complexity curve of the target video file, wherein the target encoding method is an encoding method of constant quality, the horizontal axis of the video complexity curve represents time, and the vertical axis represents a complexity parameter, and the complexity parameter matches the encoding bit rate of the target encoding method; Analyzing the peaks and valleys of the video complexity curve to obtain the video segment division points of the target video file; Dividing the target video file according to the video segment division points to obtain a plurality of video segments; According to the complexity parameter in the video complexity curve and the target bit rate of the target video file, the transcoding bit rate of each video segment is calculated, so that the encoding process of the target video file is realized by the transcoding bit rate corresponding to each video segment; The step of calculating the transcoding bitrate of each video segment according to the complexity parameter in the video complexity curve and the target bitrate of the target video file includes: According to the complexity parameters in the video complexity curve, the average complexity of each video segment and the average complexity of the target video file are calculated; Obtaining a target bit rate of the target video file, wherein the target bit rate includes a basic bit rate and a floating bit rate; Based on the target bit rate of the target video file, the average complexity of each video segment and the average complexity of the target video file, the transcoding bit rate of each video segment is calculated.

2. The method according to claim 1, characterized in that The step of analyzing the peaks and valleys of the video complexity curve to obtain the video segment division points of the target video file includes: Analyzing the peaks and valleys of the video complexity curve to obtain initial division points of video segments of the target video file; Performing scene switching detection on the target video file to obtain a shot switching frame of the target video file; The initial division points are optimized according to the shot switching frames to obtain the video segment division points of the target video file.

3. The method according to claim 1, characterized in that The step of dividing the target video file according to the video segment division points to obtain a plurality of video segments includes: Initially dividing the target video file based on the video segment division points to obtain initial video segments; The duration of the initial video segment is obtained, and the initial video segment is adjusted according to a video segment duration threshold to obtain a plurality of video segments.

4. The method according to claim 1, characterized in that: The calculating the transcoding bitrate of each video segment based on the target bitrate of the target video file, the average complexity of each video segment and the average complexity of the target video file comprises: Based on the average complexity of each segment and the average complexity of the target video file, calculate the complexity ratio coefficient of each video segment; Calculating an initial bit rate for each video segment according to the complexity ratio coefficient of each video segment, the floating bit rate and the basic bit rate; Calculating an expected file size of the target video file according to a target bit rate of the target video file and a total duration of the target video file; Calculating the actual file size of the target video file under the initial bit rate allocation of each video segment; Calculate a bit rate deviation based on the actual file size and the expected file size; The transcoding bit rate of each video segment is calculated according to the bit rate deviation and the initial bit rate of each video segment.

5. A transcoding bit rate determination device, characterized in that: include: An initial encoding unit, used for encoding a target video file based on a target encoding method to obtain a video complexity curve of the target video file, wherein the target encoding method is a constant quality encoding method, the horizontal axis of the video complexity curve represents time, and the vertical axis represents a complexity parameter, and the complexity parameter matches the encoding bit rate of the target encoding method; An analysis unit, used for analyzing the peaks and valleys of the video complexity curve to obtain the video segment division points of the target video file; A division unit, used for dividing the target video file according to the video segment division points to obtain a plurality of video segments; A calculation unit, configured to calculate the transcoding bitrate of each video segment according to the complexity parameter in the video complexity curve and the target bitrate of the target video file, so that the encoding process of the target video file is realized by the transcoding bitrate corresponding to each video segment; Wherein, the computing unit comprises: A first calculation subunit, configured to calculate the average complexity of each video segment and the average complexity of the target video file according to the complexity parameter in the video complexity curve; An acquisition subunit, used for acquiring a target bit rate of the target video file, wherein the target bit rate includes a basic bit rate and a floating bit rate; The second calculation subunit is used to calculate the transcoding bit rate of each video segment based on the target bit rate of the target video file, the average complexity of each video segment and the average complexity of the target video file.

6. The device according to claim 5, characterized in that The analysis unit comprises: An analysis subunit, used for analyzing the peaks and valleys of the video complexity curve to obtain initial division points of the video segments of the target video file; A detection subunit, configured to perform scene switching detection on the target video file to obtain a shot switching frame of the target video file; The optimization subunit is used to optimize the initial division points according to the shot switching frames to obtain the video segment division points of the target video file.

7. The device according to claim 5, characterized in that The division unit comprises: A division subunit, used for initially dividing the target video file based on the video segment division points to obtain initial video segments; The adjusting subunit is used to obtain the duration of the initial video segment and adjust the initial video segment according to the video segment duration threshold to obtain a plurality of video segments.

8. The device according to claim 5, characterized in that The second computing subunit is specifically used for: Based on the average complexity of each segment and the average complexity of the target video file, calculate the complexity ratio coefficient of each video segment; Calculating an initial bit rate for each video segment according to the complexity ratio coefficient of each video segment, the floating bit rate and the basic bit rate; Calculating an expected file size of the target video file according to a target bit rate of the target video file and a total duration of the target video file; Calculating the actual file size of the target video file under the initial bit rate allocation of each video segment; Calculate a bit rate deviation based on the actual file size and the expected file size; The transcoding bit rate of each video segment is calculated according to the bit rate deviation and the initial bit rate of each video segment.

Citation Information

Patent Citations

  • Parameter-variable automated video transcoding method based on image analysis and artificial intelligence

    CN101404767A

  • Gamma correction detection method and system

    CN108171658A