Film converting edition apparatus and method thereof
Technical field
The present invention relates to a kind of film converting edition apparatus and method thereof, relate in particular to a kind of film converting edition apparatus and method thereof that is applicable to mobile communication terminal.
Background technology
Along with science and technology development, communication science and technology is maked rapid progress, mobile communication mobile phone is widely used in daily life and the study by people, people are by mobile communication mobile phone and Internet phone-calling or the breath of sending short messages mutually, its people's distance each other that not only furthered greatly, the contact and the information interchange of returning people bring great convenience.Many high-end mobile phones all possess the function of movie at present.But because phone memory is limited, the film that the space reaches the DVD/VCD/RM form of hundreds of MB even last GB often can't load phone memory; In addition, be subjected to the restriction (as there not being corresponding decoder) of cell phone software function, often can not play the film of these forms; Once more, limited by the mobile phone CPU frequency, promptly enable to play the film of these forms, effect is also very undesirable.
See also Fig. 1, existing film conversion device all is to be loyal to basically under the prerequisite of original film, carries out audio frequency and video shunting decoding, and recompile generates new file then, these crossover tools are all just finished the conversion of file format, and its basic procedure is as follows: the input original film; Judge film format; Decoding; Coding; Generate new file.
Yet, above-mentioned existing film conversion device because its starting point normally at PC, rather than at mobile phone, therefore the film that comes out of conversion on mobile phone, can't play usually or result of broadcast undesirable, its ease for use is poor, the low and shortcoming editting function of conversion quality.
Summary of the invention
In order to overcome above-mentioned the deficiencies in the prior art, and provide a kind of film converting edition apparatus and method thereof, thereby it is poor to solve present film conversion device ease for use, the problem that conversion quality is low.
The technical solution adopted in the present invention is: a kind of film converting edition apparatus is provided, it comprises the decoder module that is used for original film is decoded into voice data and video data, be used for the audio, video data processing module that described voice data and video data are handled and be used for the voice data after handling is become with video data encoding the coding module of file destination, described audio, video data processing module comprises that video data is filled or the reduction unit, the user fills or reduces the unit and fills or reduce the length and width of video data are corresponding according to the screen aspect ratio difference of original film length-width ratio and playback terminal by described video data, described audio, video data processing module also comprises dubs the speech selection unit, and the user selects at least a the coding by the described speech selection unit of dubbing to the original film that has multilingual and dub.
Described audio, video data processing module also comprises the video superimpose unit, and the user is by described video superimpose unit at least one character string of stack or width of cloth picture in the specific region of the file video that conversion is come out.
Described audio, video data processing module comprises that also fragment separates the unit, and the user separates the unit is provided with a plurality of conversions in the specific region of changing the file video that comes out the starting and ending time by fragment.
Described audio, video data processing module also comprises seamlessly transitting to be handled and merge cells, is used for the first frame video that above-mentioned fragment separates the last frame video of the last fragment of a plurality of video segments of unit output and next fragment is fade-in fade-out handling and will being merged into a new video file through a plurality of fragments handled of being fade-in fade-out.
A kind of film conversion edit methods, it is decoded into voice data and video data by a decoder module with original film, comprise successively and open original film, carrying out form judges, the audio frequency and video shunting, the step of decoding, by an audio, video data processing module described voice data and video data are handled, voice data after will handling by a coding module becomes file destination with video data encoding, system judges whether conversion finishes, if then synthetic new audio/video file, then return decoding step if not, before described coding, also comprise successively: system requirements and destination file format according to playback terminal carry out conversion processing respectively to decoded audio, video data; Dub by one and to carry out audio coding by coding module after the speech selection unit is selected to dub speech selection to voice data according to the user; Whether the length-width ratio behind calculating original film length-width ratio and the convergent-divergent differs too big, if then reduce or fill.
Judge whether to change in described system and also comprise by a video superimpose unit at least one character string of stack or width of cloth picture step in the file video specific region that conversion is come out before the end step, comprise: the user imports a character string or imports a width of cloth bitmap, and sets the coordinate of overlap-add region; System creation one monochrome bitmap, bitmap background are a specific rgb value, and the bitmap content is this character string or the rgb value that imports bitmap; Video data in each decoded frame of video overlap-add region is carried out searching loop, and and the rgb value set in advance compare, if identical with the rgb value of setting then replace, otherwise keep former data constant.
Before judging to change end step whether, described system comprises also that the specific region that separates the file video that comes out in conversion the unit by a fragment is provided with the step of the starting and ending time of a plurality of conversions, comprise: the user is provided with the starting and ending time of a plurality of conversions, system will preserve these tabulations change-over time, and navigate to each fragment successively.
Before described system judges to change end step whether, also comprise by one seamlessly transitting processing unit, comprising: the size of the rgb value that setting is fade-in fade-out to video processings of being fade-in fade-out of the first frame video of the last frame video of a fragment in the above-mentioned fragment and next fragment; Calculate the video frame number that need to increase, and circulate successively according to the rule of successively decreasing or increase progressively and to obtain the image data of every frame; Encode and go in the file of writing generation.
Beneficial effect of the present invention is: the unit is filled or reduced to film converting edition apparatus of the present invention and method thereof by a video data is set, fill or reduce the length and width of video data are corresponding according to the screen aspect ratio difference of original film length-width ratio and playback terminal, but removal of images distortion, its ease for use is strong, the conversion quality height.
Description of drawings
Fig. 1 is the schematic flow sheet of existing film conversion edit methods;
Fig. 2 is the principle schematic of film converting edition apparatus of the present invention;
Fig. 3 is the schematic flow sheet of film conversion edit methods of the present invention;
Fig. 4 is the schematic diagram that film conversion edit methods of the present invention is filled automatically;
Fig. 5 is the schematic diagram that film converting edition apparatus of the present invention carries out video superimpose.
Embodiment
See also Fig. 2, film converting edition apparatus of the present invention comprises film decoder module 10, audio, video data processing module 20 and coding module 30, its form film conversion such as DVD/VCD/RM can be become can be on mobile phone the film (present embodiment is the mp4 form) of smooth playing, and can realize conversion in batches simultaneously, in transfer process, carry out frame per second control, track selecting, decoded video data is carried out video editing, video scaling is filled in the time of video scaling automatically, processing such as reduction.
See also Fig. 3, the method that film converting edition apparatus of the present invention carries out the film conversion editor may further comprise the steps:
301. open original film;
Judge that present embodiment is an example with three kinds of forms of DVD/VCD/RM 302. carry out form;
Become voice data and video data 303. carry out audio/video decoding by 10 pairs of original films of decoder module;
304. audio, video data processing module 20 is carried out conversion processing according to the system requirements and the destination file format of mobile communication terminal respectively to decoded audio, video data, the voice data of present embodiment converts 22.56k*2*16 form and execution in step 305 to, and video data converts YUV420 form and execution in step 306 to;
305. audio, video data processing module 20 is dubbed speech selection unit (indicate) by one and is selected to dub speech selection (to having the film that multilingual dubs Chinese and English are for example arranged simultaneously, the user can select any to encode) back to voice data according to the user and carry out audio coding by coding module 30;
306. whether the length-width ratio of calculating behind original film length-width ratio and the convergent-divergent differs too big, if carry out video superimpose again after then reducing automatically or filling, consistent with the video length-width ratio after guaranteeing original film video length-width ratio and encoding, prevent that distortion from appearring in video pictures, and carry out the intersegmental processing back of being fade-in fade-out of multi-disc and carry out video coding by coding module 30;
307. system judges whether conversion finishes, if execution in step 308 is then then returned step 302 if not;
308. synthetic new audio/video file, present embodiment is the mp4 form.
Be appreciated that, in above-mentioned transfer process, the audio, video data processing module 20 of film converting edition apparatus of the present invention comprises that video data automatically fills or reduce unit, video superimpose unit, fragment and separate the unit and seamlessly transit prevent distortion, video superimpose, the fragment that processing unit (indicating) is used to carry out film conversion edit methods of the present invention and separate and seamlessly transit the step of a plurality of conversion fragments.
When the screen aspect ratio of original film length-width ratio and target mobile phones differs greatly, for preventing the video pictures distortion, if the user selects to fill automatically by the interface, if the value of mobile terminal display screen length-width ratio than the value of original film length-width ratio greatly then show it is wide not enough, the video data of film converting edition apparatus of the present invention and method is filled automatically or is reduced the unit and promptly fill wide, passing ratio calculates the wide line number that needs filling, fill then, if instead this moment, the value of mobile phone display screen length-width ratio was long not enough than original film length and width ratio little then showing, in like manner the progress row is filled (see also Fig. 4, wherein the black part promptly is the part of filling); If the user selects to reduce automatically by the interface, if mobile phone display screen length-width ratio original film length-width ratio greatly then show and need reduce the progress row, passing ratio calculates the line number that will reduce, video data is filled automatically or is reduced the unit symmetry and reduce then, otherwise then in like manner reduces wide.
See also Fig. 5, if the user wants video superimpose unit character string of stack or width of cloth picture in the file video specific region that conversion is come out by film converting edition apparatus of the present invention, then at first the user imports a character string, or import a width of cloth bitmap, and set the coordinate of overlap-add region, a width of cloth monochrome bitmap will be created by system, the bitmap background is certain specific rgb value, the bitmap content is this character string or the rgb value that imports bitmap, then the video data in each decoded frame of video overlap-add region is carried out searching loop, and and the rgb value of setting in advance compares, if identical with the rgb value of setting then replace, otherwise keep former data constant.Be appreciated that, the user also can set a plurality of character strings and several bitmaps, and character string and bitmap are added on the different frame of video according to certain sort algorithm and random algorithm, just can show multi-layer video when the file that comes out of coding is play like this, increase ornamental and recreational greatly.
For very long film some wonderfuls are often arranged, and the user only wants to watch these fragments sometimes, at this moment the user can separate the starting and ending time that the unit is provided with a plurality of conversions by the fragment of film converting edition apparatus of the present invention and method, system will preserve these tabulations change-over time, and navigate to each fragment successively, excessively natural and tripping in order to make between a plurality of fragments, the processing unit that seamlessly transits of film converting edition apparatus of the present invention and method can be to the processing of being fade-in fade-out of the first frame video of the last frame video of a last fragment and next fragment, specific practice is at first setting the size of the rgb value that video is fade-in fade-out, as the processing of fading out of the last frame video data to a last video segment, up to all being black, to the processing of fading in of the first frame video data of next video segment, be incremented to the original value of these frame data by black, calculate the video frame number that needs increase then, and according to successively decreasing or the rule that increases progressively circulates successively and obtains the image data of every frame, and go excessively very level and smooth in the time of to make the synthetic file of a plurality of video segments like this between the fragment in the file of writing generation of encoding.
Be appreciated that, can be in above-mentioned transfer process by the restriction video frame rate, optimize encoder, reduce the volume of the mp4 file of generation greatly according to mobile phone screen size reduction video image, making film to load is stored in the mobile phone, to the taking of CPU, and, make the user can carry out personalized processing in the time of also can reducing simultaneously the decoding of mobile phone playout software by decoded video data is carried out video editing; In addition, film converting edition apparatus of the present invention and method also are applicable to portable electron devices such as PDA or PMP.