CN105578261B - A kind of method and apparatus of video clipping - Google Patents

A kind of method and apparatus of video clipping Download PDF

Info

Publication number
CN105578261B
CN105578261B CN201510957866.6A CN201510957866A CN105578261B CN 105578261 B CN105578261 B CN 105578261B CN 201510957866 A CN201510957866 A CN 201510957866A CN 105578261 B CN105578261 B CN 105578261B
Authority
CN
China
Prior art keywords
data frame
video data
video
timestamp
time
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.)
Expired - Fee Related
Application number
CN201510957866.6A
Other languages
Chinese (zh)
Other versions
CN105578261A (en
Inventor
武悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Tvmining Juyuan Media Technology Co Ltd
Original Assignee
Wuxi Tvmining Juyuan Media Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuxi Tvmining Juyuan Media Technology Co Ltd filed Critical Wuxi Tvmining Juyuan Media Technology Co Ltd
Priority to CN201510957866.6A priority Critical patent/CN105578261B/en
Publication of CN105578261A publication Critical patent/CN105578261A/en
Application granted granted Critical
Publication of CN105578261B publication Critical patent/CN105578261B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4331Caching operations, e.g. of an advertisement for later insertion during playback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44016Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for substituting a video clip
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses a kind of method and apparatus of video clipping, to improve the play quality of editing backsight frequency file.It is instructed this method comprises: receiving the cutting comprising the point of contact time, wherein the point of contact time includes: initial time and end time;The video data frame of the timestamp and the point of contact time match of video flowing in source video file is handled, the first video file after cutting to the source video file is obtained;According to crystal oscillator frequency, converts to the timestamp of video flowing in first video file after switching, determine the play time of first video file.In this way, video flowing in source video file is cut according to timestamp, and according to crystal oscillator frequency to the timestamp of video flowing converts in the first video file after cutting, this ensure that switching after the first video file broadcast time it is correct, improve improve editing backsight frequency file play quality.

Description

A kind of method and apparatus of video clipping
Technical field
The present invention relates to multimedia technology field, in particular to a kind of method and apparatus of video clipping.
Background technique
As the broadcasting of the development of multimedia technology, video, audio, picture etc. is generally known by user.User exists When carrying out multimedia, such as when video playing, it may not be necessary to whole video contents is watched, alternatively, merely desiring to watch it In certain several segment.In this way, it is necessary to editing be carried out to video, cut several segment texts from source video file according to demand Part is then combined with into a new video file and plays out.
Currently, some video clipping softwares can to source video file carry out non-linear editing, can according to user instructions, Video is scanned for, until searching cut-point, and by Video segmentation at multistage segment video, the segment that then will need to be watched Video merging is played out at a new video file, and this operation is very quick, but may have new video text Between part sound intermediate frequency and video it is imperfect there are time difference or certain video requency frame datas and the problems such as can not play.
Summary of the invention
The present invention provides a kind of method and apparatus of video clipping, to improve the play quality of editing backsight frequency file.
The present invention provides a kind of method of video clipping, this method comprises:
It receives the cutting comprising the point of contact time to instruct, wherein the point of contact time includes: initial time and end time;
The video data frame of the timestamp and the point of contact time match of video flowing in source video file is handled, is obtained The first video file to after being cut to the source video file;
It according to crystal oscillator frequency, converts, determines to the timestamp of video flowing in first video file after switching The play time of first video file.
In one embodiment of the invention, the view to video flowing timestamp in source video file and the point of contact time match Frequency data frame carries out processing
When the timestamp of a video data frame in the source video file video flowing was greater than or equal in the point of contact time Initial time, and be less than the point of contact time in end time when, the video data frame is determined as current video number According to frame;
Obtain the current video data frame.
In one embodiment of the invention, the view to video flowing timestamp in source video file and the point of contact time match Frequency data frame is handled further include:
After the end time of the point of contact time being located at the timestamp of the current video data frame, next video counts When according to before the timestamp of frame, the current video data frame is abandoned.
In one embodiment of the invention, the view to video flowing timestamp in source video file and the point of contact time match Frequency data frame is handled further include:
After the end time of the point of contact time being located at the timestamp of the current video data frame, next video counts When according to before the timestamp of frame, obtain between the end time of the point of contact time and the timestamp of the current video data frame Relative difference;
According to the frame per second of the video render, mean time value is obtained;
If the relative difference be greater than with the mean time value, retain the current video data frame;
If the relative difference is less than or equal to the mean time value, the current video data frame is abandoned.
It is described according to crystal oscillator frequency in one embodiment of the invention, to video flowing in first video file after switching Timestamp convert, determine that the play time of first video file includes:
The playing duration of every frame video data frame is determined according to crystal oscillator frequency;
According to before the playing duration and first video file and the time of the first adjacent video file Stamp, converts to the timestamp of video flowing in first video file.
The present invention provides a kind of device of video clipping, which includes:
Receiving unit is instructed for receiving the cutting comprising the point of contact time, wherein when the point of contact time includes: starting Between and the end time;
Processing unit, the video data for timestamp and the point of contact time match to video flowing in source video file Frame is handled, and the first video file after cutting to the source video file is obtained;
Scaling unit, for changing the timestamp in first video file after switching according to crystal oscillator frequency It calculates, determines the play time of first video file.
In one embodiment of the invention, the processing unit includes:
Subelement is determined, for being greater than or equal to when the timestamp of a video data frame in the source video file video flowing Initial time in the point of contact time, and be less than the point of contact time in end time when, the video data frame is true It is set to current video data frame;
Subelement is obtained, for obtaining the current video data frame.
In one embodiment of the invention, the processing unit further include:
Subelement is abandoned, the timestamp of the current video data frame is located at for the end time when the point of contact time When later, before the timestamp of next video data frame, the current video data frame is abandoned.
In one embodiment of the invention, the processing unit further include:
Select subelement, the end time for the point of contact time be located at the current video data frame timestamp it When afterwards, before the timestamp of next video data frame, obtain the point of contact time end time and the current video data Relative difference between the timestamp of frame;According to the frame per second of the video render, mean time value is obtained;If the relative mistake Value be greater than with the mean time value, retain the current video data frame;If the relative difference is less than or equal to described flat Equal time value abandons the current video data frame.
In one embodiment of the invention, the scaling unit includes:
Duration determines subelement, for determining the playing duration of every frame video data frame according to crystal oscillator frequency;
Convert subelement, for according to before the playing duration and first video file and adjacent first The timestamp of video file converts to the timestamp of video flowing in first video file.
Some beneficial effects of the embodiment of the present invention may include:
Video flowing in source video file is cut according to timestamp, and according to crystal oscillator frequency to the first view after cutting The timestamp of video flowing converts in frequency file, this ensure that switching after the first video file broadcast time it is correct, mention The high play quality for improving editing backsight frequency file.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by written explanation Specifically noted structure is achieved and obtained in book, claims and attached drawing.
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
Detailed description of the invention
Attached drawing is used to provide further understanding of the present invention, and constitutes part of specification, with reality of the invention It applies example to be used to explain the present invention together, not be construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the flow chart of video clipping shown according to an exemplary embodiment;
Fig. 2 is the schematic diagram of video data frame time shaft shown according to an exemplary embodiment;
Fig. 3 is the flow chart according to the video clipping shown in an exemplary embodiment one;
Fig. 4 is the flow chart according to the video clipping shown in an exemplary embodiment two;
Fig. 5 is the structure chart of the device of video clipping shown according to an exemplary embodiment;
Fig. 6 is the structure chart of processing unit 520 shown according to an exemplary embodiment;
Fig. 7 is the structure chart of processing unit 520 shown according to an exemplary embodiment;
Fig. 8 is the structure chart of processing unit 520 shown according to an exemplary embodiment;
Fig. 9 is the structure chart of scaling unit 530 shown according to an exemplary embodiment.
Specific embodiment
Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings, it should be understood that preferred reality described herein Apply example only for the purpose of illustrating and explaining the present invention and is not intended to limit the present invention.
The technical solution that the embodiment of the present disclosure provides, cuts video flowing in source video file according to timestamp, and And according to crystal oscillator frequency to the timestamp of video flowing converts in the first video file after cutting, this ensure that the after switching One video file broadcast time it is correct, improve improve editing backsight frequency file play quality.
Fig. 1 is the flow chart of video clipping shown according to an exemplary embodiment.The process of video clipping such as Fig. 1 institute Show, comprising:
Step 101: receiving the cutting comprising the point of contact time and instruct, wherein the point of contact time includes: initial time at the end of Between.
Here, it needs by the video file of editing to be source video file.Every frame video counts in the video flowing of source video file There is corresponding timestamp according to frame.
According to application demand, it is determined that after the time of point of contact, then the cutting instruction comprising the point of contact time can be inputted, in this way, can Switching command is received, such as: the point of contact time for including in switching command includes: 8 points of initial time 0 minute and 0 second, and the end time is 8 points 5 minutes 120 milliseconds.
Step 102: to the timestamp of video flowing in source video file at the video data frame of point of contact time match Reason, obtains the first video file after cutting to source video file.
Source video file can be cut according to the point of contact time of input and video time stamp and audio time stamp, Specifically can include: when the timestamp of a video data frame in source video file video flowing is greater than or equal to the starting in the time of point of contact Time, and be less than in the time of point of contact end time when, video data frame is determined as current video data frame, forward sight is worked as in acquisition Frequency data frame.
By taking video flowing as an example, the video playing rate of source video file is 25FPS, i.e. 25 frame video datas of broadcasting per second Frame, i.e., the play time of every frame are 40ms.In this way, being with reference to starting point, then the time of first frame video data frame with 8:00 Stamp for 8 points 0 second 0 minute;And the timestamp of the second frame video data frame be 8 points 0 minute 40 milliseconds;The time of third frame video data frame Stamp for 8 points 0 minute 80 milliseconds;And so on, and the timestamp of the 9000th frame video data frame be 8 points 0 second 6 minutes.
After receiving switching command, point of contact time for including in switching command.Such as: 8 points of point of contact time initial time 0 minute 0 Second, and the end time be 8 points 5 minutes 120 milliseconds, in this way, the timestamp of first frame video data frame be 8 points 0 second 0 minute, be equal to Begin 0 minute and 0 second 8 points of time and to be less than 120 milliseconds of 5 minutes 8 points of end times, then obtains first frame video data frame, same second The timestamp of frame video data frame be 8 points 0 minute 40 milliseconds, greater than 8 points of initial time 0 minute and 0 second and be less than the end time 8: 5 Divide 120 milliseconds, then obtains the second frame video data frame.And the timestamp of the 9000th frame video data frame is at 8 points and is greater than for 0 second 6 minutes 120 milliseconds of 5 minutes 8 points of end times, then it cannot obtain the 9000th frame video data frame.
Since every frame video data frame has certain play time, such as 40 milliseconds, that cuts when being cut The end time of point time may be placed exactly among the play time of a frame, at this time, it may be necessary to carry out to the frame video data frame Processing, can abandon video data frame, or carry out the processing that rounds up.
Such as: the video playing rate of source video file is 25FPS, i.e. 25 frame video data frames of broadcasting per second, i.e., every frame Play time be 40ms.In this way, with 8:00 be with reference to starting point, then the timestamp of first frame video data frame be 8 points 0 minute 0 second;And the timestamp of the second frame video data frame be 8 points 0 minute 40 milliseconds;The timestamp of third frame video data frame be 8 points 0 minute 80 milliseconds.And 8 points of the initial time of point of contact time 0 minute and 0 second, the end time be 8 points 3 minutes 10 milliseconds, as shown in Fig. 2, the 4500th The timestamp of frame video data frame be 8 points 0 second 3 minutes, and the timestamp of the 4501st frame video data frame be 8 points 40 seconds 3 minutes, this When, the end time of point of contact time is located at after the timestamp of the 4500th frame video data frame, and the 4501st frame video data frame Timestamp before, then need to handle the 4500th frame video data frame.Specifically, the 4500th frame video can directly be abandoned Data frame.Alternatively, carrying out the processing that rounds up.
And the process for the processing that rounds up, then it needs to be determined according to the frame per second of video render, such as video playing rate It is 25FPS, i.e., the play time of every frame is 40ms.So average value is 20ms.The timestamp of 4500th frame video data frame is Relative difference between the end time of point of contact time is 10ms, and being less than 20ms then can drop the 4500th frame video data frame.When So, if the end time be 8 points 3 minutes 30 milliseconds, the timestamp of the 4500th frame video data frame at the end of the time of point of contact Between between relative difference be 30ms, be greater than 20ms, then can retain the 4500th frame video data frame.
Therefore, after obtaining current video data frame, to video flowing timestamp in source video file and point of contact time The video data frame matched is handled further include: when the end time of point of contact time be located at current video data frame timestamp it When afterwards, before the timestamp of next video data frame, current video data frame is abandoned.Or carry out the processing that rounds up.In this way, Carrying out processing to the video data frame of video flowing timestamp in source video file and point of contact time match may also include that when point of contact Between end time be located at after the timestamp of current video data frame, when before the timestamp of next video data frame, obtain Relative difference between the end time of point of contact time and the timestamp of current video data frame;According to the frame of video render Rate obtains mean time value;If relative difference is greater than and mean time value, retain current video data frame;If relative difference is small In or equal to mean time value, current video data frame is abandoned.
Step 103: according to crystal oscillator frequency, convert to the timestamp of video flowing in the first video file after switching, Determine the play time of the first video file.
The time of general terminal is obtained according to crystal oscillator frequency, therefore, also according to crystal oscillator frequency in the present embodiment, to cutting The timestamp of video flowing converts in the first video file after changing, and determines the play time of the first video file.Specifically may be used It include: the playing duration that every frame video data frame is determined according to crystal oscillator frequency;According to playing duration and the first video file it The timestamp of video flowing, converts to the timestamp in the first video file in the first preceding and adjacent video file.
Such as: crystal oscillator frequency 1920, the playing duration 21ms of corresponding every frame video data frame.The first video after cutting File is 8 points of 0 second 20 minutes to 8 points 0 second 25 minutes video files, and the first video file is before and in the first adjacent video file In video flowing the timestamp of last frame video data frame be 8 points 0 second 15 minutes, then the first of the first video file video flowing 8 points of timestamp of frame video data frame be scaled within 0 second 20 minutes 8 points 15 minutes 21 milliseconds, successively modify the first video file video flowing In every frame video data frame timestamp.
As it can be seen that being cut according to timestamp to video flowing in source video file, and in the embodiment of the present invention according to crystalline substance Vibration frequency is to the timestamp of video flowing converts in the first video file after cutting, this ensure that the first video text after switching Part broadcast time it is correct, improve improve editing backsight frequency file play quality.
Below by operating process set into specific embodiment, the method that the embodiment of the present disclosure provides is illustrated.
Embodiment one, in the present embodiment, the video playing rate of source video file is 25FPS, i.e., 25 frames of broadcasting per second regard Frequency data frame, i.e., the play time of every frame are 40ms.It is at 8 points since play time to one section to tie within 0 second 0 minute to 9 points 0 second 0 minute The source video file of beam is cut, and is obtained a period of time stamp as 8 points and is started within 0 second 5 minutes first to 8 points of 30 milliseconds of end in 10 minutes Video file.Referring to Fig. 3, the process of video clipping includes: in the present embodiment
Step 301: receiving the cutting comprising the point of contact time and instruct, wherein the point of contact time includes: initial time at the end of Between.
Cutting instruction in the point of contact time be respectively 8 points 0 second 5 minutes and 8 points 10 minutes 30 milliseconds.
Step 302: obtaining each current video data frame in source video file with point of contact time match.
When the timestamp of a video data frame in source video file video flowing is greater than or equal to the starting in the time of point of contact Between, and be less than in the time of point of contact end time when, video data frame is determined as current video data frame, obtains current video Data frame.I.e. the timestamp of video data frame be greater than or equal to 8 points 0 second 5 minutes, and less than 8 points 10 minutes 30 milliseconds, by video data Frame is determined as current video data frame, obtains current video data frame.
Step 303: the end time for judging the point of contact time is next view after the timestamp of current video data frame Before the timestamp of frequency data frame? if so, executing step 304, otherwise, step 305 is executed.
The end time of point of contact time may be placed exactly among the play time of one-frame video data frame, therefore, when cutting When the end time of point time is located among the play time of one-frame video data frame, step 304 is executed, otherwise, executes step 305。
Step 304: abandoning current video data frame.
Since the end time of point of contact time is located among the play time of one-frame video data frame, in order to reduce to subsequent The influence of the conversion of the timestamp of first video file can abandon current video data frame.
Step 305: according to crystal oscillator frequency, convert to the timestamp of video flowing in the first video file after switching, Determine the play time of the first video file.
If the end time of point of contact time is located among the play time of one-frame video data frame, the current video has been abandoned It is after data frame, then complete when the play time of last frame video data frame, then broadcasting for subsequent first video file is not influenced Put 8 points of the timestamp of last frame video data frame in the conversion of time, such as the video flowing of preceding first video file 9 minutes 9960ms.In the video flowing of so next first video file the timestamp of first frame video data frame then from 8 points 0 second 10 minutes Start.
As it can be seen that the video data frame of imperfect broadcasting is abandoned in the present embodiment, it can be in order to subsequent video data The modification of the timestamp of frame still can completely be played according to video data frame and be modified, and improved and improved editing rear video text The play quality of part.
Embodiment two, in the present embodiment, the video playing rate of source video file is 25FPS, i.e., 25 frames of broadcasting per second regard Frequency data frame, i.e., the play time of every frame are 40ms.It is at 8 points since play time to one section to tie within 0 second 0 minute to 9 points 0 second 0 minute The source video file of beam is cut, and is obtained a period of time stamp as 8 points and is started within 0 second 5 minutes first to 8 points of 30 milliseconds of end in 10 minutes Video file.Referring to fig. 4, the process of video clipping includes: in the present embodiment
Step 401: receiving the cutting comprising the point of contact time and instruct, wherein the point of contact time includes: initial time at the end of Between.
Cutting instruction in the point of contact time be respectively 8 points 0 second 5 minutes and 8 points 10 minutes 30 milliseconds.
Step 402: obtaining each current video data frame in source video file with point of contact time match.
The timestamp of video data frame be greater than or equal to 8 points 0 second 5 minutes, and less than 8 points 10 minutes 30 milliseconds, by video data Frame is determined as current video data frame, obtains current video data frame.
Step 403: the end time for judging the point of contact time is next view after the timestamp of current video data frame Before the timestamp of frequency data frame? if so, executing step 404, otherwise, step 408 is executed.
The end time of point of contact time may be placed exactly among the play time of one-frame video data frame, therefore, when cutting When the end time of point time is located among the play time of one-frame video data frame, step 404 is executed, otherwise, executes step 408.Such as: the end time of point of contact time be 8 points 10 minutes 30 milliseconds, and the timestamp of current video data frame be 8 points 10 minutes 0 Second, the timestamp of next video data frame be 8 points 10 minutes 40 milliseconds, it is clear that the end time of point of contact time is located at current video Among the play time of data frame, step 404 is executed.
Step 404: the relative difference between the end time of point of contact time and the timestamp of current video data frame is obtained, And the frame per second according to video render, obtain mean time value.
Such as: the end time of point of contact time be 8 points 10 minutes 30 milliseconds, and the timestamp of current video data frame be 8 points 10 points 0 second, relative difference between the two is 30 milliseconds.And the frame per second of video render is 25FPS, and the play time of every frame For 40ms, thus, mean time value can be 20 milliseconds.
Step 405: judging that relative difference is greater than mean time value? it is no to then follow the steps if executing step 406 407。
The present embodiment handles the current video data frame comprising cut point using the strategy to round up.
Step 406: retaining current video data frame.
If relative difference between the two, which is 30 milliseconds, is greater than 20 milliseconds of average value, retain current video data frame.
Step 407: abandoning current video data frame.
If relative difference between the two, which is 10 milliseconds, is less than 20 milliseconds of average value, current video data frame is abandoned.When So, equal to when can also abandon current video data frame
Step 408: according to crystal oscillator frequency, convert to the timestamp of video flowing in the first video file after switching, Determine the play time of the first video file.
If the end time of point of contact time is located among the play time of one-frame video data frame, the current video is remained It is after data frame, then complete when the play time of last frame video data frame, then broadcasting for subsequent first video file is not influenced Put 8 points of the timestamp of last frame video data frame in the conversion of time, such as the video flowing of preceding first video file 10 minutes 0ms.In the video flowing of so next first video file the timestamp of first frame video data frame then from 8 points 10 minutes 40 milliseconds Start.Certainly, after discarding in the video flowing of next first video file the timestamp of first frame video data frame then from 8: 10 Divide 0 second and starts.
As it can be seen that the video data frame of imperfect broadcasting is abandoned or is retained, all may make video in the present embodiment Data frame completely plays, and improves the play quality for improving editing backsight frequency file.
Following is embodiment of the present disclosure, can be used for executing embodiments of the present disclosure.
According to the process of above-mentioned video clipping, a kind of device of video clipping can be constructed, as shown in figure 5, the device includes: It include: receiving unit 510, processing unit 520 and scaling unit 530, wherein
Receiving unit 510 instructs, wherein the point of contact time includes: initial time for receiving the cutting comprising the point of contact time And the end time.
Processing unit 520, the video data for timestamp and point of contact time match to video flowing in source video file Frame is handled, and the first video file after cutting to source video file is obtained.
Scaling unit 530, for changing the timestamp in the first video file after switching according to crystal oscillator frequency It calculates, determines the play time of the first video file.
In one embodiment of the invention, as shown in fig. 6, processing unit 520 comprises determining that subelement 521 and obtains subelement 522.Wherein,
Subelement 521 is determined, for being greater than or equal to when the timestamp of a video data frame in source video file video flowing Initial time in the time of point of contact, and be less than the point of contact time in end time when, video data frame is determined as current video Data frame.
Subelement 522 is obtained, for obtaining current video data frame.
In one embodiment of the invention, as shown in fig. 7, processing unit 520 further include: abandon subelement 523.Abandon subelement 523, after being located at the timestamp of current video data frame for the end time when the point of contact time, next video data frame when Between stab before when, abandon current video data frame.
In one embodiment of the invention, as shown in figure 8, processing unit further include: selection subelement 524.And select subelement 524, after the end time for the point of contact time is located at the timestamp of current video data frame, the time of next video data frame When before stamp, the relative difference between the end time of point of contact time and the timestamp of current video data frame is obtained;According to view The frame per second of frequency stream broadcasting obtains mean time value;If relative difference is greater than and mean time value, retain current video data frame; If relative difference is less than or equal to mean time value, current video data frame is abandoned.
In one embodiment of the invention, as shown in figure 9, scaling unit 530 includes: that duration determines subelement 531 and conversion Unit 532.
Duration determines subelement, for determining the playing duration of every frame video data frame according to crystal oscillator frequency;
Convert subelement, for according to before playing duration and the first video file and the first adjacent video file Timestamp, convert to the timestamp of video flowing in the first video file.
As it can be seen that the device of video clipping of the embodiment of the present invention can cut video flowing in source video file according to timestamp It cuts, and according to crystal oscillator frequency to the timestamp of video flowing converts in the first video file after cutting, this ensure that cutting The correct of rear first video file broadcast time is changed, the play quality for improving editing backsight frequency file is improved.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The shape for the computer program product implemented in usable storage medium (including but not limited to magnetic disk storage and optical memory etc.) Formula.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (2)

1. a kind of method of video clipping characterized by comprising
It receives the cutting comprising the point of contact time to instruct, wherein the point of contact time includes: initial time and end time;
The video data frame of the timestamp and the point of contact time match of video flowing in source video file is handled, is obtained pair First after the source video file is cut cuts video file;
According to crystal oscillator frequency, converts, determine to the timestamp of video flowing in the first cutting video file after switching The play time of the first cutting video file;
It is described to be converted according to crystal oscillator frequency to the timestamp of video flowing in the first cutting video file after switching, Determine it is described first cutting video file play time include:
The playing duration of every frame video data frame is determined according to crystal oscillator frequency;
It is regarded according to before the playing duration and the first cutting video file and in the second adjacent cutting video file The timestamp of frequency stream converts to the timestamp in the first cutting video file;
The video data frame to video flowing timestamp in source video file and the point of contact time match carries out processing
When the timestamp of a video data frame in the source video file video flowing is greater than or equal to rising in the point of contact time Begin the time, and be less than the point of contact time in end time when, the video data frame is determined as current video data frame;
Obtain the current video data frame;
Abandon or retain the current video data frame;
The discarding retains the current video data frame, comprising:
After the end time of the point of contact time being located at the timestamp of the current video data frame, next video data frame Timestamp before when, abandon the current video data frame;Or
The discarding retains the current video data frame and includes:
After the end time of the point of contact time being located at the timestamp of the current video data frame, next video data frame Timestamp before when, obtain the phase between the end time of the point of contact time and the timestamp of the current video data frame To difference;
According to the frame per second of the video render, the mean time value for playing every frame video frame is obtained;
If the relative difference be greater than with the mean time value, retain the current video data frame;
If the relative difference is less than or equal to the mean time value, the current video data frame is abandoned.
2. a kind of device of video clipping characterized by comprising
Receiving unit, for receive include the point of contact time cutting instruct, wherein the point of contact time include: initial time and End time;
Processing unit, for video flowing in source video file timestamp and the point of contact time match video data frame into Row processing obtains the first cutting video file after cutting to the source video file;
Scaling unit, for changing the timestamp in the first cutting video file after switching according to crystal oscillator frequency It calculates, determines the play time of the first cutting video file;
The scaling unit includes:
Duration determines subelement, for determining the playing duration of every frame video data frame according to crystal oscillator frequency;
Convert subelement, for according to before the playing duration and the first cutting video file and adjacent second The timestamp for cutting video file converts to the timestamp of video flowing in the first cutting video file;
The processing unit includes:
It determines subelement, is greater than or equal to for the timestamp when a video data frame in the source video file video flowing described Initial time in the time of point of contact, and be less than the point of contact time in end time when, the video data frame is determined as Current video data frame;
Subelement is obtained, for obtaining the current video data frame;
The processing unit is also used to abandon or retain the current video data frame;
The processing unit further include:
Abandon subelement, for when the point of contact time end time be located at the current video data frame timestamp it When afterwards, before the timestamp of next video data frame, the current video data frame is abandoned;Or
The processing unit further include:
Subelement is selected, after the end time for the point of contact time is located at the timestamp of the current video data frame, When before the timestamp of next video data frame, obtain the point of contact time end time and the current video data frame Relative difference between timestamp;According to the frame per second of the video render, the mean time value for playing every frame video frame is obtained; If the relative difference be greater than with the mean time value, retain the current video data frame;If the relative difference is less than Or it is equal to the mean time value, abandon the current video data frame.
CN201510957866.6A 2015-12-18 2015-12-18 A kind of method and apparatus of video clipping Expired - Fee Related CN105578261B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510957866.6A CN105578261B (en) 2015-12-18 2015-12-18 A kind of method and apparatus of video clipping

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510957866.6A CN105578261B (en) 2015-12-18 2015-12-18 A kind of method and apparatus of video clipping

Publications (2)

Publication Number Publication Date
CN105578261A CN105578261A (en) 2016-05-11
CN105578261B true CN105578261B (en) 2019-04-26

Family

ID=55887850

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510957866.6A Expired - Fee Related CN105578261B (en) 2015-12-18 2015-12-18 A kind of method and apparatus of video clipping

Country Status (1)

Country Link
CN (1) CN105578261B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109068163B (en) * 2018-08-28 2021-01-29 青岛一舍科技有限公司 Audio and video synthesis system and synthesis method thereof
CN113095202A (en) * 2021-04-07 2021-07-09 中国工商银行股份有限公司 Data segmentation method and device in double-record data quality inspection
CN113095204B (en) * 2021-04-07 2022-09-02 中国工商银行股份有限公司 Double-recording data quality inspection method, device and system

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009825A (en) * 2006-01-27 2007-08-01 中国科学院声学研究所 The method for IPTV STB/unicast seamless switching based on RTP protocol
CN101325083A (en) * 2008-07-28 2008-12-17 凌阳科技股份有限公司 Method for playing multimedia file without seam
CN101996662A (en) * 2010-10-22 2011-03-30 深圳市万兴软件有限公司 Method and device for connecting and outputting video files
CN102143145A (en) * 2010-10-27 2011-08-03 华为技术有限公司 Media data recording and providing methods and devices
CN102547248A (en) * 2012-02-03 2012-07-04 深圳锐取信息技术股份有限公司 Multi-channel real-time monitoring single-video-file recording method
CN102647622A (en) * 2012-04-23 2012-08-22 青岛海信传媒网络技术有限公司 Play progress management method for streaming media clip and play progress management system for streaming media clip
CN103096184A (en) * 2013-01-18 2013-05-08 深圳市龙视传媒有限公司 Method and device for video editing
CN103248950A (en) * 2013-04-28 2013-08-14 天脉聚源(北京)传媒科技有限公司 System and method for customizing video frame rate
CN103269460A (en) * 2013-04-28 2013-08-28 天脉聚源(北京)传媒科技有限公司 Device and method for computing duration of audio/video file
CN104994443A (en) * 2015-07-06 2015-10-21 无锡天脉聚源传媒科技有限公司 Method and device for generating EPG (Electronic Program Guide) video file
CN105142029A (en) * 2015-08-10 2015-12-09 北京彩云动力教育科技有限公司 Interactive video clipping system and interactive video clipping method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2838268B1 (en) * 2013-07-31 2019-02-20 Axis AB Method, device and system for producing a merged digital video sequence

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009825A (en) * 2006-01-27 2007-08-01 中国科学院声学研究所 The method for IPTV STB/unicast seamless switching based on RTP protocol
CN101325083A (en) * 2008-07-28 2008-12-17 凌阳科技股份有限公司 Method for playing multimedia file without seam
CN101996662A (en) * 2010-10-22 2011-03-30 深圳市万兴软件有限公司 Method and device for connecting and outputting video files
CN102143145A (en) * 2010-10-27 2011-08-03 华为技术有限公司 Media data recording and providing methods and devices
CN102547248A (en) * 2012-02-03 2012-07-04 深圳锐取信息技术股份有限公司 Multi-channel real-time monitoring single-video-file recording method
CN102647622A (en) * 2012-04-23 2012-08-22 青岛海信传媒网络技术有限公司 Play progress management method for streaming media clip and play progress management system for streaming media clip
CN103096184A (en) * 2013-01-18 2013-05-08 深圳市龙视传媒有限公司 Method and device for video editing
CN103248950A (en) * 2013-04-28 2013-08-14 天脉聚源(北京)传媒科技有限公司 System and method for customizing video frame rate
CN103269460A (en) * 2013-04-28 2013-08-28 天脉聚源(北京)传媒科技有限公司 Device and method for computing duration of audio/video file
CN104994443A (en) * 2015-07-06 2015-10-21 无锡天脉聚源传媒科技有限公司 Method and device for generating EPG (Electronic Program Guide) video file
CN105142029A (en) * 2015-08-10 2015-12-09 北京彩云动力教育科技有限公司 Interactive video clipping system and interactive video clipping method

Also Published As

Publication number Publication date
CN105578261A (en) 2016-05-11

Similar Documents

Publication Publication Date Title
US10200768B2 (en) Low-latency mobile device audiovisual streaming
CN105100961B (en) Video thumbnail generation method and generating means
CN105578261B (en) A kind of method and apparatus of video clipping
CN110139148B (en) Video switching definition method and related device
EP3996382A1 (en) Gapless video looping
CN107566889B (en) Audio stream flow velocity error processing method and device, computer device and computer readable storage medium
CN105898500A (en) Network video play method and device
CN106658226B (en) Playing method and device
CN104410930A (en) A method and device for controlling playing speed of transport stream TS media file
CN104125516A (en) Media file receiving method and apparatus, media file sending method and apparatus, and system
US10021433B1 (en) Video-production system with social-media features
CN105530534B (en) A kind of method and apparatus of video clipping
CN110809179A (en) Method and system for switching live broadcast time-shifting time axis under HLS protocol
CN105898551A (en) Network video playing method and device
CN104581340B (en) Client, stream medium data method of reseptance and stream medium data transmission system
CN110087116B (en) Multi-rate live video stream editing method and device, terminal and storage medium
CN103581730A (en) Method for achieving synchronization of audio and video on digital set top box
CN104822087B (en) A kind of processing method and processing device of video-frequency band
CN100474934C (en) Data processing apparatus and method
CN105611401B (en) A kind of method and apparatus of video clipping
CN108156498B (en) Audio and video synchronization method and device
CN108989906A (en) A kind of live video processing method and processing device
CN104918075B (en) A kind of method and device of program continued broadcasting
US20140047309A1 (en) Apparatus and method for synchronizing content with data
CN105578260A (en) Video editing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method and device for video editing

Effective date of registration: 20210104

Granted publication date: 20190426

Pledgee: Inner Mongolia Huipu Energy Co.,Ltd.

Pledgor: WUXI TVMINING MEDIA SCIENCE & TECHNOLOGY Co.,Ltd.

Registration number: Y2020990001517

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190426