A kind of video editing method and terminal
Technical field
The invention belongs to video file editor field, more particularly to a kind of video editing method and terminal.
Background technology
In order that frame of video, audio frame, caption strips are to deserved more accurate, it usually needs the video file of making is compiled
Volume.
In the prior art, when editor enters edlin to video file, mainly by watching the video file repeatedly
To determine how editor, when editor only finishes watching whole video file or finishes watching some video paragraphs, can learn how
Edit the video file.This method is in the longer video file of edit session length, because editor can not be in a short time
The whether one-to-one information of specific frame in whole caption informations and the specific caption strips of acquisition and video is obtained, therefore can not
The corresponding frame in video file is changed by changing caption strips, so as to need to consume editor's more time, can not be realized
Quick editor.
The content of the invention
The embodiments of the invention provide a kind of video editing method and terminal, it is intended to solve existing video editing method without
Method changes the corresponding frame in video file by changing caption strips, the problem of so as to need to consume editor's more time.
The embodiment of the present invention is achieved in that a kind of video editing method, and methods described comprises the steps:
Read video file, pre-stored subtitle file, pre-stored mapping table;The caption strips that the subtitle file includes
With the video frame synchronization of the video file;The mapping table is stored with the corresponding relation of caption strips and frame of video;
Caption strips edit instruction is received, the caption strips edit instruction includes caption strips removal instruction, caption strips are replicated and referred to
Make, caption strips reorder instruction;
Parse the caption strips edit instruction;
Using analysis result and the mapping table as the video file read according to editor.
The another object of the embodiment of the present invention is to provide a kind of video editing terminal, and the video editing terminal includes:
Information reading unit, for reading video file, pre-stored subtitle file, pre-stored mapping table;The word
The caption strips and the video frame synchronization of the video file that curtain file includes;The mapping table is stored with caption strips and frame of video
Corresponding relation;
Caption strips edit instruction receiving unit, for receiving caption strips edit instruction, the caption strips edit instruction includes
Instruction that caption strips remove instruction, caption strips duplicate instructions, caption strips reorder;
Caption strips edit instruction resolution unit, for parsing the caption strips edit instruction;
Video file edit cell, for using analysis result and the mapping table as according to the video file for editing reading.
In embodiments of the present invention, due to the corresponding frame in video file can be selected by selecting specific caption strips, because
This frame that can be changed with fast positioning to needs, so as to greatly accelerate video modification speed.
Brief description of the drawings
Fig. 1 is a kind of flow chart for video editing method that first embodiment of the invention provides;
Fig. 2 is a kind of structure chart for video editing terminal that second embodiment of the invention provides;
Fig. 3 is the structure chart for another video editing terminal that third embodiment of the invention provides.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
In the embodiment of the present invention, when receiving the caption strips edit instruction of editor's input, by removing, replicating, again
Sequence caption strips are removed, replicated, corresponding frame of video in the video file that reorders.
The embodiments of the invention provide a kind of video editing method and terminal.
Methods described includes:Read video file, pre-stored subtitle file, pre-stored mapping table;The captions text
The caption strips that part includes and the video frame synchronization of the video file;It is corresponding with frame of video that the mapping table is stored with caption strips
Relation;
Caption strips edit instruction is received, the caption strips edit instruction includes caption strips removal instruction, caption strips are replicated and referred to
Make, caption strips reorder instruction;
Parse the caption strips edit instruction;
Using analysis result and the mapping table as the video file read according to editor.
The terminal includes:Information reading unit, for reading video file, pre-stored subtitle file, pre-stored
Mapping table;The caption strips that the subtitle file includes and the video frame synchronization of the video file;The mapping table is stored with word
The corresponding relation of curtain bar and frame of video;
Caption strips edit instruction receiving unit, for receiving caption strips edit instruction, the caption strips edit instruction includes
Instruction that caption strips remove instruction, caption strips duplicate instructions, caption strips reorder;
Caption strips edit instruction resolution unit, for parsing the caption strips edit instruction;
Video file edit cell, for using analysis result and the mapping table as according to the video file for editing reading.
In embodiments of the present invention, due to the corresponding frame in video file can be selected by selecting specific caption strips, because
This frame that can be changed with fast positioning to needs, so as to greatly accelerate video modification speed.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Embodiment one:
Fig. 1 shows a kind of flow chart for video editing method that first embodiment of the invention provides, and details are as follows:
Step S101, video file, pre-stored subtitle file, pre-stored mapping table are read;The subtitle file bag
The caption strips contained and the video frame synchronization of the video file;The mapping table is stored with caption strips pass corresponding with frame of video
System.
Wherein, the video file of reading is the video file that need to be edited.In this step, a and video is prestored
The subtitle file of the video frame synchronization of file, the subtitle file include some captions, and each captions correspond to video text
One or several frame of video of part;Pre-save it is a be stored with it is corresponding between each captions and the frame of video in video file
The mapping table of relation.
Step S102, caption strips edit instruction is received, the caption strips edit instruction includes caption strips and removes instruction, captions
Bar duplicate instructions, caption strips reorder instruction.
In the step, editor first selectes the caption strips for needing to edit, then send to selected before video file is edited
Caption strips caption strips edit instruction, the caption strips edit instruction include it is following any:Caption strips remove instruction, caption strips
Duplicate instructions, caption strips reorder instruction.
Step S103, the caption strips edit instruction is parsed.
In the step, the caption strips edit instruction of reception is parsed, the caption strips edit instruction for judging to receive is that caption strips are moved
Except instruction, caption strips duplicate instructions, caption strips reorder instruction among it is any.
Step S104, using analysis result and the mapping table as according to the video file for editing reading.
In the step, caption strips are corresponding with frame of video in the caption strips edit instruction and mapping table that are obtained according to parsing
The video file that relationship editor is read.
Wherein:
When the caption strips edit instruction of reception removes instruction for caption strips, the caption strips and video that are stored according to mapping table
The corresponding relation of frame, frame of video corresponding to the caption strips that need to be removed is searched, and remove the frame of video found.In the step, root
Search the mark of frame of video corresponding to the caption strips that this need to remove in the mapping table according to the mark for the caption strips that need to be removed, and in word
Caption strips corresponding to the mark for the caption strips that need to be removed are deleted in curtain file, and delete video corresponding to the mark of frame of video
Frame.
Wherein:
When the caption strips edit instruction of reception is caption strips duplicate instructions, the caption strips and video that are stored according to mapping table
The corresponding relation of frame, frame of video corresponding to the caption strips that need to be replicated is searched, and replicate the frame of video found.It is multiple in the step
The caption strips of system have one-to-one relation with the frame of video replicated, such as, it is assumed that A, B, C are the marks of three continuous caption strips
Number, frame of video corresponding to A is X1, X2, X3...Xm, and frame of video corresponding to B is Y1, Y2, Y3...Yn, and frame corresponding to C is Z1,
Z2, Z3...Zk, wherein, m, n, k are natural numbers, it is assumed that it is H to replicate the caption strips that B caption strips obtain, and caption strips H is in
After caption strips C, it is G1, G2, G3 ... Gn to replicate the frame of video corresponding to B caption strips obtained by frame of video Y1, Y2, Y3...Yn,
Then the continuous frame of video corresponding to caption strips of A, B, C, H tetra- is X1, X2, X3...Xm;Y1, Y2, Y3...Yn;Z1, Z2,
Z3...Zk;G1, G2, G3 ... Gn.
Wherein:
When the caption strips edit instruction of reception reorders for caption strips and instructed, the caption strips stored according to mapping table are with regarding
The corresponding relation of frequency frame, search frame of video corresponding to the caption strips that need to be reordered, the frame of video that ranking and searching of laying equal stress on arrives.The step
In, when one or more caption strips of subtitle file need to reorder, frame of video corresponding to the caption strips of reorder is also held
Rearrangement sequence operates, so that the caption strips after reordering still correspond with the frame of video before reordering.
In embodiments of the present invention, the captions for the including caption strips text with the video frame synchronization of video file is prestored
Part, is previously stored with the mapping table of the corresponding relation of caption strips and frame of video, and editor can be obtained whole by subtitle file
Caption information, and modification is comparatively fast formulated according to the caption information of acquisition.Receiving the caption strips editor of editor's input
During instruction, by removing, replicating, reordering caption strips to remove, replicate, corresponding frame of video in the video file that reorders.By
In by selecting specific caption strips the corresponding frame in video file can be selected, therefore can be changed with fast positioning to needs
Frame, so as to greatly accelerate video modification speed.
As a preferred embodiment, described using analysis result and the mapping table as according to the video file for editing reading
The step of after comprise the steps:Video file after output edit.In the present embodiment, for ease of follow-up play, output is compiled
Video file after volume.
As a preferred embodiment, methods described also includes step:Using analysis result and the mapping table as according to editor
Pre-stored subtitle file and pre-stored mapping table;The mapping table after subtitle file and editor after output edit.This implementation
In example, after it is determined that needing removal or duplication or the caption strips that reorder, the subtitle file where caption strips is edited, edit and storage has
Caption strips and the mapping table of frame of video corresponding relation, the subtitle file after preservation, output edit and the mapping table after editor.
In order to more clearly describe by removing, replicating, reordering caption strips to remove, replicate, reorder video file
In corresponding frame of video process, illustrated below with a concrete application example:
Assuming that A, B, C are the labels of three continuous caption strips, frame of video corresponding to A is X1, X2, X3...Xm, and B is corresponding
Frame of video be Y1, Y2, Y3...Yn, frame of video corresponding to C is Z1, Z2, Z3...Zk, it is in store in mapping table more than mapping close
System.
After editor chooses caption strips, mapping relations of the video file software for editing in mapping table choose video literary
Corresponding frame of video in part, so can be according to caption strips content fast positioning to corresponding frame of video.
If for example, caption strips A is removed, the video file software for editing can regard according to the mapping relations handle in mapping table
Frame of video X1 in frequency file, X2, X3...Xm are removed, and by caption strips A in mapping table and frame of video X1, X2, X3...Xm's
Corresponding relation removes.
If for example, caption strips B to be replicated to a, the caption strips D after being replicated, after D is placed on into C, then video is literary
Frame of video Y1, Y2, Y3...Yn in video file can be replicated a obtain by part software for editing according to the mapping relations in mapping table
To frame of video W1, W2, W3...Wn, frame of video W1, W2, W3...Wn will be located at after frame of video Z1, Z2, Z3...Zk, and reflect
In firing table behind caption strips C and frame of video Z1, Z2, Z3...Zk mapping relations, increase caption strips D and frame of video W1, W2,
W3...Wn mapping relations.
If for example, after caption strips B is moved into caption strips C, the video file software for editing can be according in mapping table
Mapping relations the frame of video Y1 in video file, Y2, Y3...Yn are moved to after frame of video Z1, Z2, Z3...Zk, and
By caption strips B and frame of video Y1 in mapping table, the mapping relations that Y2, Y3...Yn are moved are moved to caption strips C and frame of video Z1, Z2,
Behind Z3...Zk mapping relations.
Embodiment two:
Fig. 2 shows a kind of structure chart for video editing terminal that second embodiment of the invention provides, for convenience of description,
It illustrate only the part related to the embodiment of the present invention.
Information reading unit 21, for reading video file, pre-stored subtitle file, pre-stored mapping table.It is described
The caption strips that subtitle file includes and the video frame synchronization of the video file.The mapping table is stored with caption strips and frame of video
Corresponding relation.
Wherein, the subtitle file includes some captions, and each captions correspond to the one or several of video file
Frame of video.
Caption strips edit instruction receiving unit 22, for receiving caption strips edit instruction, the caption strips edit instruction bag
Include caption strips and remove instruction, caption strips duplicate instructions, caption strips and reorder instruction.
Caption strips edit instruction resolution unit 23, for parsing the caption strips edit instruction.
Wherein, the caption strips edit instruction that caption strips edit instruction resolution unit 23 is mainly used in judging to receive is caption strips
Remove instruction, caption strips duplicate instructions, caption strips reorder instruct among it is any.
Video file edit cell 24, for using analysis result and the mapping table to be literary according to the video read is edited
Part.
In embodiments of the present invention, video file edit cell 24 is read with Information reading unit 21 subtitle file, reflect
Firing table, and caption strips edit instruction resolution unit 23 parse the caption strips editor that caption strips edit instruction receiving unit 22 receives
It is foundation to instruct obtained analysis result, realizes the editor to video file.Due to can by editing caption strips to remove, it is multiple
Make, corresponding frame of video in the video file that reorders, therefore the frame that can be changed with fast positioning to needs, so as to greatly accelerate
Video modification speed.
Embodiment three:
Fig. 3 shows the structure chart for another video editing terminal that third embodiment of the invention provides, in the present embodiment,
Information reading unit 21, caption strips edit instruction receiving unit 22, caption strips edit instruction resolution unit 23, video file editor
Unit 24 and the Information reading unit 21, caption strips edit instruction receiving unit 22, caption strips edit instruction of embodiment two parse
Unit 23, video file edit cell 24 are identical, and here is omitted.
In figure 3, video file edit cell 24 includes:
Caption strips remove module 241, for when the caption strips edit instruction of reception removes instruction for caption strips, according to reflecting
The caption strips of firing table storage and the corresponding relation of frame of video, search frame of video corresponding to the caption strips that need to be removed, and remove lookup
The frame of video arrived.
In the present embodiment, the caption strips for searching editor with the corresponding relation of frame of video by caption strips in mapping table are corresponding
Frame of video, and delete in video file the frame of video of lookup.
Caption strips replication module 242, for when the caption strips edit instruction of reception is caption strips duplicate instructions, according to reflecting
The caption strips of firing table storage and the corresponding relation of frame of video, search frame of video corresponding to the caption strips that need to be replicated, and replicate lookup
The frame of video arrived.
In the present embodiment, the caption strips of duplication have one-to-one relation with the frame of video replicated.
Caption strips reorder module 243, for reception caption strips edit instruction for caption strips reorder instruction when, root
According to the caption strips of mapping table storage and the corresponding relation of frame of video, frame of video corresponding to the caption strips that lookup need to reorder, lay equal stress on
The frame of video that ranking and searching arrives.
In the present embodiment, the caption strips after reordering still correspond with the frame of video before reordering.
As a preferred embodiment, the video editing terminal also includes:
Video file output unit, for the video file after output edit.In the present embodiment, the video after output edit
File is so as to follow-up storage, broadcasting.
As a preferred embodiment, the video editing terminal also includes:
Subtitle file and mapping table edit cell, for what is be pre-stored using analysis result and the mapping table as foundation editor
Subtitle file and pre-stored mapping table.
Subtitle file and mapping table output unit, for the subtitle file after output edit and the mapping table after editor.
In the present embodiment, according to the caption strips editor subtitle file and mapping table of editor, preserve, the captions after output edit
File and mapping table, subsequently again to corresponding video file editor when, using the new subtitle file and mapping table after editor.
In embodiments of the present invention, if receiving the caption strips edit instruction of editor's input, by removing, replicating,
Caption strips reorder to remove, replicate, corresponding frame of video in the video file that reorders.Due to selected specific caption strips can be passed through
To select the corresponding frame in video file, therefore the frame that can be changed with fast positioning to needs, repaiied so as to greatly accelerate video
Change speed.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
All any modification, equivalent and improvement made within refreshing and principle etc., should be included in the scope of the protection.