CN113949877B - A method and device for determining transcoding bit rate - Google Patents
A method and device for determining transcoding bit rate Download PDFInfo
- Publication number
- CN113949877B CN113949877B CN202111211002.1A CN202111211002A CN113949877B CN 113949877 B CN113949877 B CN 113949877B CN 202111211002 A CN202111211002 A CN 202111211002A CN 113949877 B CN113949877 B CN 113949877B
- Authority
- CN
- China
- Prior art keywords
- video
- target
- code rate
- complexity
- paragraph
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000004458 analytical method Methods 0.000 claims description 14
- 238000001514 detection method Methods 0.000 claims description 11
- 230000011218 segmentation Effects 0.000 claims description 11
- 238000009826 distribution Methods 0.000 abstract description 6
- 238000004364 calculation method Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/40—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/172—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a method and a device for determining a transcoding code rate, which comprise the steps of encoding a target video file based on a target encoding mode to obtain a video complexity curve of the target video file, analyzing peaks and troughs of the video complexity curve to obtain video paragraph dividing points of the target video file, dividing the target video file by the video paragraph dividing points to obtain a plurality of video paragraphs, and calculating the transcoding code rate of each video paragraph according to complexity parameters in the video complexity curve and the target code rate of the target video file so as to realize encoding processing of the target video file through the transcoding code rate corresponding to each video paragraph. According to the invention, the code rate distribution obtained by the target coding mode is used as a video complexity reference, and the transcoding code rates corresponding to different sections are determined, so that compared with the coding mode adopting the fixed code rate, higher image quality or lower bandwidth cost can be obtained.
Description
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a method and apparatus for determining a transcoding rate.
Background
Because video files have a plurality of different coding formats and different quality levels, in order to meet the playing requirements of different application fields, a video production platform needs to convert the video files for a plurality of times to generate target video files with different formats and different quality levels.
At present, video segmented transcoding is widely applied to various large video production platforms, and compared with whole-chip transcoding, segmented transcoding can greatly improve transcoding efficiency due to concurrency capacity. The video segmentation method is generally used for dividing the time length or the variable time length according to the transcoding performance of the system, the division method is mainly triggered by improving the transcoding efficiency, and the segmentation time length is adjusted according to the current transcoding capability of the system, but the influence of the segmentation time length on the transcoding image quality is not considered, so that the final transcoding effect does not meet the requirement of improving the video image quality.
Disclosure of Invention
Aiming at the problems, the invention provides a method and a device for determining the transcoding code rate, which realize the aim of improving the video image quality.
In order to achieve the above object, the present invention provides the following technical solutions:
A method for determining a transcoding rate, comprising:
Encoding a target video file based on a target encoding mode to obtain a video complexity curve of the target video file, wherein the target encoding mode is a constant-quality encoding mode, the horizontal axis of the video complexity curve represents time, and the vertical axis of the video complexity curve represents complexity parameters, and the complexity parameters are matched with the encoding code rate of the target encoding mode;
Analyzing the wave crest and the wave trough of the video complexity curve to obtain video paragraph dividing points of the target video file;
Dividing the target video file by using the video paragraph dividing points to obtain a plurality of video paragraphs;
According to the complexity parameter in the video complexity curve and the target code rate of the target video file, the transcoding code rate of each video paragraph is calculated, so that the encoding processing of the target video file is realized through the transcoding code rate corresponding to each video paragraph.
Optionally, the analyzing the peaks and valleys of the video complexity curve to obtain the video paragraph dividing points of the target video file includes:
analyzing the wave crest and the wave trough of the video complexity curve to obtain the initial dividing point of the video paragraph 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;
And optimizing the initial dividing point according to the shot switching frame to obtain a video paragraph dividing point of the target video file.
Optionally, the dividing the target video file with the video paragraph dividing point to obtain a plurality of video paragraphs includes:
initially dividing the target video file by using the video paragraph dividing points to obtain initial video clips;
And acquiring the duration of the initial video segment, and adjusting the initial video segment according to the duration threshold of the video segment to acquire a plurality of video segments.
Optionally, the calculating to obtain the transcoding code rate of each video segment according to the complexity parameter in the video complexity curve and the target code rate of the target video file includes:
according to the complexity parameters in the video complexity curve, calculating to obtain the average complexity of each video paragraph and the average complexity of the target video file;
Obtaining a target code rate of the target video file, wherein the target code rate comprises a basic code rate and a floating code rate;
And calculating the transcoding code rate of each video paragraph based on the target code rate of the target video file, the average complexity of each video paragraph and the average complexity of the target video file.
Optionally, the calculating, based on the target code rate of the target video file, the average complexity of each video segment, and the average complexity of the target video file, the transcoding code rate of each video segment includes:
calculating to obtain the complexity proportionality coefficient of each video paragraph based on the average complexity of each paragraph and the average complexity of the target video file;
calculating initial code rates of all video paragraphs according to the complexity proportionality coefficient, the floating code rate and the basic code rate of all video paragraphs;
according to the target code rate of the target file and the total duration of the target video file, calculating to obtain the expected file size of the target file;
calculating the actual file size of the target file under the initial code rate allocation of each video paragraph;
Calculating to obtain code rate deviation based on the actual file size and the expected file size;
and according to the code rate deviation and the initial code rate of each video paragraph, calculating to obtain the transcoding code rate of each video paragraph.
A transcoding rate determination apparatus, comprising:
The initial coding unit is used for coding the target video file based on a target coding mode to obtain a video complexity curve of the target video file, wherein the target coding mode is a constant-quality coding mode, the horizontal axis of the video complexity curve represents time, the vertical axis of the video complexity curve represents complexity parameters, and the complexity parameters are matched with the coding code rate of the target coding mode;
The analysis unit is used for analyzing the wave crest and the wave trough of the video complexity curve to obtain video paragraph dividing points of the target video file;
The dividing unit is used for dividing the target video file by the video paragraph dividing points to obtain a plurality of video paragraphs;
And the calculating unit is used for calculating the transcoding code rate of each video paragraph according to the complexity parameter in the video complexity curve and the target code rate of the target video file, so that the encoding processing of the target video file is realized through the corresponding transcoding code rate of each video paragraph.
Optionally, the analysis unit includes:
The analysis subunit is used for analyzing the wave crest and the wave trough of the video complexity curve to obtain the initial dividing point of the video paragraph of the target video file;
the detection subunit is used for carrying out scene switching detection on the target video file to obtain a lens switching frame of the target video file;
And the optimizing subunit is used for optimizing the initial dividing point according to the shot switching frame to obtain the dividing point of the video paragraph of the target video file.
Optionally, the dividing unit includes:
the dividing subunit is used for initially dividing the target video file by the video paragraph dividing points to obtain initial video clips;
and the adjustment subunit is used for acquiring the duration of the initial video segment, and adjusting the initial video segment according to the video segment duration threshold value to acquire a plurality of video segments.
Optionally, the computing unit includes:
The first calculating subunit is used for calculating the average complexity of each video paragraph and the average complexity of the target video file according to the complexity parameter in the video complexity curve;
the acquisition subunit is used for acquiring a target code rate of the target video file, wherein the target code rate comprises a basic code rate and a floating code rate;
and the second calculating subunit is used for calculating the transcoding code rate of each video paragraph based on the target code rate of the target video file, the average complexity of each video paragraph and the average complexity of the target video file.
Optionally, the second computing subunit is specifically configured to:
calculating to obtain the complexity proportionality coefficient of each video paragraph based on the average complexity of each paragraph and the average complexity of the target video file;
calculating initial code rates of all video paragraphs according to the complexity proportionality coefficient, the floating code rate and the basic code rate of all video paragraphs;
according to the target code rate of the target file and the total duration of the target video file, calculating to obtain the expected file size of the target file;
calculating the actual file size of the target file under the initial code rate allocation of each video paragraph;
Calculating to obtain code rate deviation based on the actual file size and the expected file size;
and according to the code rate deviation and the initial code rate of each video paragraph, calculating to obtain the transcoding code rate of each video paragraph.
Compared with the prior art, the method and the device for determining the transcoding rate comprise the steps of encoding a target video file based on a target encoding mode to obtain a video complexity curve of the target video file, analyzing peaks and troughs of the video complexity curve to obtain video paragraph dividing points of the target video file, dividing the target video file by the video paragraph dividing points to obtain a plurality of video paragraphs, and calculating the transcoding rate of each video paragraph according to complexity parameters in the video complexity curve and the target rate of the target video file so as to realize encoding processing of the target video file through the transcoding rate corresponding to each video paragraph. According to the invention, the code rate distribution obtained by the target coding mode is used as a video complexity reference, and the transcoding code rates corresponding to different sections are determined, so that compared with the coding mode adopting the fixed code rate, higher image quality or lower bandwidth cost can be obtained.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for determining a transcoding rate according to an embodiment of the present invention;
Fig. 2 is a flow chart of another method for determining a transcoding rate according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for determining a transcoding rate according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms first and second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to the listed steps or elements but may include steps or elements not expressly listed.
The embodiment of the invention provides a transcoding code rate determining method, wherein the transcoding code rate refers to the coding code rate for converting a video file into a target code rate. The method is a sectional transcoding code rate distribution method based on video scenes, and can obviously improve video image quality or reduce bandwidth cost on the premise of ensuring that the size of an output video file is controllable.
Referring to fig. 1, a flowchart of a method for determining a transcoding rate according to an embodiment of the present invention may include the following steps:
S102, encoding the target video file based on a target encoding mode to obtain a video complexity curve of the target video file.
In the embodiment of the invention, the target coding mode is a constant quality coding mode, for example, the target coding mode can be CRF coding in a coding algorithm with relatively constant quality, and by taking CRF coding as an example, the CRF code rate is relatively higher for complex scenes in video, and the CRF code rate is lower for simple scenes in video. Firstly, performing primary low-resolution CRF coding on a first target video file, and counting the coded code rate with a period of 1 second to evaluation data serving as video complexity, namely generating a video complexity curve of the target video file. The horizontal axis of the video complexity curve represents time, and the vertical axis represents complexity parameters, and the complexity parameters are matched with the coding rate of the target coding mode. And obtaining a quantization index of video complexity according to the code rate distribution condition of CRF coding, and determining the subsequent segmentation time point ju strategy and the segmentation final transcoding code rate according to the index, so that the final transcoding code rate of each segment is matched with the complexity of the final transcoding code rate.
S102, analyzing the wave crest and the wave trough of the video complexity curve to obtain video paragraph dividing points of the target video file.
S103, dividing the target video file by using the video paragraph dividing points to obtain a plurality of video paragraphs.
After the target video file is encoded in a target encoding mode, a video complexity curve of the target video file can be obtained, and then peaks and troughs in the curve are analyzed to obtain corresponding paragraph division. For example, taking the target video file as the program video, the video complexity curve of the target video file is relatively low at the time point of the presenter's white-on simple scene. At the time point of a scene with complicated lamplight singing, the value is higher. In one embodiment of the invention, the peaks and troughs are found first, and then spread towards the two sides by taking them as the center of the paragraph, so as to form the paragraph without intersection finally.
It should be noted that, on the basis of the above-mentioned division of video paragraphs in the specific referencing process, the video paragraphs obtained by division may be adjusted by combining the video scene and the optimal time length of the video paragraphs that are convenient to process, and specific implementation manners are described in the subsequent embodiments of the present invention and are not described in detail herein.
S104, according to the complexity parameter in the video complexity curve and the target code rate of the target video file, calculating the transcoding code rate of each video paragraph, so that the encoding processing of the target video file is realized through the corresponding transcoding code rate of each video paragraph.
Taking a target coding mode as a CRF coding mode as an example, using an average CRF code rate value in a paragraph as the average complexity of the paragraph, using an average CRF code rate value of the whole video as the average complexity of the video, and then calculating the transcoding code rate of each video paragraph based on the paragraph and the overall complexity in combination with the target code rate.
By the processing, the differential coding of the segments with different complexity in the video is realized, and the more complex segments use higher code rate, and the simpler segments use lower code rate. Meanwhile, the transcoding output file is ensured to completely meet the requirement of the target average code rate. Compared with the conventional ABR coding, the controllable bandwidth cost greatly improves the image quality experience.
In order to accurately divide the target video file, the video scene is also combined for division in the embodiment of the invention. In one possible implementation manner, the analyzing the wave crest and the wave trough of the video complexity curve to obtain the video paragraph dividing point of the target video file includes analyzing the wave crest and the wave trough of the video complexity curve to obtain the video paragraph initial dividing point of the target video file, performing scene switching detection on the target video file to obtain a lens switching frame of the target video file, and optimizing the initial dividing point according to the lens switching frame to obtain the video paragraph dividing point of the target video file.
Specifically, firstly, rough division is performed on a target video file by using peaks and troughs on a curve, and then the time length of a divided video paragraph is adjusted according to a shot switching frame. The video is composed of a plurality of shots or scenes, shot switching frames in the target video file can be positioned through scene switching detection, and the shot switching frames are used for final refinement of video segmentation, so that each video segment contains a complete scene, and the influence on the continuity of image quality due to the segmentation of the scenes in a software layer is avoided.
In another embodiment, in order to realize efficient processing of video transcoding, adjustment is further required according to an optimal time length, wherein the dividing of the target video file by the video paragraph dividing points to obtain a plurality of video paragraphs includes initially dividing the target video file by the video paragraph dividing points to obtain an initial video segment, obtaining the time length of the initial video segment, and adjusting the initial video segment according to a video paragraph time length threshold to obtain a plurality of video paragraphs. In this embodiment, the threshold value of the video segment duration may be determined according to the target transcoding rate, or may be determined according to a specific application scenario and processing requirements.
In particular. And performing peak and trough analysis on the curve corresponding to the video complexity data to generate rough paragraph division. The time length difference between different segments of the segmented transcoding affects the output efficiency of the transcoding system, the segments with short time length need to wait for the completion of segment transcoding, so that the final finished file can be output, and after the rough segment division is generated by the wave crest and the wave trough, the segments with overlong time need to be split. Likewise, the dividing duration of the segments is not too short, and the segments which are too short are subjected to the condition that the code rate control algorithm is not converged timely during the transcoding to influence the quality of the transcoded image, so that the segments which are too short are subjected to the merging processing.
It should be noted that, in the embodiment of the present invention, the dividing points may be determined first according to the analysis of the peaks and the troughs, then the video segments are performed according to the dividing points, and then the time length of the divided video segments is adjusted according to the shot switching frame, the segment time length threshold, and the like. Or determining dividing points based on the shot switching frame, the paragraph time threshold and the analysis result of the wave crest and the wave trough, and dividing according to the dividing points to obtain the video paragraph. The paragraph division is often performed in units of minutes, and the shot scene is often within tens of seconds, so that the embodiment of the invention refines the paragraph division point, so that the paragraph division point starts from the nearby scene switching point.
In one implementation manner of the embodiment of the present invention, the calculating, according to the complexity parameter in the video complexity curve and the target code rate of the target video file, the transcoding code rate of each video segment includes:
according to the complexity parameters in the video complexity curve, calculating to obtain the average complexity of each video paragraph and the average complexity of the target video file;
Obtaining a target code rate of the target video file, wherein the target code rate comprises a basic code rate and a floating code rate;
And calculating the transcoding code rate of each video paragraph based on the target code rate of the target video file, the average complexity of each video paragraph and the average complexity of the target video file.
Further, the calculating, based on the target code rate of the target video file, the average complexity of each video segment, and the average complexity of the target video file, the transcoding code rate of each video segment includes:
calculating to obtain the complexity proportionality coefficient of each video paragraph based on the average complexity of each paragraph and the average complexity of the target video file;
calculating initial code rates of all video paragraphs according to the complexity proportionality coefficient, the floating code rate and the basic code rate of all video paragraphs;
according to the target code rate of the target file and the total duration of the target video file, calculating to obtain the expected file size of the target file;
calculating the actual file size of the target file under the initial code rate allocation of each video paragraph;
Calculating to obtain code rate deviation based on the actual file size and the expected file size;
and according to the code rate deviation and the initial code rate of each video paragraph, calculating to obtain the transcoding code rate of each video paragraph.
For example, the average CRF code rate value within a segment is used as the average complexity Complex (i) for that segment. The average CRF code rate value for the whole video is used as the average complexity ComplexAvg for the video. The transcoding rate of each video segment is calculated as follows:
(1) Setting the video target code rate as BitrateTarget and the total video duration as DurationTotal.
(2) Dividing the target code rate into two parts, namely a basic code rate BitrateBase, wherein the final code rate of all the sections is larger than or equal to the basic code rate. The floating code rate BitrateDynamic, which is used to do floating processing between different paragraphs. The specific division ratio Dynamic ratio can adopt different strategies according to different videos.
BitrateTarget=BitrateBase+BitrateDynamic
DynamicRatio=BitrateDynamic/BitrateTarget
(3) Calculating a complexity ratio coefficient of the ith video segment:
ComplexRatio(i)=Complex(i)/ComplexAvg
(4) Calculating initial code rate allocation of the ith video segment:
BitrateInit(i)=ComplexRatio(i)*BitrateDynamic+BitrateBase
(5) Calculating the expected size of the target video file:
SizeTarget=BitrateTarget*DurationTotal
(6) Calculating the actual target video file size under the initial code rate allocation:
SizeReal = BitrateInit (i) Duration (i) + times + BitrateInit (n) Duration (n), where n is the total number of fragments.
(7) Calculating code rate deviation:
SizeDiff=(SizeReal-SizeTarget)
BitrateDiff=SizeDiff/DurationTotal
(8) Calculating the final transcoding code rate of the ith video segment:
BitrateFinal(i)=BitrateInit(i)+BitrateDiff
According to the transcoding code rate determining method provided by the embodiment of the invention, the CRF low-resolution pre-transcoding is used for obtaining code rate distribution to be used as a video complexity reference, rough segmentation is carried out on the video according to code rate peaks and troughs, and fine segmentation is carried out on the video by using a shot scene switching time point. Compared with common equal-length division, the method can place scenes with close content complexity into the same transcoding segment, and is convenient for targeted code rate allocation, so that the image quality of a complex paragraph is improved, and the bandwidth cost of the simple paragraph is reduced. Meanwhile, the same video scene does not cross a paragraph, and discontinuity of image quality in the same scene is avoided. And determining the paragraph ABR code rate by referring to the video complexity condition of the fine paragraph and using a paragraph code rate allocation method with controllable fluctuation rate and controllable total file size. Compared with the method using a whole slice to use a fixed code rate ABR code, the method can obtain higher image quality or lower bandwidth cost, and compared with the method using CRF code, the method can accurately control the size of an output file, so that the bandwidth cost is controllable. For one-to-many transcoding scenes, namely, multi-coding standard, multi-resolution and multi-code rate transcoding is output, the transcoding of all coding standards, resolutions and code rates can be guided only by calculating once according to the method. In the practical application process, the method is not coupled with a specific video encoder and a specific video encoding standard, and can realize seamless integration.
Referring to fig. 2, a schematic diagram of another method for determining a transcoding rate according to an embodiment of the present invention is shown. In this embodiment, a film source is taken as an example of the program video of the variety. Firstly, performing primary low-resolution CRF coding on a slice source, and taking a code rate value with 1 second as a period after statistical coding as evaluation data of video complexity. After complexity data is obtained, the complexity data is a curve, the horizontal axis is time, and the vertical axis is complexity. This curve has a lower value at the point in time of the simple scene where the presenter is talking. At the time point of a scene with complicated lamplight singing, the value is higher. The curve is divided into individual paragraphs according to time, namely, the peaks and the troughs are found out firstly, and then the peaks and the troughs are used as the centers of the paragraphs to expand to the two sides of the paragraphs, so that the paragraphs without intersections finally are formed. For example, a general paragraph allocation method is obtained, such as 0.00 to 203.00 seconds is paragraph 1, 203.00 to 600.00 seconds is paragraph 2, 600.00 to 900.00 seconds is paragraph 3, and so on. It should be noted that the 203.00 th second place may be the middle of one shot, which makes one shot artificially divided into two segments, because different segments are transcoded separately, different coding rates, parameters and the like may be adopted, so that the artificial splitting easily produces a discontinuous sense on the output video after final transcoding. For this reason, scene detection is further used for 0.00-203.00 seconds to accurately divide 0.00-201.08 into the first segment. And then calculating the code rate of each segment based on the calculation mode in the embodiment. However, in practical application, the method is often applied to a one-to-many transcoding environment, and one film source needs to transcode multi-path target videos with different resolution code rates to correspond to the grade options of smoothness, high definition, ultra definition and the like which are finally seen by a user. In the embodiment of the invention, the method is not required to be executed once for each grade condition, but is only executed once, and the different grades share the segmentation time point and the code rate guiding information which are output by the method. For the purpose of sharing, the final average code rate may use a relative value instead of a specific code rate of a certain class, for example, set to 100, the code rate calculated by a simple paragraph may be 80, and the code rate calculated by a complex paragraph may be 120. And finally, when a certain definition gear is encoded, calculating the true code rate according to the ratio relation.
Based on the foregoing embodiments, there is further provided in an embodiment of the present invention a transcoding rate determining apparatus, referring to fig. 3, including:
The initial encoding unit 10 is configured to encode a target video file based on a target encoding mode, so as to obtain a video complexity curve of the target video file, where the target encoding mode is a constant quality encoding mode, a horizontal axis of the video complexity curve represents time, and a vertical axis of the video complexity curve represents a complexity parameter, and the complexity parameter is matched with an encoding code rate of the target encoding mode;
The analysis unit 20 is configured to analyze the peaks and the troughs of the video complexity curve to obtain video paragraph dividing points of the target video file;
The dividing unit 30 is configured to divide the target video file with the video paragraph dividing points to obtain a plurality of video paragraphs;
and the calculating unit 40 is configured to calculate a transcoding code rate of each video paragraph according to the complexity parameter in the video complexity curve and the target code rate of the target video file, so that the encoding process of the target video file is implemented through the transcoding code rate corresponding to each video paragraph.
Further, the analysis unit includes:
The analysis subunit is used for analyzing the wave crest and the wave trough of the video complexity curve to obtain the initial dividing point of the video paragraph of the target video file;
the detection subunit is used for carrying out scene switching detection on the target video file to obtain a lens switching frame of the target video file;
And the optimizing subunit is used for optimizing the initial dividing point according to the shot switching frame to obtain the dividing point of the video paragraph of the target video file.
Further, the dividing unit includes:
the dividing subunit is used for initially dividing the target video file by the video paragraph dividing points to obtain initial video clips;
and the adjustment subunit is used for acquiring the duration of the initial video segment, and adjusting the initial video segment according to the video segment duration threshold value to acquire a plurality of video segments.
Optionally, the computing unit includes:
The first calculating subunit is used for calculating the average complexity of each video paragraph and the average complexity of the target video file according to the complexity parameter in the video complexity curve;
the acquisition subunit is used for acquiring a target code rate of the target video file, wherein the target code rate comprises a basic code rate and a floating code rate;
and the second calculating subunit is used for calculating the transcoding code rate of each video paragraph based on the target code rate of the target video file, the average complexity of each video paragraph and the average complexity of the target video file.
Optionally, the second computing subunit is specifically configured to:
calculating to obtain the complexity proportionality coefficient of each video paragraph based on the average complexity of each paragraph and the average complexity of the target video file;
calculating initial code rates of all video paragraphs according to the complexity proportionality coefficient, the floating code rate and the basic code rate of all video paragraphs;
according to the target code rate of the target file and the total duration of the target video file, calculating to obtain the expected file size of the target file;
calculating the actual file size of the target file under the initial code rate allocation of each video paragraph;
Calculating to obtain code rate deviation based on the actual file size and the expected file size;
and according to the code rate deviation and the initial code rate of each video paragraph, calculating to obtain the transcoding code rate of each video paragraph.
The embodiment of the invention provides a transcoding code rate determining device, which comprises an initial encoding unit, an analysis unit, a dividing unit and a calculation unit, wherein the initial encoding unit encodes a target video file based on a target encoding mode to obtain a video complexity curve of the target video file, the analysis unit analyzes peaks and troughs of the video complexity curve to obtain video paragraph dividing points of the target video file, the dividing unit divides the target video file by the video paragraph dividing points to obtain a plurality of video paragraphs, and the calculation unit calculates the transcoding code rate of each video paragraph according to complexity parameters in the video complexity curve and the target code rate of the target video file so as to realize encoding processing of the target video file through the transcoding code rate corresponding to each video paragraph. According to the invention, the code rate distribution obtained by the target coding mode is used as a video complexity reference, and the transcoding code rates corresponding to different sections are determined, so that compared with the coding mode adopting the fixed code rate, higher image quality or lower bandwidth cost can be obtained.
Based on the foregoing embodiments, embodiments of the present invention provide a computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the method for determining a transcoding rate as described in any one of the above.
The embodiment of the invention also provides electronic equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the steps of the transcoding code rate determining method.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be additional divisions of actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer 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 points refer to the description of the method section.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (8)
1. A method for determining a transcoding rate, comprising:
Encoding a target video file based on a target encoding mode to obtain a video complexity curve of the target video file, wherein the target encoding mode is a constant-quality encoding mode, the horizontal axis of the video complexity curve represents time, and the vertical axis of the video complexity curve represents complexity parameters, and the complexity parameters are matched with the encoding code rate of the target encoding mode;
Analyzing the wave crest and the wave trough of the video complexity curve to obtain video paragraph dividing points of the target video file;
Dividing the target video file by using the video paragraph dividing points to obtain a plurality of video paragraphs;
According to the complexity parameter in the video complexity curve and the target code rate of the target video file, calculating to obtain the transcoding code rate of each video paragraph, so that the encoding processing of the target video file is realized through the transcoding code rate corresponding to each video paragraph;
the calculating to obtain the transcoding code rate of each video paragraph according to the complexity parameter in the video complexity curve and the target code rate of the target video file includes:
according to the complexity parameters in the video complexity curve, calculating to obtain the average complexity of each video paragraph and the average complexity of the target video file;
Obtaining a target code rate of the target video file, wherein the target code rate comprises a basic code rate and a floating code rate;
And calculating the transcoding code rate of each video paragraph based on the target code rate of the target video file, the average complexity of each video paragraph and the average complexity of the target video file.
2. The method of claim 1, wherein analyzing the peaks and valleys of the video complexity curve to obtain video paragraph segmentation points of the target video file comprises:
analyzing the wave crest and the wave trough of the video complexity curve to obtain the initial dividing point of the video paragraph 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;
And optimizing the initial dividing point according to the shot switching frame to obtain a video paragraph dividing point of the target video file.
3. The method of claim 1, wherein dividing the target video file with the video paragraph dividing points to obtain a plurality of video paragraphs comprises:
initially dividing the target video file by using the video paragraph dividing points to obtain initial video clips;
And acquiring the duration of the initial video segment, and adjusting the initial video segment according to the duration threshold of the video segment to acquire a plurality of video segments.
4. The method of claim 1, wherein the calculating the transcoding rate for each video segment based on the target bitrate for the target video file, the average complexity for each video segment, and the average complexity for the target video file comprises:
calculating to obtain the complexity proportionality coefficient of each video paragraph based on the average complexity of each paragraph and the average complexity of the target video file;
calculating initial code rates of all video paragraphs according to the complexity proportionality coefficient, the floating code rate and the basic code rate of all video paragraphs;
Calculating the expected file size of the target video file according to the target code rate of the target video file and the total duration of the target video file;
calculating the actual file size of the target video file under the initial code rate allocation of each video paragraph;
Calculating to obtain code rate deviation based on the actual file size and the expected file size;
and according to the code rate deviation and the initial code rate of each video paragraph, calculating to obtain the transcoding code rate of each video paragraph.
5. A transcoding rate determination apparatus, comprising:
The initial coding unit is used for coding the target video file based on a target coding mode to obtain a video complexity curve of the target video file, wherein the target coding mode is a constant-quality coding mode, the horizontal axis of the video complexity curve represents time, the vertical axis of the video complexity curve represents complexity parameters, and the complexity parameters are matched with the coding code rate of the target coding mode;
The analysis unit is used for analyzing the wave crest and the wave trough of the video complexity curve to obtain video paragraph dividing points of the target video file;
The dividing unit is used for dividing the target video file by the video paragraph dividing points to obtain a plurality of video paragraphs;
The calculating unit is used for calculating the transcoding code rate of each video paragraph according to the complexity parameter in the video complexity curve and the target code rate of the target video file, so that the encoding processing of the target video file is realized through the corresponding transcoding code rate of each video paragraph;
wherein the computing unit includes:
The first calculating subunit is used for calculating the average complexity of each video paragraph and the average complexity of the target video file according to the complexity parameter in the video complexity curve;
the acquisition subunit is used for acquiring a target code rate of the target video file, wherein the target code rate comprises a basic code rate and a floating code rate;
and the second calculating subunit is used for calculating the transcoding code rate of each video paragraph based on the target code rate of the target video file, the average complexity of each video paragraph and the average complexity of the target video file.
6. The apparatus according to claim 5, wherein the analysis unit comprises:
The analysis subunit is used for analyzing the wave crest and the wave trough of the video complexity curve to obtain the initial dividing point of the video paragraph of the target video file;
the detection subunit is used for carrying out scene switching detection on the target video file to obtain a lens switching frame of the target video file;
And the optimizing subunit is used for optimizing the initial dividing point according to the shot switching frame to obtain the dividing point of the video paragraph of the target video file.
7. The apparatus of claim 5, wherein the dividing unit comprises:
the dividing subunit is used for initially dividing the target video file by the video paragraph dividing points to obtain initial video clips;
and the adjustment subunit is used for acquiring the duration of the initial video segment, and adjusting the initial video segment according to the video segment duration threshold value to acquire a plurality of video segments.
8. The apparatus of claim 5, wherein the second computing subunit is specifically configured to:
calculating to obtain the complexity proportionality coefficient of each video paragraph based on the average complexity of each paragraph and the average complexity of the target video file;
calculating initial code rates of all video paragraphs according to the complexity proportionality coefficient, the floating code rate and the basic code rate of all video paragraphs;
Calculating the expected file size of the target video file according to the target code rate of the target video file and the total duration of the target video file;
calculating the actual file size of the target video file under the initial code rate allocation of each video paragraph;
Calculating to obtain code rate deviation based on the actual file size and the expected file size;
and according to the code rate deviation and the initial code rate of each video paragraph, calculating to obtain the transcoding code rate of each video paragraph.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111211002.1A CN113949877B (en) | 2021-10-18 | 2021-10-18 | A method and device for determining transcoding bit rate |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111211002.1A CN113949877B (en) | 2021-10-18 | 2021-10-18 | A method and device for determining transcoding bit rate |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113949877A CN113949877A (en) | 2022-01-18 |
CN113949877B true CN113949877B (en) | 2025-01-21 |
Family
ID=79331238
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111211002.1A Active CN113949877B (en) | 2021-10-18 | 2021-10-18 | A method and device for determining transcoding bit rate |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113949877B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101404767A (en) * | 2008-11-24 | 2009-04-08 | 崔天龙 | Parameter-variable automated video transcoding method based on image analysis and artificial intelligence |
CN108171658A (en) * | 2016-12-07 | 2018-06-15 | 中国科学院深圳先进技术研究院 | Detect the method and system of gamma correction |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8107540B2 (en) * | 2005-07-11 | 2012-01-31 | Cheetah Technologies, L.P. | Image complexity computation in packet based video broadcast systems |
US8635357B2 (en) * | 2009-09-08 | 2014-01-21 | Google Inc. | Dynamic selection of parameter sets for transcoding media data |
US9094685B2 (en) * | 2010-09-21 | 2015-07-28 | Dialogic Corporation | Efficient coding complexity estimation for video transcoding systems |
CN103220550B (en) * | 2012-01-19 | 2016-12-07 | 华为技术有限公司 | The method and device of video conversion |
CN104202660A (en) * | 2014-09-15 | 2014-12-10 | 乐视网信息技术(北京)股份有限公司 | Video dividing and transcoding method and device |
US10873781B2 (en) * | 2017-06-13 | 2020-12-22 | Comcast Cable Communications, Llc | Video fragment file processing |
CN110213615B (en) * | 2018-04-04 | 2021-11-02 | 腾讯科技(深圳)有限公司 | Video transcoding method, device, server and storage medium |
CN112153415B (en) * | 2020-09-23 | 2022-12-02 | 北京字节跳动网络技术有限公司 | Video transcoding method, device, equipment and storage medium |
CN112672157B (en) * | 2020-12-22 | 2022-08-05 | 广州博冠信息科技有限公司 | Video encoding method, device, equipment and storage medium |
-
2021
- 2021-10-18 CN CN202111211002.1A patent/CN113949877B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101404767A (en) * | 2008-11-24 | 2009-04-08 | 崔天龙 | Parameter-variable automated video transcoding method based on image analysis and artificial intelligence |
CN108171658A (en) * | 2016-12-07 | 2018-06-15 | 中国科学院深圳先进技术研究院 | Detect the method and system of gamma correction |
Also Published As
Publication number | Publication date |
---|---|
CN113949877A (en) | 2022-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Liu et al. | Deep learning-based picture-wise just noticeable distortion prediction model for image compression | |
KR102082816B1 (en) | Method for improving the resolution of streaming files | |
CN109063694B (en) | A video target detection and recognition method | |
US9049420B1 (en) | Relative quality score for video transcoding | |
CN102461169B (en) | Motion based dynamic resolution multiple bit rate video encoding | |
CN110719457B (en) | Video coding method and device, electronic equipment and storage medium | |
CN109819282B (en) | Video user category identification method, device and medium | |
JP5969389B2 (en) | Object recognition video coding strategy | |
CN114900692B (en) | Video stream frame rate adjustment method and its device, equipment, medium and product | |
US11798254B2 (en) | Bandwidth limited context based adaptive acquisition of video frames and events for user defined tasks | |
Katsenou et al. | Efficient bitrate ladder construction for content-optimized adaptive video streaming | |
US20250203098A1 (en) | Reinforcement learning based rate control | |
Karim et al. | Quality of service (QoS): measurements of image formats in social cloud computing | |
CN109997360A (en) | The method and apparatus that video is coded and decoded based on perception measurement classification | |
CN117478886A (en) | Multimedia data encoding method, device, electronic equipment and storage medium | |
CN109951706A (en) | A kind of method for video coding, device and encoder | |
CN113949877B (en) | A method and device for determining transcoding bit rate | |
Li et al. | JUST360: Optimizing 360-degree video streaming systems with joint utility | |
CN116743609B (en) | A QoE evaluation method and device for video streaming based on semantic communication | |
CN118042142A (en) | Video coding method, device, computer equipment and medium | |
CN116800953A (en) | Video quality assessment method and device | |
CN116805967A (en) | Video encoding method, video encoding device, electronic equipment and storage medium | |
CN114387440B (en) | Video cutting method, device and storage medium | |
CN112929663B (en) | An Image Compression Quality Enhancement Method Based on Knowledge Distillation | |
CN115512185A (en) | Satellite multichannel radiance image extrapolation method and device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |