CN108366294A - A kind of video method of cutting out and device - Google Patents
A kind of video method of cutting out and device Download PDFInfo
- Publication number
- CN108366294A CN108366294A CN201810181826.0A CN201810181826A CN108366294A CN 108366294 A CN108366294 A CN 108366294A CN 201810181826 A CN201810181826 A CN 201810181826A CN 108366294 A CN108366294 A CN 108366294A
- Authority
- CN
- China
- Prior art keywords
- video frame
- video
- frame
- target
- starting
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
- H04N21/44012—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
Abstract
The disclosed herein method of cutting out and device of a kind of video, wherein method includes:Obtain the default start time point and default stop time point treated and cut that video data is cut;Determine default start time point corresponding starting video frame in video data to be cut;If starting video frame is non-key frame, video frame is respectively originated to each video frame of intermediate video frame, determines the target video frame with complete video picture;Intermediate video frame is:Before target critical video frame after starting video frame, and, the video frame adjacent with target critical video frame;Target critical video frame is:After starting video frame, and the key video sequence frame nearest apart from starting video frame;Each video frame write-in target video file successively by each target video frame after coding, and from target critical video frame to cut-off video frame.By the embodiment of the present application, the cutting speed treated and cut video data not only ensure that, but also ensure to cut accuracy.
Description
Technical field
This application involves field of video processing, more particularly to a kind of video method of cutting out and device.
Background technology
In practical application, the original video data for including to video file and original audio data is needed to cut, i.e.,
It is preset corresponding to start time point to default stop time point from from original video data and original audio data, obtaining respectively
Target video data and target audio data.And by after cutting target video data and target audio data write-in target regard
Frequency file.
In order to realize, target video data and target audio data can need target with normal play in target video file
First frame in video is to retain the video frame of complete picture, currently, when being cut to original video data, according to presetting
Begin time point, determines the nearest key video sequence of video frame corresponding to the default start time point of distance in original video data
Frame obtains the target that the default corresponding video frame of stop time point is formed from the key video sequence frame to original video data and regards
Frequency evidence, and target video file is written into target video data.
And required target video data is:From the corresponding video frame of default start time point in original video data, arrive,
The video data of the corresponding video frame of default stop time point, therefore, the video frame number in the target video data actually obtained
There are errors with the video frame number in required target video data, i.e., the method cut at present to original video data,
There is a problem of that obtained target video data accuracy in video frame number is low.
Invention content
Based on this, present applicant proposes a kind of video method of cutting out, not influence to treat the sanction for cutting video data
Under the premise of rate of shear degree, the accuracy of cutting is improved.
Present invention also provides a kind of video Scissoring devices, to ensure the realization and application of the above method in practice.
Technical solution provided by the present application is:
This application discloses a kind of method of cutting out of video, this method includes:
Obtain the default start time point and default stop time point treated and cut that video data is cut;
Determine the default start time point corresponding starting video frame in the video data to be cut;
If the starting video frame is non-key frame, each of respectively described starting video frame to intermediate video frame regards
Frequency frame determines the target video frame with complete video picture obtained after the video frame is decoded;The intermediate video frame
For:Before target critical video frame after the starting video frame, and, the video adjacent with the target critical video frame
Frame;The target critical video frame is:After the starting video frame, and the key nearest apart from the starting video frame
Video frame;
It obtains from the target critical video frame to the corresponding video frame for ending video frame of the default stop time point;
Successively by each target video frame after coding, and from the target critical video frame to the cut-off video frame
Each video frame be written target video file.
Wherein, the target video frame with complete video picture obtained after the determination video frame is decoded, packet
It includes:
Obtain the video frame from starting key video sequence frame to the starting video frame;The starting key video sequence frame is:Position
Before the starting video frame, and, the key video sequence frame nearest apart from the starting video frame;
Call decoder so that decoder foundation is from the starting keyframe to the video frame of the video frame, to described
Video frame is decoded, and obtains the corresponding target video frame with complete video picture of the video frame.
Wherein, described successively by each target video frame after coding, and from the target critical video frame to described
Target video file is written in each video frame for ending video frame, including:
Each target video frame is encoded successively;
Successively by the target video frame after coding, and from the target critical video frame to the every of the cut-off video frame
The target video file is written in a video frame.
Wherein, after the calling decoder, further include:
The target video frame is rendered;
Target video frame after rendering is sent to encoder, so that the encoder is to the target video after the rendering
Frame is encoded.
Wherein, the video frame obtained from starting key video sequence frame to starting video frame, including:
Obtain parameter preset;
According to the parameter preset, pointer is jumped into the starting key video sequence frame;
The video frame from the starting key video sequence frame to starting video frame is obtained successively.
Wherein, the method further includes:
It obtains and to be cut cuts audio data;
From it is described it is to be cut cut in audio data, obtain origination audio point corresponding from the default start time point, arrive, institute
State the audio data of the corresponding cut-off audio point of default stop time point;
The target video file is written into the audio data.
Present invention also provides a kind of Scissoring device of video, which includes:
First acquisition unit cuts the default start time point and default section that video data is cut for obtaining to treat
Only time point;
First determination unit, for determining the default start time point corresponding in the video data to be cut
Beginning video frame;
Second determination unit, if be non-key frame for the starting video frame, the respectively described starting video frame arrives
Each video frame of intermediate video frame determines the target video with complete video picture obtained after the video frame is decoded
Frame;The intermediate video frame is:Before target critical video frame after the starting video frame, and, it is closed with the target
The adjacent video frame of key video frame;The target critical video frame is:After the starting video frame, and apart from described
The nearest key video sequence frame of beginning video frame;
Second acquisition unit, for obtaining from the target critical video frame to corresponding section of the default stop time point
The only video frame of video frame;
First writing unit, for successively by each target video frame after coding, and from the target critical video
Target video file is written in each video frame of frame to the cut-off video frame.
Wherein, what second determination unit was specifically used for obtaining after the determining video frame is decoded has complete video
When the target video frame of picture, including:
Subelement is obtained, for obtaining the video frame from starting key video sequence frame to the starting video frame;The starting
Key video sequence frame is:Before the starting video frame, and, the key video sequence frame nearest apart from the starting video frame;
Decoding subunit, for calling decoder so that decoder is according to from the starting keyframe to the video frame
Video frame, the video frame is decoded, the corresponding target video with complete video picture of the video frame is obtained
Frame.
Wherein, first writing unit includes:
Coded sub-units, for being encoded successively to each target video frame;
Subelement is written, is used for successively by the target video frame after coding, and from the target critical video frame to institute
The target video file is written in each video frame for stating cut-off video frame.
Wherein, described device further includes:
Rendering unit, for after decoding subunit is decoded the video frame, to decoded target video frame
It is rendered;
Transmission unit, for the target video frame after rendering to be sent to encoder, so that the encoder is to the wash with watercolours
Target video frame after dye is encoded.
Wherein, the acquisition subelement includes:
First acquisition module, for obtaining parameter preset;
Jump module, for according to the parameter preset, pointer to be jumped to the starting key video sequence frame;
Second acquisition module, for obtaining the video frame from the starting key video sequence frame to starting video frame successively.
Wherein, described device further includes:
Third acquiring unit to be cut cuts audio data for obtaining;
4th acquiring unit, for from it is described it is to be cut cut in audio data, obtain and corresponded to from the default start time point
Origination audio point, arrive, the audio data of the corresponding cut-off audio point of the default stop time point;
Second writing unit, for the target video file to be written in the audio data.
The application's has the beneficial effect that:
In the embodiment of the present application, in video data to be cut, the default corresponding starting video frame of start time point is
When non-key frame, from starting video frame to the corresponding cut-off video frame of default stop time point, it will divide in video data to be cut
For two parts, wherein a part is:From starting video frame to each video frame of intermediate video frame, another part is:From with centre
Frame is adjacent and starting keyframe after the intermediate frame is to each video frame for ending video frame;For the former, pass through decoding
Obtain the corresponding target video frame with complete video picture of each video frame;And it regards target video frame is corresponding with the latter
Frequency frame is written in target video file, since target video frame is the video frame with complete video picture, it is ensured that target
Target video in video file can normal play, target video file is write direct for the corresponding video frame of the latter, can
To ensure to treat the cutting speed for cutting video data, also, the video frame of target video file is written in the embodiment of the present application
Number is:From starting video frame to the number of video frames of cut-off video frame.Therefore, the embodiment of the present application is ensureing target video text
While video in part can be with normal play, the cutting speed treated and cut video data not only ensure that, but also ensure to be cut
Cut the accuracy of video data cutting.
Description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of the method for cutting out embodiment of video in the application;
Fig. 2 is a kind of structural schematic diagram of the Scissoring device embodiment of video in the application.
Specific implementation mode
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
The embodiment of the present application is on the basis of the hardware compression that Android system is provided, by calling Android system institute
The software library and hardware module of offer realize that video is cut.In the embodiment of the present application, by video data to be cut, in advance
If the corresponding video frame of start time point is known as originating video frame, will be located at after the starting video frame, and regarded apart from the starting
The nearest key frame of frequency frame is known as target critical video frame, will be located at the target critical video frame before, and with the target critical
The adjacent video frame of video frame is known as intermediate video frame.
In the embodiment of the present application, video data to be cut is divided into two parts, a part is:From starting video frame in
Between video frame the first video frame, another part is:From target critical video frame to the second video frame of cut-off video frame;Pass through
To each first video frame decoding, the corresponding decoded video frame of each first video frame is obtained, wherein each first video
Decoded video frame corresponding to frame is the first object video frame for having complete video picture, and successively by each first mesh
It marks video frame and target video file is written with each second video frame.Due to first object video frame be decoding after obtain have
The video frame of complete video picture, it is ensured that first object video frame in target video file can normal play, for
Second video frame writes direct target video file, it is ensured that treats the cutting speed for cutting video data, also, the application
The video frame number of target video being written in target video file in embodiment is:From starting video frame regarding to cut-off video frame
Frequency frame number.Therefore, the embodiment of the present application both ensure that while the video in ensureing target video file can be with normal play
The cutting speed for cutting video data is treated, and reaches to treat and cuts the accuracy that video data is cut.
With reference to figure 1, a kind of flow chart of video method of cutting out embodiment in the application is shown, this method embodiment can be with
Including:
Step 101:Video data to be cut is obtained from video file to be cut.
In the present embodiment, open preserve wait cut video data and it is to be cut cut the local file of audio data after,
Video data to be cut corresponds to track of video serial number in the local file and audio data to be cut of cutting corresponds to audio track sequence
Number.Specifically, in this step, it can be by calling MediaExtractor classes, such is by video file to be cut
The data assembling format of agreement, by reading the different blocks of files in video file to be cut, obtain video data to be cut and
It is to be cut to cut audio data, and obtain the default start time point and default deadline treated and cut that video data is cut
Point.
The purpose of step 101 is:Obtain the default start time point and default section treated and cut that video data is cut
Only time point.
Step 102:Time point and default stop time point are cut according to default starting, is judged in the video data to be cut
Whether the default corresponding starting video frame of start time point is key frame, if it is not, 103 are thened follow the steps, if so, will starting
Video frame is determined as current video frame, then executes step 114.
It is getting after cutting video data, then, in this step, cutting video is being treated according to user and is cut
Default start time point and default stop time point, obtain that default in the video data to be cut start time point is corresponding regards
Frequency frame in the present embodiment, claims for convenience by the corresponding video frame of start time point is preset in video data to be cut
To originate video frame, the corresponding video frame of stop time point will be preset in video data to be cut and is known as ending video frame.It is obtaining
It takes after cutting the starting video frame in video data, next, it is determined that whether the starting video frame is key frame, if the starting
Video frame is not key frame, thens follow the steps 103 action, if the starting video frame is key frame, thens follow the steps 115
Action.
The purpose of step 102 is:Determine default start time point corresponding starting video frame in video data to be cut,
And judge whether the starting video frame is key video sequence frame.
Step 103:Parameter preset input by user is obtained, and file pointer is jumped to and is located at according to the parameter preset
Before originating video frame, and, the starting keyframe nearest apart from the starting video frame.
Judge to obtain starting video frame as non-key frame when, execute the action of this step, specifically, in this step,
Parameter preset input by user is obtained, and calls MediaExtractor classes, wherein is packaged in the MediaExtractor classes
Localization method, the MediaExtractor classes pass through localization method therein so that the localization method is based on the parameter preset, will
File pointer jumps to before starting video frame, and, the nearest key frame of distance starting video frame, for convenience,
The present embodiment will be located at before starting video frame, and the key frame nearest apart from starting video frame is known as starting keyframe.
Step 104:Obtain current video frame.
After navigating to starting keyframe by the location algorithm in MediaExtractor classes, then, in this step, obtain
The video frame for taking the file pointer in current MediaExtractor classes to navigate to, for convenience, and will be current
The video frame that file pointer in MediaExtractor classes navigates to is known as current video frame.
Step 105:The current video frame of acquisition is decoded.
After getting current video frame, then, in this step, by the input-buffer of the video frame input coding device
Area, so that the encoder is decoded the video frame.Wherein, in the present embodiment, be decoded to video frame can for encoder
To use asynchronous decoding, and by the output buffer area of decoded video frame input decoder.
Step 106:Judge that the output buffer area of decoder whether there is decoded current video frame, if being not present,
Step 105 is executed, until the output buffer area of decoder thens follow the steps 107 there are decoded current video frame.
After the current video frame of acquisition is input to the input-buffer area of decoder, then, in this step, judge to solve
It whether there is decoded current video frame in the output buffer area of code device, if decoded current video frame is not present, return
Return step 105, until in the output buffer area of decoder there are when decoded current video frame, then follow the steps 107 it is dynamic
Make.
Step 107:Judge whether the timestamp of the decoded current video frame is not less than the timestamp of starting video frame,
If being less than, 110 are thened follow the steps, if being not less than, thens follow the steps 108.
In the present embodiment, each video frame in video data to be cut, which is corresponding with, is characterized in video data to be cut
The middle timestamp for playing sequencing, wherein the timestamp of video frame shows more greatly the video frame in video data to be cut
Playing sequence more rearward, similarly, on the contrary, then playing sequence of the video frame in video data to be cut is more forward.It is solving
There are when decoded current video frame in the output buffer area of code device, which has complete video picture
Video frame then in this step, reads decoded current video frame, and judging should from the output buffer area of decoder
Whether the timestamp of decoded current video frame is not less than the timestamp of starting video frame, if decoded current video frame
Timestamp is less than the timestamp of starting video frame, 110 action is thened follow the steps, if the timestamp of decoded current video frame
Not less than the timestamp of starting video frame, 108 action is thened follow the steps.
The purpose of 103~step 107 of above-mentioned steps is:If starting video frame is non-key frame, video is respectively originated
Frame determines the corresponding target video frame with complete video picture of the video frame to each video frame of intermediate video frame.
Step 108:The decoded current video frame is rendered.
When timestamp of the timestamp of decoded current video frame not less than starting video frame, the dynamic of this step is executed
Make, specifically, in this step, calling OpengLES to render the decoded current video frame, wherein OpenglES
It increases income algorithm with one kind that GPU is communicated, complex figure or data texturing is transferred to GPU, then GPU is by data grid
It formats, and is shown on screen, it in the present embodiment, can be by the buffer area of data render to GPU, without aobvious in screen
It shows to come.
Step 109:The decoded video frame is encoded, and the current video frame write-in target after the coding is regarded
Frequency file.
After being rendered decoded current video frame, then, in this step, call encoder decoded to this
Current video frame is encoded, and calls MediaMuxer classes, wherein video file write-in is encapsulated in the MediaMuxer classes
Format, for example the video rendered is copied from cpu cache area above, the compression of Video coding is then utilized to calculate
Method, by Video compression, while by compressed data, then by certain file format specification write-in file.
It should be noted that in the present embodiment, decoded current video frame is the video with complete video picture
Data frame, in this step, after being encoded to the decoded current video frame, the current video frame after obtained coding
It not being compressed, in actual play, being drawn with complete video to can be obtained by after the current video frame decoding after the coding
The video frame in face.
Step 110:Next video frame is obtained, and next video frame of acquisition is determined as current video frame, then, is executed
Step 111.
After the current video frame write-in target video file after encoding, then, in this step, pass through
MediaExtractor classes obtain next video frame, and next video frame of acquisition is determined as current video frame, then, execute
The action of step 111.
Step 111:Judge whether the timestamp of current video frame is not less than the timestamp of target critical video frame, if not small
In thening follow the steps 112, if being less than, then follow the steps 105.
In the present embodiment, for convenience, will be located at after starting video frame, and nearest apart from starting video frame
Key frame is known as Target key frames.Obtaining next video frame, and using the video frame of acquisition as current video frame after, connect
It, in this step, judges whether the timestamp of current video frame is not less than the timestamp of target critical video frame.If this step
When judging that the timestamp for obtaining current video frame is not less than the timestamp of Target key frames, 112 action is thened follow the steps, if working as
The timestamp of preceding video frame is less than the timestamp of target critical video frame, then return to step 105.
Step 112:Target video file is written into current video frame.
When current video frame is target video frame, the action of this step is executed, specifically, in this step, calling
MediaMuxer classes so that target video file is written in current video frame by the MediaMuxer classes.
Step 113:Next video frame is obtained, and next video frame of acquisition is determined as current video frame, then, is executed
Step 114.
After target video file is written in current video frame, then, in this step, pass through MediaExtractor classes
Next video frame is obtained, and next video frame of acquisition is determined as current video frame, then, executes the action of step 114.
Step 114:Judge whether the timestamp of current video frame is not more than the timestamp of cut-off video frame, if being not more than,
112 are thened follow the steps, if more than thening follow the steps 115.
After obtaining current video frame, then, in this step, judge whether the timestamp of current video frame is less than or waits
It is held in the timestamp of cut-off video frame if the timestamp of current video frame is less than or equal to the timestamp of cut-off video frame
Otherwise the action of row step 112 executes the action of step 115.
Step 115:Obtained from local file it is to be cut cut audio data, and cut in audio data, determine default to be cut
Target is written to the audio data of the corresponding cut-off audio point of default stop time point in the corresponding origination audio point of start time point
File.
After it will end video frame write-in target video file, then, in this step, MediaExtractor is called
Class obtains the orbit number to be cut for cutting audio data from local file, and clipping to be cut is obtained by MediaExtractor classes
Frequency evidence for convenience, will in the present embodiment from the audio data to be cut for cutting cutting preset time period in audio data
To be cut to cut in audio data, the default corresponding audio point of start time point is known as origination audio point, presets stop time point and corresponds to
Audio point be known as end audio point.And MediaMuxer classes is called to write the audio data of origination audio point to cut-off audio point
Enter target video file.
Step 116:Generate the target video after cutting.
By in target video file, the audio data after video data and cutting after cutting is combined into target video, obtains
Target video after cutting.
In the embodiment of the present application, in video data to be cut, the default corresponding starting video frame of start time point is
When non-key frame, from starting video frame to the corresponding cut-off video frame of default stop time point, it will divide in video data to be cut
For two parts, wherein a part is:From starting video frame to each video frame of intermediate video frame, another part is:From with centre
Frame is adjacent and starting keyframe after the intermediate frame is to each video frame for ending video frame;For the former, determine each
The corresponding target video frame with complete video picture of video frame;And target video frame video frame corresponding with the latter is written
In target video file, since target video frame is the video frame with complete video picture, it is ensured that target video file
In target video can normal play, target video file is write direct for the corresponding video frame of the latter, it is ensured that right
The cutting speed of video data to be cut, also, the number of video frames that target video file is written in the embodiment of the present application is:From
Video frame is originated to the number of video frames for ending video frame.Therefore, the embodiment of the present application regarding in ensureing target video file
While frequency can be with normal play, the cutting speed treated and cut video data not only ensure that, but also ensure to treat cutting video counts
According to the accuracy of cutting.
With reference to figure 2, show that a kind of structural schematic diagram of the Scissoring device embodiment of video in the application, the device are implemented
Example may include:
First acquisition unit 201, for obtain treat cut the default start time point that is cut of video data with it is pre-
If stop time point;
First determination unit 202, for determining that the default start time point is corresponding in the video data to be cut
Starting video frame;
Second determination unit 203, if be non-key frame for the starting video frame, the respectively described starting video frame
To each video frame of intermediate video frame, determine that the target with complete video picture obtained after the video frame is decoded regards
Frequency frame;The intermediate video frame is:Before target critical video frame after the starting video frame, and, with the target
The adjacent video frame of key video sequence frame;The target critical video frame is:After the starting video frame, and apart from described
Originate the nearest key video sequence frame of video frame;
Wherein, which is specifically used for determining that having of obtaining after the video frame is decoded completely regards
When the target video frame of frequency picture, including:
Subelement is obtained, for obtaining the video frame from starting key video sequence frame to the starting video frame;The starting
Key video sequence frame is:Before the starting video frame, and, the key video sequence frame nearest apart from the starting video frame;
Wherein, obtaining subelement may include:
First acquisition module, for obtaining parameter preset;
Jump module, for according to the parameter preset, pointer to be jumped to the starting key video sequence frame;
Second acquisition module, for obtaining the video frame from the starting key video sequence frame to starting video frame successively.
Decoding subunit, for calling decoder so that decoder is according to from the starting keyframe to the video frame
Video frame, the video frame is decoded, the corresponding target video with complete video picture of the video frame is obtained
Frame.
Wherein, which can also include:
Rendering unit, for after decoding subunit is decoded the video frame, to decoded target video frame
It is rendered;
Transmission unit, for the target video frame after rendering to be sent to encoder, so that the encoder is to the wash with watercolours
Target video frame after dye is encoded.
Second acquisition unit 204 is corresponded to for obtaining from the target critical video frame to the default stop time point
Cut-off video frame video frame;
First writing unit 205, for being regarded successively by each target video frame after coding, and from the target critical
Target video file is written in each video frame of frequency frame to the cut-off video frame.
Wherein, the first writing unit 205 may include:
Coded sub-units, for being encoded successively to each target video frame;
Subelement is written, is used for successively by the target video frame after coding, and from the target critical video frame to institute
The target video file is written in each video frame for stating cut-off video frame.
Wherein, which can also include:
Third acquiring unit to be cut cuts audio data for obtaining;
4th acquiring unit, for from it is described it is to be cut cut in audio data, obtain and corresponded to from the default start time point
Origination audio point, arrive, the audio data of the corresponding cut-off audio point of the default stop time point;
Second writing unit, for the target video file to be written in the audio data.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with it is other
The difference of embodiment, just to refer each other for identical similar portion between each embodiment.Herein, such as " first " and
The relational terms of " second " or the like are only used to distinguish one entity or operation from another entity or operation, and
Without necessarily requiring or implying that between these entities or operation, there are any actual relationship or orders.In the text
The word explanations such as "include", "comprise" be comprising meaning rather than exclusive or exhaustive meaning;That is, be " include but
Be not limited to " meaning.Deformation, same replacement without departing from the inventive concept of the premise, can also be made, improved etc., these
Belong to protection scope of the present invention.
The foregoing description of the disclosed embodiments enables professional and technical personnel in the field to realize or use the application.
Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein
General Principle can in other embodiments be realized in the case where not departing from spirit herein or range.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest range caused.
Claims (12)
1. a kind of method of cutting out of video, which is characterized in that the method includes:
Obtain the default start time point and default stop time point treated and cut that video data is cut;
Determine the default start time point corresponding starting video frame in the video data to be cut;
If the starting video frame is non-key frame, each video of the respectively described starting video frame to intermediate video frame
Frame determines the target video frame with complete video picture obtained after the video frame is decoded;The intermediate video frame is:
Before target critical video frame after the starting video frame, and, the video frame adjacent with the target critical video frame;
The target critical video frame is:After the starting video frame, and the key nearest apart from the starting video frame regards
Frequency frame;
It obtains from the target critical video frame to the corresponding video frame for ending video frame of the default stop time point;
Successively by each target video frame after coding, and from the target critical video frame to the every of the cut-off video frame
Target video file is written in a video frame.
2. according to the method described in claim 1, it is characterized in that, what is obtained after the determination video frame is decoded has
The target video frame of complete video picture, including:
Obtain the video frame from starting key video sequence frame to the starting video frame;The starting key video sequence frame is:Positioned at institute
Before stating starting video frame, and, the key video sequence frame nearest apart from the starting video frame;
Call decoder so that decoder foundation is from the starting keyframe to the video frame of the video frame, to the video
Frame is decoded, and obtains the corresponding target video frame with complete video picture of the video frame.
3. according to the method described in claim 1, it is characterized in that, described successively by each target video frame after coding, with
And target video file is written from the target critical video frame to each video frame of the cut-off video frame, including:
Each target video frame is encoded successively;
Successively by the target video frame after coding, and regard each of from the target critical video frame to the cut-off video frame
The target video file is written in frequency frame.
4. according to the method described in claim 2, it is characterized in that, after the calling decoder, further include:
The target video frame is rendered;
Target video frame after rendering is sent to encoder, so as to the encoder to the target video frame after the rendering into
Row coding.
5. according to the method described in claim 2, it is characterized in that, described obtain from starting key video sequence frame to starting video frame
Video frame, including:
Obtain parameter preset;
According to the parameter preset, pointer is jumped into the starting key video sequence frame;
The video frame from the starting key video sequence frame to starting video frame is obtained successively.
6. according to the method described in claim 1, it is characterized in that, the method further includes:
It obtains and to be cut cuts audio data;
From it is described it is to be cut cut in audio data, obtain origination audio point corresponding from the default start time point, arrive, it is described pre-
If the audio data of the corresponding cut-off audio point of stop time point;
The target video file is written into the audio data.
7. a kind of Scissoring device of video, which is characterized in that described device includes:
First acquisition unit, for obtain treat cut the default start time point that is cut of video data with default cut-off when
Between point;
First determination unit, for determining that the default start time point corresponding starting in the video data to be cut regards
Frequency frame;
Second determination unit, if be non-key frame for the starting video frame, the respectively described starting video frame to centre
Each video frame of video frame determines the target video frame with complete video picture obtained after the video frame is decoded;
The intermediate video frame is:Before target critical video frame after the starting video frame, and, it is regarded with the target critical
The adjacent video frame of frequency frame;The target critical video frame is:It is regarded after the starting video frame, and apart from the starting
The nearest key video sequence frame of frequency frame;
Second acquisition unit is regarded for obtaining from the target critical video frame to the corresponding cut-off of the default stop time point
The video frame of frequency frame;
First writing unit, for successively by each target video frame after coding, and from the target critical video frame to
Target video file is written in each video frame of the cut-off video frame.
8. device according to claim 7, which is characterized in that second determination unit is specifically used for determining the video
When the target video frame with complete video picture obtained after frame is decoded, including:
Subelement is obtained, for obtaining the video frame from starting key video sequence frame to the starting video frame;The starting is crucial
Video frame is:Before the starting video frame, and, the key video sequence frame nearest apart from the starting video frame;
Decoding subunit, for calling decoder so that decoder is according to regarding from the starting keyframe to the video frame
Frequency frame is decoded the video frame, obtains the corresponding target video frame with complete video picture of the video frame.
9. device according to claim 7, which is characterized in that first writing unit includes:
Coded sub-units, for being encoded successively to each target video frame;
Subelement is written, is used for successively by the target video frame after coding, and from the target critical video frame to described section
Only the target video file is written in each video frame of video frame.
10. device according to claim 8, which is characterized in that described device further includes:
Rendering unit, for after decoding subunit is decoded the video frame, being carried out to decoded target video frame
It renders;
Transmission unit, for by render after target video frame be sent to encoder, so as to the encoder to the rendering after
Target video frame encoded.
11. device according to claim 8, which is characterized in that the acquisition subelement includes:
First acquisition module, for obtaining parameter preset;
Jump module, for according to the parameter preset, pointer to be jumped to the starting key video sequence frame;
Second acquisition module, for obtaining the video frame from the starting key video sequence frame to starting video frame successively.
12. device according to claim 7, which is characterized in that described device further includes:
Third acquiring unit to be cut cuts audio data for obtaining;
4th acquiring unit, for from it is described it is to be cut cut in audio data, obtain from the default start time point is corresponding
Beginning audio point, is arrived, the audio data of the corresponding cut-off audio point of the default stop time point;
Second writing unit, for the target video file to be written in the audio data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810181826.0A CN108366294A (en) | 2018-03-06 | 2018-03-06 | A kind of video method of cutting out and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810181826.0A CN108366294A (en) | 2018-03-06 | 2018-03-06 | A kind of video method of cutting out and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108366294A true CN108366294A (en) | 2018-08-03 |
Family
ID=63003545
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810181826.0A Pending CN108366294A (en) | 2018-03-06 | 2018-03-06 | A kind of video method of cutting out and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108366294A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110572722A (en) * | 2019-09-26 | 2019-12-13 | 腾讯科技(深圳)有限公司 | Video clipping method, device, equipment and readable storage medium |
CN110881140A (en) * | 2018-09-05 | 2020-03-13 | 北京高德云图科技有限公司 | Method and device for capturing picture from video, embedded device and storage medium |
CN111405358A (en) * | 2020-03-24 | 2020-07-10 | 上海依图网络科技有限公司 | Cache-based video frame extraction method, apparatus, medium, and system |
CN111405314A (en) * | 2020-03-09 | 2020-07-10 | 腾讯科技(深圳)有限公司 | Information processing method, device, equipment and storage medium |
CN112653904A (en) * | 2020-12-16 | 2021-04-13 | 杭州当虹科技股份有限公司 | Rapid video clipping method based on PTS and DTS modification |
CN112883782A (en) * | 2021-01-12 | 2021-06-01 | 上海肯汀通讯科技有限公司 | Method, device, equipment and storage medium for identifying putting behaviors |
CN113115106A (en) * | 2021-03-31 | 2021-07-13 | 影石创新科技股份有限公司 | Automatic clipping method, device, terminal and storage medium of panoramic video |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009066441A1 (en) * | 2007-11-19 | 2009-05-28 | Thomson Licensing | Editing apparatus, editing method, and editing program |
CN106803992A (en) * | 2017-02-14 | 2017-06-06 | 北京时间股份有限公司 | Video clipping method and device |
-
2018
- 2018-03-06 CN CN201810181826.0A patent/CN108366294A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009066441A1 (en) * | 2007-11-19 | 2009-05-28 | Thomson Licensing | Editing apparatus, editing method, and editing program |
CN106803992A (en) * | 2017-02-14 | 2017-06-06 | 北京时间股份有限公司 | Video clipping method and device |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110881140A (en) * | 2018-09-05 | 2020-03-13 | 北京高德云图科技有限公司 | Method and device for capturing picture from video, embedded device and storage medium |
CN110881140B (en) * | 2018-09-05 | 2022-01-21 | 北京高德云图科技有限公司 | Method and device for capturing picture from video, embedded device and storage medium |
CN110572722A (en) * | 2019-09-26 | 2019-12-13 | 腾讯科技(深圳)有限公司 | Video clipping method, device, equipment and readable storage medium |
CN111405314A (en) * | 2020-03-09 | 2020-07-10 | 腾讯科技(深圳)有限公司 | Information processing method, device, equipment and storage medium |
CN111405358A (en) * | 2020-03-24 | 2020-07-10 | 上海依图网络科技有限公司 | Cache-based video frame extraction method, apparatus, medium, and system |
CN112653904A (en) * | 2020-12-16 | 2021-04-13 | 杭州当虹科技股份有限公司 | Rapid video clipping method based on PTS and DTS modification |
CN112653904B (en) * | 2020-12-16 | 2022-07-29 | 杭州当虹科技股份有限公司 | Rapid video clipping method based on PTS and DTS modification |
CN112883782A (en) * | 2021-01-12 | 2021-06-01 | 上海肯汀通讯科技有限公司 | Method, device, equipment and storage medium for identifying putting behaviors |
CN112883782B (en) * | 2021-01-12 | 2023-03-24 | 上海肯汀通讯科技有限公司 | Method, device, equipment and storage medium for identifying putting behaviors |
CN113115106A (en) * | 2021-03-31 | 2021-07-13 | 影石创新科技股份有限公司 | Automatic clipping method, device, terminal and storage medium of panoramic video |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108366294A (en) | A kind of video method of cutting out and device | |
CN104837052B (en) | Play the method and device of multi-medium data | |
CN104618786A (en) | Audio/video synchronization method and device | |
CN107529069A (en) | A kind of video stream transmission method and device | |
CN110830838A (en) | Security protection high-definition video reverse broadcasting method and device | |
US11922972B2 (en) | Method and apparatus for video coding | |
CN104091608B (en) | A kind of video editing method and device based on ios device | |
CN105743911B (en) | A method of promoting video conferencing system audio mixing capacity | |
CN112291628A (en) | Multithreading video decoding playing method based on web browser | |
CN111263164A (en) | High frame frequency video parallel coding and recombination method | |
CN114584835B (en) | Video processing method, device, equipment and storage medium | |
CN112631635B (en) | Live broadcast client updating method and device, electronic equipment and storage medium | |
US20240040147A1 (en) | Data processing method and apparatus, computer device, and storage medium | |
CN101485200B (en) | Video signal processing device, video signal processing method | |
CN116320448B (en) | Video decoding session multiplexing optimization method based on dynamic self-adaptive resolution | |
CN105554375A (en) | Method and device of video preview in digital video recorder | |
CN112019878A (en) | Video decoding and editing method, device, equipment and storage medium | |
CN111318012A (en) | Game data transmission method and device | |
CN111541901B (en) | Picture decoding method and device | |
CN108093258A (en) | Coding/decoding method, computer installation and the computer readable storage medium of bit stream data | |
CN114615458A (en) | Method and device for real-time screen closing and rapid drawing in cloud conference | |
CN114003546B (en) | Multi-channel switching value composite coding design method and device | |
CN111954067A (en) | Method for improving video rendering efficiency and user interaction fluency | |
CN111263184A (en) | Method, device and equipment for detecting coding and decoding consistency | |
CN116033113B (en) | Video conference auxiliary information transmission method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180803 |
|
RJ01 | Rejection of invention patent application after publication |