CN103763559B - A kind of video file code-transferring method - Google Patents

A kind of video file code-transferring method Download PDF

Info

Publication number
CN103763559B
CN103763559B CN201410010216.6A CN201410010216A CN103763559B CN 103763559 B CN103763559 B CN 103763559B CN 201410010216 A CN201410010216 A CN 201410010216A CN 103763559 B CN103763559 B CN 103763559B
Authority
CN
China
Prior art keywords
code
video file
cycle down
parameter
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.)
Active
Application number
CN201410010216.6A
Other languages
Chinese (zh)
Other versions
CN103763559A (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

Abstract

The invention discloses a kind of video file code-transferring method.A kind of video file code-transferring method of methods described, comprises the following steps:The video file is encoded using the parameter of the first constant quantization, obtains the first transcoded video file;When the code check of the first transcoded video file is more than target bit rate, predicts and drop code is carried out to the first transcoded video file, the code check of obtained video file is less than the parameter of the second constant quantization used during target bit rate;Drop code is carried out to the first transcoded video file using the parameter of second constant quantization, obtains the second transcoded video file.In the embodiment of the present invention, by the parameter for predicting the constant quantization that code is dropped to video file, video file is set at most need to only to be dropped code twice, reduce the drop code number of video file, on the premise of guarantee video quality and image quality do not have visual difference with scene changes, ensure that video file bit rate output is controllable, the transcoding time is controllable, improve the whole structure of video file transcoding.

Description

A kind of video file code-transferring method
Technical field
The present invention relates to technical field of video processing, more particularly to a kind of video file code-transferring method.
Background technology
With the development of network video technique, people more and more touch various videos, and user can lead to Cross the terminals such as computer, mobile phone, tablet personal computer to be watched, the processing to video file is also more and more numerous and diverse, and users are to video The requirement of file transcoding is also more and more stricter, careful.
It in general, can be handled for the transcoding of video file using various ways, such as utilize CRF (constant ratefactor/constant quality, constant-quality pattern):By reducing relatively unessential frame (such as Consume code check, the frame of difficult coding) quality, save code check with the frame of relative efficiency.The scope of CRF quantization scales be 0 to 51 (scope of 8-bitx264 and 10-bitx264 quantization scale is 0 to 63), wherein 0 is lossless mode, 23 be default value, 51 be probably worst.The numeral is smaller, and picture quality is better.
Inventors herein have recognized that for big file, may repeatedly drop code could be to the quantization ratio in specified range Example, increase the scramble time, bit rate output is uncontrollable, specifies coding document quality in the range of code check not ensure.
The content of the invention
The embodiment of the present invention provides a kind of video file code-transferring method, for realizing on the premise of video quality is ensured, Control scramble time and encoder bit rate.
A kind of video file code-transferring method, comprises the following steps:
The video file is encoded using the parameter of the first constant quantization, obtains the first transcoded video file;
When the code check of the first transcoded video file is more than target bit rate, the parameter of the second constant quantization is predicted, described the The parameter of two constant quantizations makes the code check of the video file after drop code be less than target to carry out drop code to the first transcoded video file The parameter of the constant quantization used during code check;
Drop code is carried out to the first transcoded video file using the parameter of second constant quantization, obtains described second Transcoded video file.
In the present embodiment, drop code is carried out to the first transcoded video file by prediction, the code check of obtained video file is small The parameter of the second constant quantization used when target bit rate, it can obtain the parameter of accurate second constant quantization so that The video file quality for using the parameter of second constant quantization obtain after drop code is preferable, reduces the drop to video file Code number, the drop code efficiency of video file is improved, do not had in guarantee video quality and image quality with scene changes visual On the premise of difference, ensure that video file bit rate output is controllable, the transcoding time is controllable, improve the overall effect of video file transcoding Fruit.
Preferably, it is described when the code check of the first transcoded video file is more than target bit rate, the second constant quantization of prediction Parameter, the parameter of second constant quantization make the video file after drop code to carry out drop code to the first transcoded video file Code check is less than the parameter of the constant quantization used during target bit rate, including:
When the code check of the first transcoded video file is more than target bit rate, the second constant quantization is predicted using cycle down code Parameter, the parameter of second constant quantization are to carry out cycle down code to the first transcoded video file, make regarding after cycle down code The code check of frequency file is less than the parameter of the constant quantization used during target bit rate.
In the present embodiment, drop code is carried out to the first transcoded video file by using the prediction of cycle down code, obtained video The code check of file is less than the parameter of the second constant quantization used during target bit rate, reduces the cycle down code to video file Number, the drop code efficiency of video file is improved, do not have visual difference with scene changes in guarantee video quality and image quality On the premise of, ensure that video file bit rate output is controllable, the transcoding time is controllable, improve the whole structure of video file transcoding.
Preferably, the step is pre- using cycle down code when the code check of the first transcoded video file is more than target bit rate The parameter of the second constant quantization is surveyed, the parameter of second constant quantization is to carry out cycle down code to the first transcoded video file, The code check of the video file after cycle down code is set to be less than the parameter of the constant quantization used during target bit rate, including:
When first code check is more than target bit rate, the circulation that cycle down code is carried out to the first transcoded video file is calculated Code check drops;
The video text that cycle down code is carried out to the first transcoded video file and is obtained is calculated according to the cycle down code check The code check of part is less than drop code number during target bit rate;
The parameter of second constant quantization is obtained using the drop code number.
In the present embodiment, the cycle down code check of cycle down code is carried out to the first transcoded video file by calculating, according to institute State cycle down code check and calculate and mesh is less than to the first transcoded video file progress cycle down code, the code check of obtained video file Drop code number during coding rate, the parameter of second constant quantization is obtained using the drop code number, improves prediction second The efficiency and accuracy rate of the parameter of constant quantization so that video file is at most dropped code twice, is ensureing video quality and picture On the premise of matter does not have visual difference with scene changes, ensure that video file bit rate output is controllable, the transcoding time is controllable, Improve the whole structure of video file transcoding.
Preferably, the cycle down code check calculated to the first transcoded video file progress cycle down code, including:
Drop code for the first time is carried out to the first transcoded video file using crf+k, wherein, crf is the ginseng of the first constant quantization Number, k are the constants of cycle down code constant quantization;
The cycle down code check is obtained using following formula,
r1=R1/R0
Wherein, r1For cycle down code check, R1Drop code for the first time, which is carried out, for the first transcoded video file obtains the code of video file Rate, R0For first code check.
Preferably, the step calculates according to the cycle down code check and carries out cycle down to the first transcoded video file The code check for the video file that code obtains is less than drop code number during target bit rate, including:
Obtain carrying out the first transcoded video file the code check for the video file that cycle down code obtains using following formula,
R1*pow(r1,n)
Wherein, n is cycle down synchronous codes number;
R is worked as in acquisition1*pow(r1,n)<=ReWhen n number, wherein, ReFor the target bit rate, the n is to described the The code check for the video file that one transcoded video file progress cycle down code obtains is less than drop code number during target bit rate.
Preferably, the step obtains the parameter of second constant quantization using the drop code number, including:
The parameter of second constant quantization is obtained according to following formula,
crf2=crf+nk
Wherein, crf2For the parameter of the second constant quantization.
Preferably, the parameter crf=24, the constants k of the cycle down code constant quantization of first constant quantization =4.
Preferably, the step obtains the parameter of second constant quantization using the drop code number, including:
Obtain and obtain the code check and mesh of video file after carrying out secondary cycle down code second from the bottom to the first transcoded video file The code check gap of coding rate;
Judge whether the code check gap is less than cycle down code code check threshold value;
When the code check gap is less than cycle down code code check threshold value, the ginseng of second constant quantization is obtained by following formula Number:
crf2=crf+k* (n-1)+k/2
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number;
When the code check gap is more than or equal to cycle down code code check threshold value, second constant basis is obtained by following formula The parameter of change:
crf2=crf+nk
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number.
In the present embodiment, enter Mobile state adjustment to the parameter of the second constant quantization according to code check gap, regard the second transcoding The code check of frequency file is closer to target bit rate, video file is not excessively carried out drop code, ensure that output video code rate Both the controllability of the code check of the second transcoded video file and the quality of the second transcoded video file.
Preferably, the step is obtained to obtaining video after the first transcoded video file progress secondary cycle down code second from the bottom The code check of file and the code check gap of target bit rate, including:
The video file to being obtained after the first transcoded video file progress secondary cycle down code second from the bottom is obtained using following formula Code check,
Rn-1=R1*pow(r1,n-1)
Wherein, Rn-1For to the video file obtained after the first transcoded video file progress secondary cycle down code second from the bottom Code check, r1For cycle down code check, R1To carry out the code check of the video file after drop code for the first time to the first transcoded video file, n is Cycle down synchronous codes number;
The code check gap is obtained using following formula,
△Rn-1=︱ Rn-1-Re
Wherein, △ Rn-1For the code check gap, ReFor the target bit rate.
Preferably, the cycle down code code check threshold value is the 10 of target bit rate.
In the embodiment of the present invention, by predicting the parameter for the constant quantization for dropping code to video file, make video file most Code only need to be dropped twice, reduces the drop code number of video file, ensureing video quality and image quality not with scene changes On the premise of having visual difference, ensure that video file bit rate output is controllable, the transcoding time is controllable, improve video file and turn The whole structure of code.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification Obtain it is clear that or being understood by implementing the present invention.The purpose of the present invention and other advantages can be by the explanations write Specifically noted structure is realized and obtained in book, claims and accompanying drawing.
Below by drawings and examples, technical scheme is described in further detail.
Brief description of the drawings
Accompanying drawing is used for providing a further understanding of the present invention, and a part for constitution instruction, the reality with the present invention Apply example to be used to explain the present invention together, be not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the flow chart of video file code-transferring method one embodiment 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 video file code-transferring method one embodiment of the present invention;
Fig. 5 is the structure chart of video file transcoding device one embodiment of the present invention.
Embodiment
The preferred embodiments of the present invention are illustrated below in conjunction with accompanying drawing, it will be appreciated that described herein preferred real Apply example to be merely to illustrate and explain the present invention, be not intended to limit the present invention.
Referring to Fig. 1, for the flow chart of video file code-transferring method one embodiment of the present invention, this method includes:
Step 101:The video file is encoded using the parameter of the first constant quantization, obtains the first transcoded video File.
Wherein, the parameter of the first constant quantization could be arranged to 24, according to video file or can also need voluntarily to carry out Set, coded system those skilled in the art of video file can as needed be selected, will not be repeated here.
Step 102:When the code check of the first transcoded video file is more than target bit rate, the ginseng of the second constant quantization is predicted Number, the parameter of second constant quantization make the code of the video file after drop code to carry out drop code to the first transcoded video file Rate is less than the parameter of the constant quantization used during target bit rate.
Wherein, because code check is identical by the circulation to video cycle down code, when the code check of the first transcoded video file During more than target bit rate, cycle down code can be utilized to predict the parameter of the second constant quantization, the parameter of second constant quantization To carry out cycle down code to the first transcoded video file, adopted when the code check of the video file after cycle down code is less than target bit rate The parameter of constant quantization;When the code check of the first transcoded video file is less than target bit rate, directly exports the first transcoding and regard Frequency file.Those skilled in the art can also use other drop code modes to predict and carry out drop code to the first transcoded video file, obtain To the code check of video file be less than target bit rate when the parameter of the second constant quantization that uses.
In one embodiment, drop code is carried out to the first transcoded video file using the prediction of cycle down code, obtained video The parameter that the code check of file is less than the second constant quantization used during target bit rate includes:
Calculate the cycle down code check that cycle down code is carried out to the first transcoded video file;
Calculated according to the cycle down code check and cycle down code is carried out to the first transcoded video file, obtained video text The code check of part is less than drop code number during target bit rate;
The parameter of second constant quantization is obtained using the drop code number.
In the present embodiment, the cycle down code check of cycle down code is carried out to the first transcoded video file by calculating, according to institute State cycle down code check and calculate and mesh is less than to the first transcoded video file progress cycle down code, the code check of obtained video file Drop code number during coding rate, the parameter of second constant quantization is obtained using the drop code number, improves prediction second The efficiency and accuracy rate of the parameter of constant quantization so that code at most need to only be dropped twice in video file, ensure video quality And on the premise of image quality does not have visual difference with scene changes, guarantee video file bit rate output is controllable, the transcoding time It is controllable, improve the whole structure of video file transcoding.
Step 103:Drop code is carried out to the first transcoded video file using the parameter of second constant quantization, obtained The second transcoded video file.
In the embodiment of the present invention, by predicting the parameter for the constant quantization for dropping code to video file, make video file most Code only need to be dropped twice, reduces the drop code number of video file, ensureing video quality and image quality not with scene changes On the premise of having visual difference, ensure that video file bit rate output is controllable, the transcoding time is controllable, improve video file and turn The whole structure of code.
By predicting the parameter for the second constant quantization that code is dropped to video file, it can reduce and drop code is carried out to video file Number, its different real-time method is referring to following examples.
Referring to Fig. 2, for the flow chart of another embodiment of video file code-transferring method of the present invention, this method includes:
Step 201:The video file is encoded using the parameter of the first constant quantization, obtains the first transcoded video File.
Step 202:Calculate the cycle down code check that cycle down code is carried out to the first transcoded video file.
Wherein, the parameter of the constant quantization used due to the adjacent code of cycle down twice of video file for cycle down code it is constant The constants of quantization, the constants of cycle down code constant quantization are constant, therefore carry out cycle down code to video file Cycle down code check be it is constant, both it is each to video file drop code amplitude be constant, those skilled in the art can root According to needing to set the parameter of the first constant quantization and the constants of cycle down code constant quantization, for example, it is constant by first The parameter setting of quantization is 24, and the constants of cycle down code constant quantization are set as into 4.Such as:
Drop code for the first time can be carried out to the first transcoded video file using crf+k, wherein, crf is the first constant quantization Parameter, k be cycle down code constant quantization constants;
The cycle down code check is obtained using following formula,
r1=R1/R0
r1For cycle down code check, R1Drop code for the first time, which is carried out, for the first transcoded video file obtains the code check of video file, R0 For first code check.
Step 203:Calculated according to the cycle down code check and the first transcoded video file progress cycle down code is obtained Drop code number when being less than target bit rate of the code check of video file.
Wherein it is possible to obtain the video file that the first transcoded video file is carried out cycle down code and obtained using following formula Code check,
R1*pow(r1,n)
N is cycle down synchronous codes number;
R is worked as in acquisition1*pow(r1,n)<=ReWhen n number, wherein, ReFor the target bit rate, the n is to described the The code check for the video file that one transcoded video file progress cycle down code obtains is less than drop code number during target bit rate.
Wherein, the parameter for predicting the second constant quantization and the cycle down code check for calculating cycle down code and the process for dropping code number It is estimation procedure, rather than real drop code process, it is after the parameter of the second constant quantization is obtained, it is necessary to second constant using this The parameter of quantization carries out dropping code processing.
Step 204:The parameter of second constant quantization is obtained using the drop code number.
Wherein, when the constants of the cycle down code constant quantization of each cycle down code are constant, and to first transcoding When video file is carried out known to the drop code number when code check of video file that cycle down code obtains is less than target bit rate, Ke Yili With the constants of cycle down code constant quantization are constant the parameter of the second constant quantization is obtained with drop code number.Such as:
The parameter of second constant quantization can be obtained according to following formula,
crf2=crf+nk
crf2For the parameter of the second constant quantization.
Can be according to the drop code of video file in the parametric procedure for predicting the second constant quantization that code is dropped to video file Degree enters Mobile state adjustment to the parameter of the second constant quantization, referring to following examples.
Referring to Fig. 3, for the flow chart of another embodiment of video file code-transferring method of the present invention, this method includes:
Step 301:The video file is encoded using the parameter of the first constant quantization, obtains the first transcoded video File.
Step 302:Drop code for the first time is carried out to the first transcoded video file using crf+k, wherein, crf is first constant The parameter of quantization, k are the constants of cycle down code constant quantization.
The cycle down code check is obtained using following formula,
r1=R1/R0
Wherein, r1For cycle down code check, R1Drop code for the first time, which is carried out, for the first transcoded video file obtains the code of video file Rate, R0For first code check.
Step 303:The video file that the first transcoded video file is carried out cycle down code and obtained is obtained using following formula Code check,
R1*pow(r1,n)
Wherein, n is cycle down synchronous codes number.
Step 304:R is worked as in acquisition1*pow(r1,n)<=ReWhen n number, wherein, ReFor the target bit rate, the n is The code check of the video file obtained to the first transcoded video file progress cycle down code is less than drop code during target bit rate Number.
Step 305:Obtain and obtain video file after carrying out secondary cycle down code second from the bottom to the first transcoded video file The code check gap of code check and target bit rate.
Wherein it is possible to obtained after carrying out secondary cycle down code second from the bottom to the first transcoded video file using following formula acquisition The code check of video file,
Rn-1=R1*pow(r1,n-1)
Wherein, Rn-1For to the video file obtained after the first transcoded video file progress secondary cycle down code second from the bottom Code check, r1For cycle down code check, R1To carry out the code check of the video file after drop code for the first time to the first transcoded video file, n is Cycle down synchronous codes number.
The code check gap is obtained using following formula,
△Rn-1=︱ Rn-1-Re
Wherein, △ Rn-1For the code check gap, ReFor the target bit rate.
Step 306:Judge whether the code check gap is less than cycle down code code check threshold value.
Wherein, cycle down code code check threshold value is related to target bit rate, such as cycle down code code check threshold value can be object code 10 or so of rate, or 20 or so the percent of target bit rate, those skilled in the art can be set as needed It is fixed.Cycle down code code check threshold value is bigger, carries out the code check of the second transcoded video file that cycle down code obtains and levels off to object code Rate.
Step 307:When the code check gap is less than cycle down code code check threshold value, it is constant to obtain described second by following formula The parameter of quantization:
crf2=crf+k* (n-1)+k/2
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number.
Step 308:When the code check gap is more than or equal to cycle down code code check threshold value, described is obtained by following formula The parameter of two constant quantizations:
crf2=crf+nk
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number.
In the present embodiment, by obtaining to obtaining video after the first transcoded video file progress secondary cycle down code second from the bottom The code check of file and the code check gap of target bit rate, and by code check gap compared with cycle down code code check threshold value, to second The parameter of constant quantization enters Mobile state adjustment, improves control ability of the video file transcoding relative to target bit rate, makes transcoding The code check of video file afterwards is more nearly target bit rate.
Referring to Fig. 4, for the logical flow chart of video file code-transferring method one embodiment of the present invention, this method includes:
Step 401:Video file is encoded using the parameter crf of the first constant quantization, obtains the first transcoded video File, the code check of the first transcoded video file is R0
Step 402:Judge the code check of the first transcoded video file for R0Whether target bit rate R is less thane, if to video The transcoding of file terminates, if not into step 403.
Step 403:Drop code for the first time, the code of obtained video file are carried out to the first transcoded video file using crf+k Rate is R1, wherein, crf is the parameter of the first constant quantization, and k is the constants of cycle down code constant quantization.
Step 404:Judge whether the code check for the video file that the first transcoded video file progress cycle down code obtains is less than Target bit rate, i.e., whether R1*pow(r1,n)<=Re, wherein, r1For cycle down code check, R1The is carried out for the first transcoded video file Once drop code obtains the code check of video file, R0For first code check, n is cycle down code number, if it is, carrying out step 405, if not, increase cycle down code frequency n ++, continue cycle down code, repeat step 404.
Step 405:Obtain and obtain video file after carrying out secondary cycle down code second from the bottom to the first transcoded video file The code check gap of code check and target bit rate, i.e. △ Rn-1=︱ Rn-1-Re︱, wherein, Rn-1To be fallen to the first transcoded video file The code check of the video file obtained after several second of cycle down codes, △ Rn-1For the code check gap, ReFor the target bit rate.
Step 406:Judge whether code check gap is less than cycle down code code check threshold value, i.e., whether △ Rn-1<S, wherein, S is to follow Code code check threshold value drops in ring, when the code check gap is less than cycle down code code check threshold value, into step 407, when the code check is poor During away from more than or equal to cycle down code code check threshold value, into step 408.
Step 407:The parameter of second constant quantization is obtained by following formula:
crf2=crf+k* (n-1)+k/2
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number.
Step 408:The parameter of second constant quantization is obtained by following formula:
crf2=crf+nk
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number.
Step 409:Drop code is carried out to the first transcoded video file using the parameter of second constant quantization, obtained The second transcoded video file.
Referring to Fig. 5, for the structure chart of video file transcoding device one embodiment of the present invention, the device includes:
Coding module 501, the video file is encoded for the parameter using the first constant quantization, obtains first Transcoded video file;
Parameter prediction module 502, for when the code check of the first transcoded video file is more than target bit rate, prediction second to be permanent The parameter of quantification, the parameter of second constant quantization make regarding after drop code to carry out drop code to the first transcoded video file The code check of frequency file is less than the parameter of the constant quantization used during target bit rate;
Code module 503 is dropped, the first transcoded video file is carried out for the parameter using second constant quantization Code is dropped, obtains the second transcoded video file.
Preferably, the parameter prediction module includes:
Cycle down code parameter prediction unit 504, for when the code check of the first transcoded video file is more than target bit rate, profit The parameter of the second constant quantization is predicted with cycle down code, the parameter of second constant quantization is that the first transcoded video file is entered Row cycle down code, the code check of the video file after cycle down code is set to be less than the parameter of the constant quantization used during target bit rate.
Preferably, the cycle down code parameter prediction unit 504 is additionally operable to:
When first code check is more than target bit rate, the circulation that cycle down code is carried out to the first transcoded video file is calculated Code check drops;
The video text that cycle down code is carried out to the first transcoded video file and is obtained is calculated according to the cycle down code check The code check of part is less than drop code number during target bit rate;
The parameter of second constant quantization is obtained using the drop code number.
Preferably, the cycle down code parameter prediction unit 504 is additionally operable to:
Obtain and obtain the code check and mesh of video file after carrying out secondary cycle down code second from the bottom to the first transcoded video file The code check gap of coding rate;
Judge whether the code check gap is less than cycle down code code check threshold value;
When the code check gap is less than cycle down code code check threshold value, the ginseng of second constant quantization is obtained by following formula Number:
crf2=crf+k* (n-1)+k/2
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number;
When the code check gap is more than or equal to cycle down code code check threshold value, second constant basis is obtained by following formula The parameter of change:
crf2=crf+nk
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is that cycle down code is constant The constants of quantization, n are cycle down synchronous codes number.
It should be noted that:The video file transcoding device that above-described embodiment provides is when stating function in realization, only more than The division progress of functional module is stated for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional module is completed, i.e., the internal structure of equipment is divided into different functional modules, with complete it is described above whole or Partial function.In addition, the video file transcoding device that above-described embodiment provides belongs to same with video file code-transferring method embodiment One design, its specific implementation process refer to embodiment of the method, repeated no more here.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more The shape for the computer program product that usable storage medium is implemented on (including but is not limited to magnetic disk storage and optical memory etc.) Formula.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (8)

1. a kind of video file code-transferring method, it is characterised in that comprise the following steps:
The video file is encoded using the parameter of the first constant quantization, obtains the first transcoded video file;
When the code check of the first transcoded video file is more than target bit rate, calculates and the first transcoded video file is circulated The cycle down code check of code drops;
Calculated according to the cycle down code check and the video file that cycle down code obtains is carried out to the first transcoded video file Code check is less than drop code number during target bit rate;
The parameter of the second constant quantization is obtained using the drop code number;
Drop code is carried out to the first transcoded video file using the parameter of second constant quantization, obtains the second transcoded video File.
2. the method as described in claim 1, it is characterised in that described calculate carries out cycle down code to the first transcoded video file Cycle down code check, including:
Using crf+k to the first transcoded video file carry out for the first time drop code, wherein, crf be the first constant quantization parameter, k For the constants of cycle down code constant quantization;
The cycle down code check is obtained using following formula,
r1=R1/R0
Wherein, r1For cycle down code check, R1Drop code for the first time, which is carried out, for the first transcoded video file obtains the code check of video file, R0For the first code check.
3. method as claimed in claim 2, it is characterised in that the step is calculated to described the according to the cycle down code check The code check for the video file that one transcoded video file progress cycle down code obtains is less than drop code number during target bit rate, including:
Obtain carrying out the first transcoded video file the code check for the video file that cycle down code obtains using following formula,
R1*pow(r1,n)
Wherein, n is cycle down synchronous codes number;
R is worked as in acquisition1*pow(r1,n)<=ReWhen n number, wherein, ReFor the target bit rate, the n is to described first turn The code check for the video file that code video file progress cycle down code obtains is less than drop code number during target bit rate.
4. method as claimed in claim 3, it is characterised in that the step obtains second perseverance using the drop code number The parameter of quantification, including:
The parameter of second constant quantization is obtained according to following formula,
crf2=crf+nk
Wherein, crf2For the parameter of the second constant quantization.
5. method as claimed in claim 2, it is characterised in that the parameter crf=24 of first constant quantization, the circulation The constants k=4 of code constant quantization drops.
6. the method as described in claim 1, it is characterised in that the step obtains second perseverance using the drop code number The parameter of quantification, including:
Obtain and obtain the code check and object code of video file after carrying out secondary cycle down code second from the bottom to the first transcoded video file The code check gap of rate;
Judge whether the code check gap is less than cycle down code code check threshold value;
When the code check gap is less than cycle down code code check threshold value, the parameter of second constant quantization is obtained by following formula:
crf2=crf+k* (n-1)+k/2
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is cycle down code constant quantization Constants, n is cycle down synchronous codes number;
When the code check gap is more than or equal to cycle down code code check threshold value, second constant quantization is obtained by following formula Parameter:
crf2=crf+nk
Wherein, crf2For the parameter of the second constant quantization, crf is the parameter of the first constant quantization, and k is cycle down code constant quantization Constants, n is cycle down synchronous codes number.
7. method as claimed in claim 6, it is characterised in that the step obtains carries out inverse to the first transcoded video file The code check of video file and the code check gap of target bit rate are obtained after second of cycle down code, including:
The code of the video file to being obtained after the first transcoded video file progress secondary cycle down code second from the bottom is obtained using following formula Rate,
Rn-1=R1*pow(r1,n-1)
Wherein, Rn-1For the code check for the video file for the first transcoded video file obtain after secondary cycle down code second from the bottom, r1For cycle down code check, R1To carry out the code check of the video file after drop code for the first time to the first transcoded video file, n is circulation Synchronous codes number drops;
The code check gap is obtained using following formula,
△Rn-1=︱ Rn-1-Re
Wherein, △ Rn-1For the code check gap, ReFor the target bit rate.
8. method as claimed in claim 6, it is characterised in that the cycle down code code check threshold value is the percent of target bit rate Ten.
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 CN103763559A (en) 2014-04-30
CN103763559B true 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)

Families Citing this family (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
CN104618734B (en) * 2015-01-29 2019-02-01 华为技术有限公司 The code-transferring method and device of video code flow under same protocol type
CN107846595B (en) * 2016-09-19 2021-08-06 阿里巴巴集团控股有限公司 Video coding method and video coder
CN107846590B (en) * 2016-09-19 2020-09-08 阿里巴巴集团控股有限公司 Video coding method and video coder
CN109660825B (en) * 2017-10-10 2021-02-09 腾讯科技(深圳)有限公司 Video transcoding method and device, computer equipment and storage medium
CN108540807B (en) * 2018-02-28 2019-05-31 北京达佳互联信息技术有限公司 The method, apparatus and terminal of video file transcoding
CN110113660B (en) * 2019-02-27 2021-08-06 咪咕视讯科技有限公司 Method, device, terminal and storage medium for transcoding time length estimation

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101523915A (en) * 2005-09-22 2009-09-02 高通股份有限公司 Two pass rate control techniques for video coding using a MIN-MAX approach
CN101594525A (en) * 2008-05-31 2009-12-02 华为技术有限公司 The acquisition methods of quantization parameter, device and transcoder

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101523915A (en) * 2005-09-22 2009-09-02 高通股份有限公司 Two pass rate control techniques for video coding using a MIN-MAX approach
CN101594525A (en) * 2008-05-31 2009-12-02 华为技术有限公司 The acquisition methods of quantization parameter, device and transcoder

Also Published As

Publication number Publication date
CN103763559A (en) 2014-04-30

Similar Documents

Publication Publication Date Title
CN103763559B (en) A kind of video file code-transferring method
JP6928041B2 (en) Methods and equipment for processing video
CN110637460B (en) Visual quality preserving quantitative parameter prediction using deep neural networks
EP3707906B1 (en) Electronic apparatus and control method thereof
CN104735454B (en) Method and apparatus for encoding and decoding image by using large transform unit
RU2510079C2 (en) Method of compressing digital images using fixed number of bits per block
CN105744271B (en) A kind of method for video coding and device
KR20130018413A (en) An image compression method with random access capability
CN103313047B (en) A kind of method for video coding and device
CN106664437A (en) Adaptive bitrate streaming for wireless video
EP3993413A1 (en) Method and device for determining video bitrate, computer apparatus, and storage medium
US11259029B2 (en) Method, device, apparatus for predicting video coding complexity and storage medium
CN107005713A (en) Apply the method for video coding and equipment and video encoding/decoding method and equipment of edge type skew
CN103051901A (en) Video data coding device and video data encoding method
CN103501438B (en) A kind of content-adaptive method for compressing image based on principal component analysis
CN107770525A (en) A kind of method and device of Image Coding
US10536696B2 (en) Image encoding device and image encoding method
CN104639946A (en) Apparatus and method for processing image
CN105898296A (en) Video coding frame selection method and device
CN107027030A (en) A kind of code rate allocation method and its equipment
JP2009165124A5 (en)
CN103609114B (en) Code device, decoding apparatus, coding/decoding system, coded method and coding/decoding method
CN110536087A (en) Electronic equipment and its motion profile picture synthesis method, device and embedded equipment
CN106231307B (en) A kind of compression of images intra-coding prediction method and its hardware realization
CN107820084A (en) A kind of video-aware coding method and device

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

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.

TR01 Transfer of patent right