A kind of multi-media transcoding dispatching method and device
Technical field
The present invention relates to multi-media processing field, espespecially multi-media transcoding dispatching method and device.
Background technique
Internet is universal with each class of electronic devices, so that the extensive degree of video transmission is unprecedented.In one video
Hold and needs repeatedly, concurrently to play in multi-platform, multiple terminals.
Patent document CN 102802024A on November 28th, 2012 it is a kind of server end realize code-transferring method,
Described in server end include host terminal system and the transcoding processing subsystem with multiple core cpus, which comprises
The host terminal system passes through the data code flow attribute information of data flow after call parameters configuration definition transcoding;The host side
Subsystem gives data stream to be transcoded to the transcoding processing subsystem;The transcoding processing subsystem receives described to be transcoded
Data flow is decoded the data flow to be transcoded, obtains the data flow yuv data stream with brightness and chrominance representation;It is described
Transcoding processing subsystem obtains the data code flow attribute information from the host terminal system, according to the data code flow attribute
Information encodes the yuv data stream, and by the data stream after coding to network.
Patent document CN 103024445A discloses the multi-media transcoding method and cloud clothes in a kind of cloud on April 3rd, 2013
Business device, the method comprise the steps that Cloud Server is decoded video file to obtain the multiple of video file
Picture frame;Cloud Server judges that each of multiple images frame is focus picture frame or background image frame respectively;If it is focus
Picture frame, then Cloud Server obtains focus area and the background area of focus picture frame, and carries out lossless and lossy coding respectively,
With the focus picture frame after being encoded;If it is background image frame, then lossy coding is carried out to background image frame, to be compiled
Background image frame after code;And the focus picture frame after coding is synthesized into transcoded video file with the background image frame after coding
And it states transcoded video file and is sent to mobile terminal.The program can improve transcoded video file while high efficiency transcoding
Picture quality, the video file of different code rates can be provided according to different terminals, promote user experience.
Currently, there is response when responding rapidly to multiple user, changeable video playing demand in video service provider
Not in time, the problem of responding unstable quality.
Summary of the invention
The present invention provides one kind for promoting transcoding efficiency, improves the multi-media transcoding dispatching method and dress of user experience
It sets.
The purpose of the present invention is achieved through the following technical solutions:
A kind of multi-media transcoding dispatching method, comprising steps of
Classification processing is carried out to original multimedia file according to original multimedia file and destination multimedia file attribute;
Transcoding processing is carried out to original multimedia file by classification.
Further, described the step of carrying out transcoding processing to original multimedia file by classification, includes:
Original multimedia file is cut at least two segments;
Each segment carries out transcoding respectively;
Segment after transcoding is merged, destination multimedia file is formed.
Further, described the step of original multimedia file is cut at least two segments, includes:
Judge the code rate of original multimedia file, if code rate is uniform, is carried out by the principle of the size equalization of each segment
Cutting;If code rate is uneven, the time consumed according to transcoding is approximately uniform for principle progress cutting.
Further, the initial multimedia being sliced to needs is further comprised the steps of: before to original multimedia file cutting
File is pre-processed.
Further, it includes: by initial multimedia text that described pair, which needs the video file being sliced to carry out pretreated step,
Part is converted into preset reference format.
Further, it includes: that each segment is assigned to different turn that each segment carries out the step of transcoding respectively
Code server carries out transcoding.
Further, described the step of carrying out transcoding processing to original multimedia file by classification includes: by original more matchmakers
Body file directly carries out transcoding.
Further, it is described according to original multimedia file and destination multimedia file attribute to original multimedia file into
The step of row classification processing includes: the size and file format for judging original multimedia file;Original multimedia file is carried out
Classification;
It is described to include: to the step of original multimedia file progress transcoding processing by classification
If the size of original multimedia file is lower than threshold value and file format meets preset reference format, directly turn
Code;
If the file format of original multimedia file does not meet preset reference format, original multimedia file is carried out
Transcoding is carried out after pretreatment;
If the size of original multimedia file is more than threshold value, but file format meets preset reference format, will be original
Multimedia file is cut at least two segments, and each segment is assigned to different transcoding servers and carries out transcoding;By transcoding
Segment afterwards merges, and forms destination multimedia file;Store destination multimedia file;
If the size of original multimedia file is more than threshold value and file format does not meet preset reference format, will be original
Multimedia file is converted into preset reference format, and original multimedia file is then cut at least two segments, will be each
Segment is assigned to different transcoding servers and carries out transcoding;Segment after transcoding is merged, destination multimedia file is formed;
Store destination multimedia file;
Described the step of original multimedia file is cut at least two segments includes: to judge original multimedia file
Code rate carries out cutting by the principle of the size equalization of each segment if code rate is uniform;If code rate is uneven, disappeared according to transcoding
The time of consumption is approximately uniform for principle progress cutting.
A kind of multi-media transcoding dispatching device, comprising:
Sorter: for being carried out according to original multimedia file and destination multimedia file attribute to original video files
Classification processing;
Transcoding device: for carrying out transcoding processing to original multimedia file by classification.
Further, the transcoding device further include:
Preprocessor: for original multimedia file to be converted into preset reference format;
Food slicer: for original multimedia file to be cut at least two segments;
Scheduler: for distributing multimedia file to be transcoded for the working performance of more transcoding servers;
Transcoding server: for carrying out transcoding to multimedia file;
Combiner: for merging the segment after transcoding to form destination multimedia file;
Multimedia storage server: for storing destination multimedia file.
The present invention is determined transcoding strategy by class by classifying original multimedia file, can thus be optimized and be turned
Code server, realizes fast transcoding under the premise of not increasing transcoding server hardware spending by Optimized Operation strategy.
The present invention can cause video to call situation complicated, video kind when responding rapidly to multiple user, changeable video playing demand
In the case where class abundance, it still can guarantee video playing smoothness, improve user experience.
Detailed description of the invention
Fig. 1 is the flow diagram of one multi-media transcoding dispatching method of the embodiment of the present invention;
Fig. 2 is the schematic illustration of one multi-media transcoding dispatching device of the embodiment of the present invention;
Fig. 3 is the flow diagram of two multi-media transcoding dispatching method of the embodiment of the present invention;
Fig. 4 is the schematic illustration of three multi-media transcoding dispatching device of the embodiment of the present invention;
Fig. 5 is the schematic illustration of four video code conversion dispatching device of the embodiment of the present invention.
Wherein: 10, sorter;21, food slicer;22, scheduler;23, transcoding server;24;Combiner;25, pre- place
Manage device;26, multimedia storage server.
Specific embodiment
The invention will be further described with preferred embodiment with reference to the accompanying drawing.
Embodiment one
As shown in Figure 1, the multi-media transcoding dispatching method of present embodiment comprising steps of
S110, original multimedia file is carried out at classification according to original multimedia file and destination multimedia file attribute
Reason;
S120, transcoding processing is carried out to original multimedia file by classification.
As shown in Fig. 2, the multi-media transcoding dispatching device of present embodiment, comprising:
Sorter 10: it is used for according to original multimedia file and destination multimedia file attribute to original multimedia file
Carry out classification processing;
Transcoding device 20: for carrying out transcoding processing to original multimedia file by classification.
The present invention is determined transcoding strategy by class by classifying original multimedia file, can thus be optimized and be turned
Code server, realizes fast transcoding under the premise of not increasing transcoding server hardware spending by Optimized Operation strategy.
The present invention can cause video to call situation complicated, video kind when responding rapidly to multiple user, changeable video playing demand
In the case where class abundance, it still can guarantee video playing smoothness, improve user experience.Unless otherwise specified, of the invention
The multimedia file is generally video and/or audio file.
Embodiment two
As shown in figure 3, present embodiment discloses a kind of multi-media transcoding dispatching method, comprising steps of
S310, original multimedia file is obtained;
S320, transcoding processing is carried out to original multimedia file by classification.
Wherein, step S320 is roughly divided into following four processing mode:
If S321, original multimedia file are lower than threshold value and file format meets preset reference format, direct transcoding.
If the file format of S322, original multimedia file does not meet preset reference format, to initial multimedia text
Part carries out transcoding after being pre-processed.
If the size of S323, original multimedia file is more than threshold value, but file format meets preset reference format, will
Original multimedia file is cut at least two segments, and each segment is assigned to different transcoding servers and carries out transcoding;It will
Segment after transcoding merges, and forms destination multimedia file;Store destination multimedia file.
If the size of S324, original multimedia file is more than threshold value and file format does not meet preset reference format;
Original multimedia file is converted into preset reference format;Then original multimedia file is cut at least two segments,
Each segment is assigned to different transcoding servers and carries out transcoding;Segment after transcoding is merged, the more matchmakers of target are formed
Body file;Store destination multimedia file.
Described the step of original multimedia file is cut at least two segments includes: to judge original multimedia file
Code rate carries out cutting by the principle of the size equalization of each segment if code rate is uniform;If code rate is uneven, disappeared according to transcoding
The time of consumption is approximately uniform for principle progress cutting.
Present embodiment is complicated in view of system source video sequence to be processed, format and the situation multiplicity of video, it is possible to right
System processing video content brings burden or even certain special formats to may cause subsequent processing module and can not handle, therefore,
For such video content, video format conversion is carried out by preprocessor, is converted into reference format appropriate, is passed through
Such conversion sometimes even can directly reduce video capacity, reduce system processing load, even if capacity changes not
Greatly, also can solve video content System Back-end possibly can not identified problem.The present invention is by by original multimedia file
Classify, transcoding strategy is determined by class, and by the load balance of more transcoding servers, can thus optimize transcoding service
Device realizes fast transcoding under the premise of not increasing transcoding server hardware spending by Optimized Operation strategy.The present invention
Video can be caused to call situation complicated, video genre source when responding rapidly to multiple user, changeable video playing demand
In situation abundant, it still can guarantee video playing smoothness, improve user experience.
Embodiment three
As shown in figure 4, multi-media transcoding dispatching device disclosed in present embodiment includes: sorter, with sorter
The transcoding device of coupling.
The scheduling that the transcoding device further includes the food slicer coupled with classifier, is coupled respectively with classifier and food slicer
Device, the transcoding server coupled with scheduler, the combiner coupled with transcoding server, respectively with transcoding server and combiner
Couple multimedia storage server;Preprocessor is additionally provided between the classifier and food slicer;
Sorter classifies to original video files according to original multimedia file and destination multimedia file attribute
Processing;The food slicer is used to original multimedia file being cut at least two segments;The scheduler is used to turn for more
The working performance of code server distributes multimedia file to be transcoded;The preprocessor is for converting original multimedia file
At preset reference format;The transcoding server is used to carry out transcoding to multimedia file;The combiner is used for transcoding
Segment afterwards merges to form destination multimedia file;The multimedia storage server is for storing destination multimedia file.
Present embodiment is complicated in view of system source video sequence to be processed, format and the situation multiplicity of video, it is possible to right
System processing video content brings burden or even certain special formats to may cause subsequent processing module and can not handle, therefore,
For such video content, video format conversion is carried out by preprocessor, is converted into reference format appropriate, is passed through
Such conversion sometimes even can directly reduce video capacity, reduce system processing load, even if capacity changes not
Greatly, also can solve video content System Back-end possibly can not identified problem.Scheduler can be flexible according to situation is met
Arrange different transcoding servers to carry out parallel processing to the segment of slice respectively, can to greatest extent using hardware resource and
Improve transcoding efficiency.
Example IV
Present embodiment is illustrated so that original multimedia file is video file as an example.
As shown in Figure 5.Multi-media transcoding dispatching device disclosed in present embodiment includes following 7 kinds of devices:
Classifier.Classifier is responsible for according to original audio-video document attribute, target sound video file attributes to video processing
Mode is classified.In general, there is 3 kinds of classifications: direct transcoding;Transcoding is sent after fragment;Fragment send transcoding again after pretreatment.
Preprocessor.Preprocessor is responsible for pre-processing the video file that needs are sliced.Pretreated file can
To turn to go to be sliced.Purpose:, the format and situation multiplicity of video complicated in view of system source video sequence to be processed, it is possible to being
System processing video content brings burden or even certain special formats to may cause subsequent processing module and can not handle, therefore, right
In such video content, video format conversion is carried out by preprocessor, reference format appropriate is converted into, by this
The conversion of sample sometimes even can directly reduce video capacity, reduce system processing load, even if capacity changes less,
Also can solve video content System Back-end possibly can not identified problem.
Food slicer.Food slicer is responsible for video file being divided into multiple segments according to rule.
If code rate is uniform, cutting can be divided equally to video
If code rate is uneven, code rate when being movement or is static such as video content is different, in cutting, is consumed according to transcoding
Time it is approximately uniform for principle carry out cutting.
Scheduler.The working performance that scheduler is responsible for more transcoding servers distributes video file to be transcoded.
Transcoding server.There are more transcoding servers.Transcoding server complete video file format conversion, including decoding and
Encode 2 processes.
The working performance of more transcoding servers can be variant, then the load balance of more transcoding servers is by such as needing
Slice, then food slicer and scheduler are completed jointly, are not needed such as to be sliced, are then mainly completed by scheduler
Combiner.Belong to multiple fragments an of video file after transcoding, is assembled into one section completely by combiner
Video.
Video storage server.Video storage server is responsible for storing the video file of various formats.
The code-transferring method work step of present embodiment Optimized Operation strategy is as follows:
The first step, according to original audio-video document attribute, target sound video file attributes, classifier determines transcoding mode.
In general, there is 3 kinds of transcoding strategies: a, such as multiple video file contents are less, directly send scheduler.B, such as multiple videos
File content is more, send scheduler after sending slicing device to be sliced.C is not suitable for direct slicing, then if video format is lack of standardization
Send slicing device and scheduler after original video files being pre-processed into preprocessor.
Second step, food slicer and scheduler are sliced according to the working efficiency of each transcoding server, then will be after slice
Video distribution gives the processing of corresponding transcoding server;
Third step, after transcoding server transcoding, the multiple files for thering is slice to identify group in combiner be combined into one it is complete
File after output to video memory;The file for not being sliced mark is directly output to video server.
The present invention causes video to call situation complicated when responding rapidly to multiple user, changeable video playing demand, depending on
In the case where frequency type abundance, it still can guarantee video playing smoothness, improve user experience.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that
Specific implementation of the invention is only limited to these instructions.For those of ordinary skill in the art to which the present invention belongs, exist
Under the premise of not departing from present inventive concept, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to of the invention
Protection scope.