CN103763559A - Video file transcoding method - Google Patents

Video file transcoding method Download PDF

Info

Publication number
CN103763559A
CN103763559A CN201410010216.6A CN201410010216A CN103763559A CN 103763559 A CN103763559 A CN 103763559A CN 201410010216 A CN201410010216 A CN 201410010216A CN 103763559 A CN103763559 A CN 103763559A
Authority
CN
China
Prior art keywords
video file
code
quantization parameter
cycle down
code check
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.)
Granted
Application number
CN201410010216.6A
Other languages
Chinese (zh)
Other versions
CN103763559B (en
Inventor
楼英明
魏洪钦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Boan Technology Co.,Ltd.
Original Assignee
Ability Sky Technology (beijing) Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ability Sky Technology (beijing) Ltd filed Critical Ability Sky Technology (beijing) Ltd
Priority to CN201410010216.6A priority Critical patent/CN103763559B/en
Publication of CN103763559A publication Critical patent/CN103763559A/en
Application granted granted Critical
Publication of CN103763559B publication Critical patent/CN103763559B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a video file transcoding method. The video file transcoding method comprises the following steps of using a first constant quantization parameter to encode a video file so as to obtain a first transcoding video file; predicting a second constant quantization parameter which is adopted when code reduction is carried out on the first transcoding video file and the code rate of the first transcoding video file is larger than a target code rate, and obtaining when the code rate of the video file is smaller than the target code rate; using the second constant quantization parameter to carry out code reduction on the first transcoding video file so as to obtain a second transcoding video file. According to the video file transcoding method, due to the fact that the constant quantization parameters for code reduction of the video file are predicted, twice code reduction needs to be carried out on the video file at most, the frequency of code reduction of the video file is reduced, on the premise that video quality is ensured, and image quality cannot have visual difference along with changes of scenes, it is ensured that the output code rate of the video file is controllable, and the transcoding time is controllable, and the overall effect of transcoding of the video file is improved.

Description

A kind of video file code-transferring method
Technical field
The present invention relates to technical field of video processing, relate in particular to a kind of video file code-transferring method.
Background technology
Along with the development of network video technique, people more and more touch various videos, user can watch by terminals such as computer, mobile phone, panel computers, processing to video file is also more and more numerous and diverse, and users are also more and more stricter, careful to the requirement of video file transcoding.
General, for the transcoding of video file, can adopt various ways to process, for example utilize CRF(constant ratefactor/constant quality, constant-quality pattern): by reducing the relatively unessential frame quality of (as consumed the frame of code check, difficult coding), save on the frame that code check is used in relative efficiency.The scope of CRF quantization scale be 0 to 51(8-bitx264 and the scope of the quantization scale of 10-bitx264 be 0 to 63), wherein 0 is lossless mode, 23 is default value, 51 may be the poorest.This numeral is less, and picture quality is better.
Present inventor finds, for large file, repeatedly falls possibly code and could arrive the quantization scale in specified scope, increases the scramble time, and bit rate output is uncontrollable, specifies coded file quality in range of code rates to guarantee.
Summary of the invention
The embodiment of the present invention provides a kind of video file code-transferring method, is guaranteeing under the prerequisite of video quality control coding time and encoder bit rate for realizing.
A kind of video file code-transferring method, comprises the following steps:
Utilize the first constant quantization parameter to encode to described video file, obtain the first transcoding video file;
When the code check of the first transcoding video file is greater than target bit rate, predict the second constant quantization parameter, described the second constant quantization parameter is for to fall code to the first transcoding video file, the constant quantization parameter that the code check that makes to fall the video file after code adopts while being less than target bit rate;
Utilize described the second constant quantization parameter to fall code to described the first transcoding video file, obtain described the second transcoding video file.
In the present embodiment, by prediction, code is fallen in the first transcoding video file, the second constant quantization parameter that the code check of the video file obtaining adopts while being less than target bit rate, can obtain the second constant quantization parameter more accurately, make the video file quality that obtains after utilizing this second constant quantization parameter to fall code better, reduced yard number of times that falls to video file, improved the code efficiency of falling of video file, guaranteeing that video quality and image quality do not have with scene changes under the prerequisite of visual difference, guarantee that video file bit rate output is controlled, the transcoding time is controlled, improved the whole structure of video file transcoding.
Preferably, when the described code check when the first transcoding video file is greater than target bit rate, predict the second constant quantization parameter, described the second constant quantization parameter is for to fall code to the first transcoding video file, the constant quantization parameter that the code check that makes to fall the video file after code adopts while being less than target bit rate, comprising:
When the code check of the first transcoding video file is greater than target bit rate, utilize cycle down code to predict the second constant quantization parameter, described the second constant quantization parameter is for to carry out cycle down code to the first transcoding video file, the constant quantization parameter adopting while making the code check of the video file after cycle down code be less than target bit rate.
In the present embodiment, by utilizing the prediction of cycle down code, code is fallen in the first transcoding video file, the second constant quantization parameter that the code check of the video file obtaining adopts while being less than target bit rate, reduced the cycle down code number of times to video file, improved the code efficiency of falling of video file, guaranteeing that video quality and image quality do not have with scene changes under the prerequisite of visual difference, guarantee that video file bit rate output is controlled, the transcoding time is controlled, has improved the whole structure of video file transcoding.
Preferably, described step is when the code check of the first transcoding video file is greater than target bit rate, utilize cycle down code to predict the second constant quantization parameter, described the second constant quantization parameter is for to carry out cycle down code to the first transcoding video file, the constant quantization parameter adopting while making the code check of the video file after cycle down code be less than target bit rate, comprising:
When described the first code check is greater than target bit rate, calculate the cycle down code check that the first transcoding video file is carried out to cycle down code;
When calculating the code check that described the first transcoding video file is carried out to the video file that cycle down code obtains and be less than target bit rate according to described cycle down code check, a yard number of times falls;
Described in utilization, fall a yard number of times and obtain described the second constant quantization parameter.
In the present embodiment, by calculating the cycle down code check that the first transcoding video file is carried out to cycle down code, according to described cycle down code check, calculate described the first transcoding video file is carried out to cycle down code, when the code check of the video file obtaining is less than target bit rate, a yard number of times falls, described in utilization, fall a yard number of times and obtain described the second constant quantization parameter, efficiency and the accuracy rate of predicting the second constant quantization parameter have been improved, make video file carry out at most falling code twice, guaranteeing that video quality and image quality do not have with scene changes under the prerequisite of visual difference, guarantee that video file bit rate output is controlled, the transcoding time is controlled, improved the whole structure of video file transcoding.
Preferably, the cycle down code check of cycle down code is carried out in described calculating to the first transcoding video file, comprising:
Utilize crf+k to fall for the first time code to the first transcoding video file, wherein, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code;
Utilize following formula to obtain described cycle down code check,
r 1=R 1/R 0
Wherein, r 1for cycle down code check, R 1be that a yard code check that obtains video file, R fall in the first transcoding video file for the first time 0for described the first code check.
Preferably, when described step is calculated the code check that described the first transcoding video file is carried out to the video file that cycle down code obtains and is less than target bit rate according to described cycle down code check, fall a yard number of times, comprising:
Utilize following formula to obtain described the first transcoding video file to carry out the code check of the video file that cycle down code obtains,
R 1*pow(r1,n)
Wherein, n is the number of times of cycle down code;
Obtain and work as R 1* pow (r 1, n) <=R etime n number of times, wherein, R efor described target bit rate, described n is that code check that described the first transcoding video file is carried out to the video file that cycle down code obtains falls a yard number of times while being less than target bit rate.
Preferably, fall a yard number of times described in described step utilization and obtain described the second constant quantization parameter, comprising:
According to following formula, obtain described the second constant quantization parameter,
crf 2=crf+nk
Wherein, crf 2it is the second constant quantization parameter.
Preferably, described the first constant quantification parameter c rf=24, the constant quantization parameter constant of described cycle down code k=4.
Preferably, fall a yard number of times described in described step utilization and obtain described the second constant quantization parameter, comprising:
Obtain the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file;
Judge whether described code check gap is less than cycle down code code check threshold value;
When described code check gap is less than cycle down code code check threshold value, by following formula, obtain described the second constant quantization parameter:
crf 2=crf+k*(n-1)+k/2
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code;
When described code check gap is more than or equal to cycle down code code check threshold value, by following formula, obtain described the second constant quantization parameter:
crf 2=crf+nk
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code.
In ability embodiment, according to code check gap, the second constant quantization parameter is dynamically adjusted, make the code check of the second transcoding video file more close to target bit rate, make video file can excessively not fall code, guaranteed the both controllability of the code check of the second transcoding video file and quality of the second transcoding video file of output video code check.
Preferably, described step is obtained the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file, comprising:
Utilize following formula to obtain the code check that the first transcoding video file is carried out to the video file obtaining after second from the bottom cycle down code,
R n-1=R 1*pow(r 1,n-1)
Wherein, R n-1for the first transcoding video file being carried out to the code check of the video file obtaining after second from the bottom cycle down code, r 1for cycle down code check, R 1for the first transcoding video file being fallen for the first time to the code check of the video file after code, n is the number of times of cycle down code;
Utilize following formula to obtain described code check gap,
△R n-1=︱R n-1-R e
Wherein, △ R n-1for described code check gap, R efor described target bit rate.
Preferably, described cycle down code code check threshold value is target bit rate 10.
In the embodiment of the present invention, the constant quantization parameter of code by prediction, video file is fallen, make video file at most only need carry out falling code twice, reduced yard number of times that falls of video file, guaranteeing that video quality and image quality do not have with scene changes under the prerequisite of visual difference, guarantee that video file bit rate output is controlled, the transcoding time is controlled, has improved the whole structure of video file transcoding.
Other features and advantages of the present invention will be set forth in the following description, and, partly from specification, become apparent, or understand by implementing the present invention.Object of the present invention and other advantages can be realized and be obtained by specifically noted structure in write specification, claims and accompanying drawing.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and forms a part for specification, for explaining the present invention, is not construed as limiting the invention together with embodiments of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of an embodiment of video file code-transferring method of the present invention;
Fig. 2 is the flow chart of another embodiment of video file code-transferring method of the present invention;
Fig. 3 is the flow chart of another embodiment of video file code-transferring method of the present invention;
Fig. 4 is the logical flow chart of an embodiment of video file code-transferring method of the present invention;
Fig. 5 is the structure chart of an embodiment of video file transcoding device of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein, only for description and interpretation the present invention, is not intended to limit the present invention.
Referring to Fig. 1, be the flow chart of an embodiment of video file code-transferring method of the present invention, the method comprises:
Step 101: utilize the first constant quantization parameter to encode to described video file, obtain the first transcoding video file.
Wherein, the first constant quantization parameter can be set to 24, also can or need to arrange voluntarily according to video file, to coded system those skilled in the art of video file, can select as required, does not repeat them here.
Step 102: when the code check of the first transcoding video file is greater than target bit rate, predict the second constant quantization parameter, described the second constant quantization parameter is for to fall code to the first transcoding video file, the constant quantization parameter that the code check that makes to fall the video file after code adopts while being less than target bit rate.
Wherein, owing to being identical to the circulation of video cycle down code by code check, when the code check of the first transcoding video file is greater than target bit rate, can utilize cycle down code to predict the second constant quantization parameter, described the second constant quantization parameter is for to carry out cycle down code to the first transcoding video file, the constant quantization parameter adopting while making the code check of the video file after cycle down code be less than target bit rate; When the code check of the first transcoding video file is less than target bit rate, directly export the first transcoding video file.Those skilled in the art can also adopt other to fall coding mode prediction code to be fallen in the first transcoding video file, the second constant quantization parameter that the code check of the video file obtaining adopts while being less than target bit rate.
In one embodiment, utilize the prediction of cycle down code to fall code to the first transcoding video file, the second constant quantization parameter that the code check of the video file obtaining adopts while being less than target bit rate comprises:
The cycle down code check of cycle down code is carried out in calculating to the first transcoding video file;
According to described cycle down code check, calculate described the first transcoding video file is carried out to cycle down code, when the code check of the video file obtaining is less than target bit rate, fall a yard number of times;
Described in utilization, fall a yard number of times and obtain described the second constant quantization parameter.
In the present embodiment, by calculating the cycle down code check that the first transcoding video file is carried out to cycle down code, according to described cycle down code check, calculate described the first transcoding video file is carried out to cycle down code, when the code check of the video file obtaining is less than target bit rate, a yard number of times falls, described in utilization, fall a yard number of times and obtain described the second constant quantization parameter, efficiency and the accuracy rate of predicting the second constant quantization parameter have been improved, make video file at most only need carry out falling code twice, guaranteeing that video quality and image quality do not have with scene changes under the prerequisite of visual difference, guarantee that video file bit rate output is controlled, the transcoding time is controlled, improved the whole structure of video file transcoding.
Step 103: utilize described the second constant quantization parameter to fall code to described the first transcoding video file, obtain described the second transcoding video file.
In the embodiment of the present invention, the constant quantization parameter of code by prediction, video file is fallen, make video file at most only need carry out falling code twice, reduced yard number of times that falls of video file, guaranteeing that video quality and image quality do not have with scene changes under the prerequisite of visual difference, guarantee that video file bit rate output is controlled, the transcoding time is controlled, has improved the whole structure of video file transcoding.
The the second constant quantization parameter that by prediction, video file is fallen code, can reduce the number of times that video file is fallen to code, and its different real-time method is referring to following examples.
Referring to Fig. 2, be the flow chart of another embodiment of video file code-transferring method of the present invention, the method comprises:
Step 201: utilize the first constant quantization parameter to encode to described video file, obtain the first transcoding video file.
Step 202: calculate the cycle down code check that the first transcoding video file is carried out to cycle down code.
Wherein, the constant quantization parameter adopting due to the adjacent twice cycle down code of video file be the constant quantization parameter constant of cycle down code, the constant quantization parameter constant of cycle down code is constant, therefore the cycle down code check that video file is carried out to cycle down code is constant, both to video file fall at every turn code amplitude be constant, those skilled in the art can set the first constant quantization parameter and the constant quantization parameter constant of cycle down code as required, by the first constant quantification setting parameter, be for example 24, constant cycle down code quantization parameter constant is set as to 4.For example:
Can utilize crf+k to fall for the first time code to the first transcoding video file, wherein, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code;
Utilize following formula to obtain described cycle down code check,
r 1=R 1/R 0
R 1for cycle down code check, R 1be that a yard code check that obtains video file, R fall in the first transcoding video file for the first time 0for described the first code check.
Step 203: fall a yard number of times when calculating the code check that described the first transcoding video file is carried out to the video file that cycle down code obtains and be less than target bit rate according to described cycle down code check.
Wherein, can utilize following formula to obtain described the first transcoding video file to carry out the code check of the video file that cycle down code obtains,
R 1*pow(r1,n)
N is the number of times of cycle down code;
Obtain and work as R 1* pow (r 1, n) <=R etime n number of times, wherein, R efor described target bit rate, described n is that code check that described the first transcoding video file is carried out to the video file that cycle down code obtains falls a yard number of times while being less than target bit rate.
Wherein, predict that the process that the second constant quantization parameter and computation cycles are fallen the cycle down code check of code and fallen yard number of times is an estimation procedure, and the fict yard process of falling is obtaining after the second constant quantization parameter, need to utilize this second constant quantization parameter to fall code and process.
Step 204: fall a yard number of times described in utilization and obtain described the second constant quantization parameter.
Wherein, when the constant quantization parameter constant of cycle down code of each cycle down code constant, and when the code check that described the first transcoding video file carries out the video file that cycle down code obtains is less than to target bit rate, fall yard number of times when known, can utilize the constant quantization parameter constant of cycle down code constant and fall a yard number of times and obtain the second constant quantization parameter.For example:
Can obtain described the second constant quantization parameter according to following formula,
crf 2=crf+nk
Crf 2it is the second constant quantization parameter.
Predicting in the second constant quantification parametric procedure of video file being fallen to code and can dynamically adjusting the second constant quantization parameter according to yard degree of falling of video file, referring to following examples.
Referring to Fig. 3, be the flow chart of another embodiment of video file code-transferring method of the present invention, the method comprises:
Step 301: utilize the first constant quantization parameter to encode to described video file, obtain the first transcoding video file.
Step 302: utilize crf+k to fall for the first time code to the first transcoding video file, wherein, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code.
Step 302: utilize following formula to obtain described cycle down code check,
r 1=R 1/R 0
Wherein, r 1for cycle down code check, R 1be that a yard code check that obtains video file, R fall in the first transcoding video file for the first time 0for described the first code check.
Step 303: utilize following formula to obtain described the first transcoding video file to carry out the code check of the video file that cycle down code obtains,
R 1*pow(r1,n)
Wherein, n is the number of times of cycle down code.
Step 304: obtain and work as R 1* pow (r 1, n) <=R etime n number of times, wherein, R efor described target bit rate, described n is that code check that described the first transcoding video file is carried out to the video file that cycle down code obtains falls a yard number of times while being less than target bit rate.
Step 305: obtain the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file.
Wherein, can utilize following formula to obtain the code check that the first transcoding video file is carried out to the video file obtaining after second from the bottom cycle down code,
R n-1=R 1*pow(r 1,n-1)
Wherein, R n-1for the first transcoding video file being carried out to the code check of the video file obtaining after second from the bottom cycle down code, r 1for cycle down code check, R 1for the first transcoding video file being fallen for the first time to the code check of the video file after code, n is the number of times of cycle down code.
Utilize following formula to obtain described code check gap,
△R n-1=︱R n-1-R e
Wherein, △ R n-1for described code check gap, R efor described target bit rate.
Step 306: judge whether described code check gap is less than cycle down code code check threshold value.
Wherein, cycle down code code check threshold value is relevant to target bit rate, and for example cycle down code code check threshold value can be 10 left and right of target bit rate, or 20 percent left and right of target bit rate, and those skilled in the art can set as required.Cycle down code code check threshold value is larger, carries out the code check moon convergence and target bit rate of the second transcoding video file that cycle down code obtains.
Step 307: when described code check gap is less than cycle down code code check threshold value, obtain described the second constant quantization parameter by following formula:
crf 2=crf+k*(n-1)+k/2
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code.
Step 308: when described code check gap is more than or equal to cycle down code code check threshold value, obtain described the second constant quantization parameter by following formula:
crf 2=crf+nk
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code.
In the present embodiment, by obtaining the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file, and code check gap and cycle down code code check threshold value are compared, the second constant quantization parameter is dynamically adjusted, improved the control ability of video file transcoding with respect to target bit rate, made the code check of the video file after transcoding more approach target bit rate.
Referring to Fig. 4, be the logical flow chart of an embodiment of video file code-transferring method of the present invention, the method comprises:
Step 401: utilize the first constant quantification parameter c rf to encode to video file, obtain the first transcoding video file, the code check of the first transcoding video file is R 0.
Step 402: the code check that judges the first transcoding video file is R 0whether be less than target bit rate R e, if the transcoding of video file is finished, enter if not step 403.
Step 403: utilize crf+k to fall for the first time code to the first transcoding video file, the code check of the video file obtaining is R 1, wherein, crf is the first constant quantization parameter, k is the constant quantization parameter constant of cycle down code.
Step 404: judge whether the code check that the first transcoding video file carries out the video file that cycle down code obtains is less than target bit rate, i.e. R whether 1* pow (r 1, n) <=R e, wherein, r 1for cycle down code check, R 1be that a yard code check that obtains video file, R fall in the first transcoding video file for the first time 0for described the first code check, n is cycle down code number of times, if so, carry out step 405, if not, increases cycle down code frequency n ++, proceed cycle down code, repeat step 404.
Step 405: obtain the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file, i.e. △ R n-1=︱ R n-1-R e︱, wherein, Rn-1 is the code check that the first transcoding video file is carried out to the video file obtaining after second from the bottom cycle down code, △ R n-1for described code check gap, R efor described target bit rate.
Step 406: judge whether code check gap is less than cycle down code code check threshold value, i.e. △ R whether n-1<S, wherein, S is cycle down code code check threshold value, when described code check gap is less than cycle down code code check threshold value, enters step 407, when described code check gap is more than or equal to cycle down code code check threshold value, enters step 408.
Step 407: obtain described the second constant quantization parameter by following formula:
crf 2=crf+k*(n-1)+k/2
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code.
Step 408: obtain described the second constant quantization parameter by following formula:
crf 2=crf+nk
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code.
Step 409: utilize described the second constant quantization parameter to fall code to described the first transcoding video file, obtain described the second transcoding video file.
Referring to Fig. 5, be the structure chart of an embodiment of video file transcoding device of the present invention, this device comprises:
Coding module 501, for utilizing the first constant quantization parameter to encode to described video file, obtains the first transcoding video file;
Parameter prediction module 502, for when the code check of the first transcoding video file is greater than target bit rate, predict the second constant quantization parameter, described the second constant quantization parameter is for to fall code to the first transcoding video file, the constant quantization parameter that the code check that makes to fall the video file after code adopts while being less than target bit rate;
Fall yard module 503, for utilizing described the second constant quantization parameter to fall code to described the first transcoding video file, obtain described the second transcoding video file.
Preferably, described parameter prediction module comprises:
Cycle down code parameters predicting unit 504, for when the code check of the first transcoding video file is greater than target bit rate, utilize cycle down code to predict the second constant quantization parameter, described the second constant quantization parameter is for to carry out cycle down code to the first transcoding video file, the constant quantization parameter adopting while making the code check of the video file after cycle down code be less than target bit rate.
Preferably, described cycle down code parameters predicting unit 504 also for:
When described the first code check is greater than target bit rate, calculate the cycle down code check that the first transcoding video file is carried out to cycle down code;
When calculating the code check that described the first transcoding video file is carried out to the video file that cycle down code obtains and be less than target bit rate according to described cycle down code check, a yard number of times falls;
Described in utilization, fall a yard number of times and obtain described the second constant quantization parameter.
Preferably, described cycle down code parameters predicting unit 504 also for:
Obtain the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file;
Judge whether described code check gap is less than cycle down code code check threshold value;
When described code check gap is less than cycle down code code check threshold value, by following formula, obtain described the second constant quantization parameter:
crf 2=crf+k*(n-1)+k/2
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code;
When described code check gap is more than or equal to cycle down code code check threshold value, by following formula, obtain described the second constant quantization parameter:
crf 2=crf+nk
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code.
It should be noted that: when the video file transcoding device that above-described embodiment provides is stated function in realization, only with the division of above-mentioned functional module, be illustrated, in practical application, can above-mentioned functions be distributed and by different functional modules, completed as required, the internal structure of the equipment of being about to is divided into different functional modules, to complete all or part of function described above.In addition, the video file transcoding device that above-described embodiment provides and video file code-transferring method embodiment belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt complete hardware implementation example, completely implement software example or the form in conjunction with the embodiment of software and hardware aspect.And the present invention can adopt the form at one or more upper computer programs of implementing of computer-usable storage medium (including but not limited to magnetic disc store and optical memory etc.) that wherein include computer usable program code.
The present invention is with reference to describing according to flow chart and/or the block diagram of the method for the embodiment of the present invention, equipment (system) and computer program.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or the combination of square frame.Can provide these computer program instructions to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, the instruction that makes to carry out by the processor of computer or other programmable data processing device produces the device for realizing the function of specifying at flow process of flow chart or multiple flow process and/or square frame of block diagram or multiple square frame.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, the instruction that makes to be stored in this computer-readable memory produces the manufacture that comprises command device, and this command device is realized the function of specifying in flow process of flow chart or multiple flow process and/or square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make to carry out sequence of operations step to produce computer implemented processing on computer or other programmable devices, thereby the instruction of carrying out is provided for realizing the step of the function of specifying in flow process of flow chart or multiple flow process and/or square frame of block diagram or multiple square frame on computer or other programmable devices.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.

Claims (10)

1. a video file code-transferring method, is characterized in that, comprises the following steps:
Utilize the first constant quantization parameter to encode to described video file, obtain the first transcoding video file;
When the code check of the first transcoding video file is greater than target bit rate, predict the second constant quantization parameter, described the second constant quantization parameter is for to fall code to the first transcoding video file, the constant quantization parameter that the code check that makes to fall the video file after code adopts while being less than target bit rate;
Utilize described the second constant quantization parameter to fall code to described the first transcoding video file, obtain described the second transcoding video file.
2. the method for claim 1, it is characterized in that, described step is when the code check of the first transcoding video file is greater than target bit rate, predict the second constant quantization parameter, described the second constant quantization parameter is for to fall code to the first transcoding video file, the constant quantization parameter that the code check that makes to fall the video file after code adopts while being less than target bit rate, comprising:
When the code check of the first transcoding video file is greater than target bit rate, utilize cycle down code to predict the second constant quantization parameter, described the second constant quantization parameter is for to carry out cycle down code to the first transcoding video file, the constant quantization parameter adopting while making the code check of the video file after cycle down code be less than target bit rate.
3. method as claimed in claim 2, it is characterized in that, described step is when the code check of the first transcoding video file is greater than target bit rate, utilize cycle down code to predict the second constant quantization parameter, described the second constant quantization parameter is for to carry out cycle down code to the first transcoding video file, the constant quantization parameter adopting while making the code check of the video file after cycle down code be less than target bit rate, comprising:
When described the first code check is greater than target bit rate, calculate the cycle down code check that the first transcoding video file is carried out to cycle down code;
When calculating the code check that described the first transcoding video file is carried out to the video file that cycle down code obtains and be less than target bit rate according to described cycle down code check, a yard number of times falls;
Described in utilization, fall a yard number of times and obtain described the second constant quantization parameter.
4. method as claimed in claim 3, is characterized in that, the cycle down code check of cycle down code is carried out in described calculating to the first transcoding video file, comprising:
Utilize crf+k to fall for the first time code to the first transcoding video file, wherein, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code;
Utilize following formula to obtain described cycle down code check,
r 1=R 1/R 0
Wherein, r 1for cycle down code check, R 1be that a yard code check that obtains video file, R fall in the first transcoding video file for the first time 0for described the first code check.
5. method as claimed in claim 4, is characterized in that, when described step is calculated the code check that described the first transcoding video file is carried out to the video file that cycle down code obtains and is less than target bit rate according to described cycle down code check, falls a yard number of times, comprising:
Utilize following formula to obtain described the first transcoding video file to carry out the code check of the video file that cycle down code obtains,
R 1*pow(r1,n)
Wherein, n is the number of times of cycle down code;
Obtain and work as R 1* pow (r 1, n) <=R etime n number of times, wherein, R efor described target bit rate, described n is that code check that described the first transcoding video file is carried out to the video file that cycle down code obtains falls a yard number of times while being less than target bit rate.
6. method as claimed in claim 5, is characterized in that, falls a yard number of times described in described step utilization to obtain described the second constant quantization parameter, comprising:
According to following formula, obtain described the second constant quantization parameter,
crf 2=crf+nk
Wherein, crf 2it is the second constant quantization parameter.
7. method as claimed in claim 4, is characterized in that, described the first constant quantification parameter c rf=24, the constant quantization parameter constant of described cycle down code k=4.
8. method as claimed in claim 3, is characterized in that, falls a yard number of times described in described step utilization to obtain described the second constant quantization parameter, comprising:
Obtain the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file;
Judge whether described code check gap is less than cycle down code code check threshold value;
When described code check gap is less than cycle down code code check threshold value, by following formula, obtain described the second constant quantization parameter:
crf 2=crf+k*(n-1)+k/2
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code;
When described code check gap is more than or equal to cycle down code code check threshold value, by following formula, obtain described the second constant quantization parameter:
crf 2=crf+nk
Wherein, crf 2be the second constant quantization parameter, crf is the first constant quantization parameter, and k is the constant quantization parameter constant of cycle down code, and n is the number of times of cycle down code.
9. method as claimed in claim 8, is characterized in that, described step is obtained the code check gap of the first transcoding video file being carried out obtaining after second from the bottom cycle down code code check and the target bit rate of video file, comprising:
Utilize following formula to obtain the code check that the first transcoding video file is carried out to the video file obtaining after second from the bottom cycle down code,
R n-1=R 1*pow(r 1,n-1)
Wherein, R n-1for the first transcoding video file being carried out to the code check of the video file obtaining after second from the bottom cycle down code, r 1for cycle down code check, R 1for the first transcoding video file being fallen for the first time to the code check of the video file after code, n is the number of times of cycle down code;
Utilize following formula to obtain described code check gap,
△R n-1=︱R n-1-R e
Wherein, △ R n-1for described code check gap, R efor described target bit rate.
10. method as claimed in claim 8, is characterized in that, described cycle down code code check threshold value is target bit rate 10.
CN201410010216.6A 2014-01-09 2014-01-09 A kind of video file code-transferring method Active CN103763559B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410010216.6A CN103763559B (en) 2014-01-09 2014-01-09 A kind of video file code-transferring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410010216.6A CN103763559B (en) 2014-01-09 2014-01-09 A kind of video file code-transferring method

Publications (2)

Publication Number Publication Date
CN103763559A true CN103763559A (en) 2014-04-30
CN103763559B CN103763559B (en) 2017-12-29

Family

ID=50530707

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410010216.6A Active CN103763559B (en) 2014-01-09 2014-01-09 A kind of video file code-transferring method

Country Status (1)

Country Link
CN (1) CN103763559B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202660A (en) * 2014-09-15 2014-12-10 乐视网信息技术(北京)股份有限公司 Video dividing and transcoding method and device
CN104618734A (en) * 2015-01-29 2015-05-13 华为技术有限公司 Video code stream transcoding method and device under same protocol type
CN107846595A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 The method and video encoder of a kind of Video coding
CN107846590A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 The method and video encoder of a kind of Video coding
CN108540807A (en) * 2018-02-28 2018-09-14 北京达佳互联信息技术有限公司 The method, apparatus and terminal of video file transcoding
CN109660825A (en) * 2017-10-10 2019-04-19 腾讯科技(深圳)有限公司 Video transcoding method, device, computer equipment and storage medium
CN110113660A (en) * 2019-02-27 2019-08-09 咪咕视讯科技有限公司 A kind of method, apparatus, terminal and the storage medium of the estimation of transcoding duration

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101331773B (en) * 2005-09-22 2014-09-17 高通股份有限公司 Device and method for processing rate controlled for video coding using rate-distortion characteristics
CN101594525B (en) * 2008-05-31 2011-08-10 华为技术有限公司 Method and device for acquiring quantization parameters and transcoding device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202660A (en) * 2014-09-15 2014-12-10 乐视网信息技术(北京)股份有限公司 Video dividing and transcoding method and device
CN104618734B (en) * 2015-01-29 2019-02-01 华为技术有限公司 The code-transferring method and device of video code flow under same protocol type
CN104618734A (en) * 2015-01-29 2015-05-13 华为技术有限公司 Video code stream transcoding method and device under same protocol type
CN107846590B (en) * 2016-09-19 2020-09-08 阿里巴巴集团控股有限公司 Video coding method and video coder
CN107846590A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 The method and video encoder of a kind of Video coding
CN107846595A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 The method and video encoder of a kind of Video coding
CN107846595B (en) * 2016-09-19 2021-08-06 阿里巴巴集团控股有限公司 Video coding method and video coder
CN109660825A (en) * 2017-10-10 2019-04-19 腾讯科技(深圳)有限公司 Video transcoding method, device, computer equipment and storage medium
CN109660825B (en) * 2017-10-10 2021-02-09 腾讯科技(深圳)有限公司 Video transcoding method and device, computer equipment and storage medium
US10951905B2 (en) 2017-10-10 2021-03-16 Tencent Technology (Shenzhen) Company Limited Video transcoding method, computer device, and storage medium
CN108540807A (en) * 2018-02-28 2018-09-14 北京达佳互联信息技术有限公司 The method, apparatus and terminal of video file transcoding
CN108540807B (en) * 2018-02-28 2019-05-31 北京达佳互联信息技术有限公司 The method, apparatus and terminal of video file transcoding
CN110113660A (en) * 2019-02-27 2019-08-09 咪咕视讯科技有限公司 A kind of method, apparatus, terminal and the storage medium of the estimation of transcoding duration
CN110113660B (en) * 2019-02-27 2021-08-06 咪咕视讯科技有限公司 Method, device, terminal and storage medium for transcoding time length estimation

Also Published As

Publication number Publication date
CN103763559B (en) 2017-12-29

Similar Documents

Publication Publication Date Title
CN103763559A (en) Video file transcoding method
US20160044329A1 (en) Image Predictive Coding Method and Image Encoder
JP6342500B2 (en) Recursive block partitioning
CN107113442A (en) Method and apparatus for being encoded/decoded to motion vector
US11336915B2 (en) Global motion vector video encoding systems and methods
CN103875249B (en) Method and apparatus for the method and apparatus of multi-view point video predictive coding and for multi-view point video prediction decoding
CN102598670A (en) Method and apparatus for encoding/decoding image with reference to a plurality of frames
CN106162176A (en) Method for choosing frame inner forecast mode and device
CN106104685A (en) Audio coding method and device
IL275034B1 (en) Method and apparatus for video encoding and decoding based on block shape
CN109803141A (en) Device and method for encoded video
JP6690254B2 (en) Image coding apparatus, method and program
CN106454348B (en) A kind of video coding-decoding method and device
Li et al. Towards optimal real-time volumetric video streaming: A rolling optimization and deep reinforcement learning based approach
CN106231307B (en) A kind of compression of images intra-coding prediction method and its hardware realization
CN103716631A (en) Image processing method, device, coder and decoder
TW201206201A (en) Method and apparatus for motion estimation for video processing
US11006143B2 (en) Motion vector candidate pruning systems and methods
CN109951706A (en) A kind of method for video coding, device and encoder
CN105933718A (en) Coding unit partitioning method and device
CN104618715A (en) Method and device for obtaining minimal rate-distortion cost
Kim et al. An effective combination of power scaling for H. 264/AVC compression
CN110049339A (en) Prediction direction choosing method, device and storage medium in image coding
CN105516719B (en) A kind of method for video coding and device
CN104601991A (en) Searching method and device for time-domain predictive parameters

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220824

Address after: Room 913, 9th Floor, Building 4, Yard 9, Guang'an Road, Fengtai District, Beijing 100000

Patentee after: Beijing Boan Technology Co.,Ltd.

Address before: 7th Floor, Block A, Tiangong Building, University of Science and Technology, No. 30 Xueyuan Road, Haidian District, Beijing 100083

Patentee before: ABLESKY SCIENCE & TECHNOLOGY (BEIJING) CO.,LTD.