Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
In the embodiment of the present invention, in the time receiving the caption strips edit instruction of editor input, by the caption strips that removes, copies, the reorders corresponding frame of video in video file that removes, copies, reorders.
The embodiment of the present invention provides a kind of video editing method and terminal.
Described method comprises: read the subtitle file of video file, pre-stored, the mapping table of pre-stored; The caption strips that described subtitle file comprises and the video frame synchronization of described video file; Described mapping table stores the corresponding relation of caption strips and frame of video;
Receive caption strips edit instruction, described caption strips edit instruction comprises that caption strips removes instruction, caption strips duplicate instructions, the caption strips instruction of reordering;
Resolve described caption strips edit instruction;
The video file as reading according to editor taking analysis result and described mapping table.
Described terminal comprises: information reading unit, for reading the subtitle file of video file, pre-stored, the mapping table of pre-stored; The caption strips that described subtitle file comprises and the video frame synchronization of described video file; Described mapping table stores the corresponding relation of caption strips and frame of video;
Caption strips edit instruction receiving element, for receiving caption strips edit instruction, described caption strips edit instruction comprises that caption strips removes instruction, caption strips duplicate instructions, the caption strips instruction of reordering;
Caption strips edit instruction resolution unit, for resolving described caption strips edit instruction;
Video file edit cell, for the video file as reading according to editor taking analysis result and described mapping table.
In embodiments of the present invention, owing to selecting the corresponding frame in video file by selected concrete caption strips, therefore can navigate to fast the frame that needs amendment, thereby greatly accelerate video modification speed.
For technical solutions according to the invention are described, describe below by specific embodiment.
embodiment mono-:
Fig. 1 shows the flow chart of a kind of video editing method that first embodiment of the invention provides, and details are as follows:
Step S101, read the subtitle file of video file, pre-stored, the mapping table of pre-stored; The caption strips that described subtitle file comprises and the video frame synchronization of described video file; Described mapping table stores the corresponding relation of caption strips and frame of video.
Wherein, the video file reading is the video file that needs editor.In this step, the subtitle file of the video frame synchronization of pre-stored portion and this video file, this subtitle file includes some captions, and each captions is corresponding to one or several frame of video of video file; Preserve in advance a mapping table that stores corresponding relation between the frame of video in each captions and video file.
Step S102, receive caption strips edit instruction, described caption strips edit instruction comprises that caption strips removes instruction, caption strips duplicate instructions, the caption strips instruction of reordering.
In this step, editor is before editing video file, the first selected caption strips that needs editor, then send the caption strips edit instruction to selected caption strips, this caption strips edit instruction comprise following any: caption strips removes instruction, caption strips duplicate instructions, the caption strips instruction of reordering.
Step S103, resolve described caption strips edit instruction.
In this step, resolve the caption strips edit instruction receiving, the caption strips edit instruction that judgement receives is that caption strips removes reorder any among instruction of instruction, caption strips duplicate instructions, caption strips.
Step S104, video file taking analysis result and described mapping table as reading according to editor.
In this step, the video file that in the caption strips edit instruction obtaining according to parsing and mapping table, the corresponding relation editor of caption strips and frame of video reads.
Wherein:
Be caption strips while removing instruction at the caption strips edit instruction receiving, according to the corresponding relation of the caption strips of mapping table storage and frame of video, search the frame of video corresponding to caption strips that need remove, and remove the frame of video finding.In this step, the caption strips removing according to need be identified at the mark of searching frame of video corresponding to this caption strips that need remove in mapping table, and the caption strips of the mark correspondence of the caption strips that deletion need remove in subtitle file, and the frame of video of the mark correspondence of deletion frame of video.
Wherein:
In the time that the caption strips edit instruction receiving is caption strips duplicate instructions, according to the corresponding relation of the caption strips of mapping table storage and frame of video, searches the frame of video corresponding to caption strips that need copy, and copy the frame of video finding.In this step, the caption strips copying has relation one to one with the frame of video copying, as, suppose A, B, C is the label of three continuous caption strips, the frame of video that A is corresponding is X1, X2, X3...Xm, the frame of video that B is corresponding is Y1, Y2, Y3...Yn, the frame that C is corresponding is Z1, Z2, Z3...Zk, wherein, m, n, k is natural number, supposing to copy the caption strips that B caption strips obtains is H, this caption strips H is after caption strips C, copy frame of video Y1 corresponding to B caption strips, Y2, the frame of video that Y3...Yn obtains is G1, G2, G3 ... Gn, A, B, C, frame of video corresponding to tetra-continuous caption strips of H is X1, X2, X3...Xm, Y1, Y2, Y3...Yn, Z1, Z2, Z3...Zk, G1, G2, G3 ... Gn.
Wherein:
Be caption strips while reordering instruction at the caption strips edit instruction receiving, according to the corresponding relation of the caption strips of mapping table storage and frame of video, search the frame of video corresponding to caption strips that need reorder, the frame of video that the ranking and searching of laying equal stress on arrives.In this step, in the time that one or more caption strips of subtitle file need to reorder, the frame of video that the caption strips reordering is corresponding is also carried out to the operation of reordering so that the caption strips after reordering still with reorder before frame of video corresponding one by one.
In embodiments of the present invention, the subtitle file that includes caption strips of the video frame synchronization of pre-stored and video file, the mapping table of the pre-stored corresponding relation that has caption strips and frame of video, editor can obtain whole caption informations by subtitle file, and comparatively fast formulates modification according to the caption information obtaining.In the time receiving the caption strips edit instruction of editor input, by the caption strips that removes, copies, the reorders corresponding frame of video in video file that removes, copies, reorders.Owing to selecting the corresponding frame in video file by selected concrete caption strips, therefore can navigate to fast the frame that needs amendment, thereby greatly accelerate video modification speed.
As a preferred embodiment, after the described step taking analysis result and described mapping table as the video file that reads according to editor, comprise the steps: the video file after output edit.In the present embodiment, for ease of follow-up play, the video file after output edit.
As a preferred embodiment, described method also comprises step: taking analysis result and described mapping table as according to editor's subtitle file of pre-stored and the mapping table of pre-stored; Mapping table after subtitle file after output edit and editor.In the present embodiment, need to remove or copy or reorder after caption strips definite, the subtitle file at editor caption strips place, edit and storage has the mapping table of caption strips and frame of video corresponding relation, the mapping table after the subtitle file after preservation, output edit and editor.
In order more clearly to describe by the caption strips that removes, copies, reorders remove, copy, the reorder process of corresponding frame of video in video file, describe with a concrete application examples below:
Suppose A, B, C is the label of three continuous caption strips, the frame of video that A is corresponding is X1, X2, X3...Xm, the frame of video that B is corresponding is Y1, Y2, Y3...Yn, the frame of video that C is corresponding is Z1, Z2, Z3...Zk, in store above mapping relations in mapping table.
When editor chooses after caption strips, video file software for editing chooses frame of video corresponding in video file according to the mapping relations in mapping table, can navigate to fast corresponding frame of video according to caption strips content like this.
For example, if caption strips A is removed, Ze Gai video file software for editing can be according to the mapping relations in mapping table the frame of video X1 in video file, X2, and X3...Xm removes, and by caption strips A in mapping table and frame of video X1, X2, the corresponding relation of X3...Xm removes.
For example, if caption strips B is copied to portion, obtain the caption strips D after copying, after D is placed on to C, video file software for editing can be according to the mapping relations in mapping table the frame of video Y1 in video file, Y2, Y3...Yn copies portion and obtains frame of video W1, W2, W3...Wn, frame of video W1, W2, W3...Wn will be positioned at frame of video Z1, Z2, after Z3...Zk, and in mapping table caption strips C and frame of video Z1, Z2, after the mapping relations of Z3...Zk, increase caption strips D and frame of video W1, W2, the mapping relations of W3...Wn.
For example, if after caption strips B is moved to caption strips C, Ze Gai video file software for editing can be according to the mapping relations in mapping table the frame of video Y1 in video file, Y2, Y3...Yn moves to frame of video Z1, Z2, after Z3...Zk, and in mapping table by caption strips B and frame of video Y1, Y2, the mapping relations that Y3...Yn moves move to caption strips C and frame of video Z1, and Z2, after the mapping relations of Z3...Zk.
embodiment bis-:
Fig. 2 shows the structure chart of a kind of video editing terminal that second embodiment of the invention provides, and for convenience of explanation, only shows the part relevant to the embodiment of the present invention.
Information reading unit 21, for reading the subtitle file of video file, pre-stored, the mapping table of pre-stored.The caption strips that described subtitle file comprises and the video frame synchronization of described video file.Described mapping table stores the corresponding relation of caption strips and frame of video.
Wherein, this subtitle file includes some captions, and each captions is corresponding to one or several frame of video of video file.
Caption strips edit instruction receiving element 22, for receiving caption strips edit instruction, described caption strips edit instruction comprises that caption strips removes instruction, caption strips duplicate instructions, the caption strips instruction of reordering.
Caption strips edit instruction resolution unit 23, for resolving described caption strips edit instruction.
Wherein, to be mainly used in the caption strips edit instruction that judgement receives be that caption strips removes reorder any among instruction of instruction, caption strips duplicate instructions, caption strips to caption strips edit instruction resolution unit 23.
Video file edit cell 24, for the video file as reading according to editor taking analysis result and described mapping table.
In embodiments of the present invention, subtitle file, mapping table that video file edit cell 24 reads with information reading unit 21, and caption strips edit instruction resolution unit 23 to resolve the analysis result that caption strips edit instruction that caption strips edit instruction receiving element 22 receives obtains be foundation, realize the editor to video file.Owing to can, by editor's caption strips corresponding frame of video in video file that removes, copies, reorders, therefore navigating to fast the frame that needs amendment, thereby greatly accelerate video modification speed.
embodiment tri-:
Fig. 3 shows the structure chart of the another kind of video editing terminal that third embodiment of the invention provides, in the present embodiment, information reading unit 21, caption strips edit instruction receiving element 22, caption strips edit instruction resolution unit 23, video file edit cell 24 are identical with information reading unit 21, caption strips edit instruction receiving element 22, caption strips edit instruction resolution unit 23, the video file edit cell 24 of embodiment bis-, repeat no more herein.
In Fig. 3, video file edit cell 24 comprises:
Caption strips removes module 241, at the caption strips edit instruction receiving being caption strips while removing instruction, according to the corresponding relation of the caption strips of mapping table storage and frame of video, searches the frame of video corresponding to caption strips that need remove, and removes the frame of video finding.
In the present embodiment, search editor's frame of video corresponding to caption strips by caption strips in mapping table and the corresponding relation of frame of video, and delete the frame of video of searching in video file.
Caption strips replication module 242, in the time that the caption strips edit instruction receiving is caption strips duplicate instructions, according to the corresponding relation of the caption strips of mapping table storage and frame of video, searches the frame of video corresponding to caption strips that need copy, and copies the frame of video finding.
In the present embodiment, the caption strips copying has relation one to one with the frame of video copying.
The caption strips module 243 that reorders, for being that caption strips is while reordering instruction at the caption strips edit instruction receiving, according to the corresponding relation of the caption strips of mapping table storage and frame of video, search the frame of video corresponding to caption strips that need reorder, the frame of video that the ranking and searching of laying equal stress on arrives.
In the present embodiment, the caption strips after reordering still with reorder before frame of video corresponding one by one.
As a preferred embodiment, described video editing terminal also comprises:
Video file output unit, for the video file after output edit.In the present embodiment, the video file after output edit is so that follow-up storage, broadcasting.
As a preferred embodiment, described video editing terminal also comprises:
Subtitle file and mapping table edit cell, for taking analysis result and described mapping table as according to editor's subtitle file of pre-stored and the mapping table of pre-stored.
Subtitle file and mapping table output unit, for the mapping table after the subtitle file after output edit and editor.
In the present embodiment, according to editor's caption strips editor's subtitle file and mapping table, preserve, subtitle file and mapping table after output edit, follow-up during again to corresponding video file editor, adopt new subtitle file and mapping table after editor.
In embodiments of the present invention, if receive the caption strips edit instruction of editor input, by the caption strips that removes, copies, the reorders corresponding frame of video in video file that removes, copies, reorders.Owing to selecting the corresponding frame in video file by selected concrete caption strips, therefore can navigate to fast the frame that needs amendment, thereby greatly accelerate video modification speed.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.