CN109257545A - A kind of multisource video clipping method, device and storage medium - Google Patents

A kind of multisource video clipping method, device and storage medium Download PDF

Info

Publication number
CN109257545A
CN109257545A CN201810983670.8A CN201810983670A CN109257545A CN 109257545 A CN109257545 A CN 109257545A CN 201810983670 A CN201810983670 A CN 201810983670A CN 109257545 A CN109257545 A CN 109257545A
Authority
CN
China
Prior art keywords
music
snatch
video
duration
video clip
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.)
Granted
Application number
CN201810983670.8A
Other languages
Chinese (zh)
Other versions
CN109257545B (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.)
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Culture 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 China Mobile Communications Group Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201810983670.8A priority Critical patent/CN109257545B/en
Publication of CN109257545A publication Critical patent/CN109257545A/en
Application granted granted Critical
Publication of CN109257545B publication Critical patent/CN109257545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • 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/439Processing of audio elementary streams
    • 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing 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
    • 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/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing

Abstract

The invention discloses a kind of multisource video clipping methods, which comprises obtains target music, the target music is divided at least two snatch of music;According to the first quantity of the snatch of music, the video clip of the second quantity is chosen from least one source video file;Judge whether the duration of current music segment meets the constraint condition of setting;Based on above-mentioned judging result, the current music segment is assigned in corresponding video clip, until at least two snatch of music is assigned to completely in corresponding video clip;Determine unappropriated maximum time video frame section in the video clip, the first ratio based on setting carries out interval division to maximum time video frame section;Based on above-mentioned interval division as a result, each video clip is associated with the snatch of music distributed, the target video file with music rhythm is generated.The invention also discloses a kind of multisource video editing device and storage mediums.

Description

A kind of multisource video clipping method, device and storage medium
Technical field
The present invention relates to multimedia data processing field more particularly to a kind of multisource video clipping method, device and Storage medium.
Background technique
Currently, when carrying out editing to Video Music titbit, it usually needs it is realized by the way of manual operation, it is specific to grasp Make process, for example, selecting a certain number of video sources by user, selects the piece of video for meeting own interests and hobby Section carries out special marking to the video clip selected, and operator is using video clipping software to marked piece of video later Section is spliced according to preparatory sequence, then the background music of the editing video, finally background music is loaded into video, to reach To the video display effect with music rhythm.
However, since which is by manually Picking video segment, operating efficiency are limited to the quantity of source video And the duration of source video, therefore, when need editing number of videos it is larger when, larger workload, inefficiency.In practical application In, the mode Picking video segment for randomly selecting segment can also be used, however, cannot be considered in terms of using the video which editing goes out The content of multiple videos, and it is unable to satisfy music titbit and the diversified demand of video visual, to influence editing video Quality reduces user experience.
Summary of the invention
In view of this, an embodiment of the present invention is intended to provide a kind of multisource video clipping method, device and storage mediums, at least To solve the problems, such as to be difficult to realize quality that is easy to operate and effectively improving editing video in the related technology.
In order to achieve the above objectives, the technical solution of the embodiment of the present invention is achieved in that
In a first aspect, the embodiment of the present invention provides a kind of multisource video clipping method, which comprises
Target music is obtained, the target music is divided at least two snatch of music;
According to the first quantity of the snatch of music, the piece of video of the second quantity is chosen from least one source video file Section, wherein first quantity matches with second quantity;
Judge whether the duration of current music segment meets the constraint condition of setting;
Based on above-mentioned judging result, the current music segment is assigned in corresponding video clip, described in extremely Few two snatch of music are assigned to completely in corresponding video clip;
Determine unappropriated maximum time video frame section in the video clip, the first ratio based on setting, to institute It states maximum time video frame section and carries out interval division;
Based on above-mentioned interval division as a result, each video clip is associated with the snatch of music distributed, generation has The target video file of music rhythm.
Second aspect, the embodiment of the present invention also provide a kind of multisource video editing device, and described device includes: acquisition mould Block, chooses module, judgment module, distribution module and relating module at division module;Wherein,
The acquisition module, for obtaining target music;
The division module, for the target music to be divided at least two snatch of music;
The selection module is selected from least one source video file for the first quantity according to the snatch of music Take the video clip of the second quantity, wherein first quantity matches with second quantity;
The judgment module, for judging whether the duration of current music segment meets the constraint condition of setting;
The current music segment is assigned to corresponding video for being based on above-mentioned judging result by the distribution module In segment, until at least two snatch of music is assigned to completely in corresponding video clip;
The division module is also used to determine unappropriated maximum time video frame section in the video clip, is based on First ratio of setting carries out interval division to maximum time video frame section;
The relating module, for based on above-mentioned interval division as a result, by each video clip and the snatch of music that is distributed It is associated, generates the target video file with music rhythm.
The third aspect, the embodiment of the present invention also provide a kind of multisource video editing device, including memory, processor and deposit The executable program that can be run on a memory and by the processor is stored up, when the processor runs the executable program The step of executing multisource video clipping method provided in an embodiment of the present invention.
Fourth aspect, the embodiment of the present invention also provide a kind of storage medium, are stored thereon with executable program, described to hold The step of multisource video clipping method provided in an embodiment of the present invention is realized when line program is executed by processor.
Multisource video clipping method, device and storage medium provided by the embodiment of the present invention, according to the musical film of division First quantity of section, the video clip of the second quantity to match is chosen from least one source video file, judges current sound Whether the duration of happy segment meets the constraint condition of setting, is based on judging result, the current music segment is assigned to correspondence Video clip in, until at least two snatch of music is assigned to completely in corresponding video clip, determine the view Unappropriated maximum time video frame section in frequency segment, the first ratio based on setting, to maximum time video frame area Between carry out interval division;Based on interval division as a result, each video clip is associated with the snatch of music distributed, tool is generated There is the target video file of music rhythm.In this way, can be to avoid heavy workload, the efficiency caused by by the way of manual editing Low problem, meanwhile, the content of multiple videos can be taken into account using the video that the technical solution editing of the embodiment of the present invention goes out, it is full The happy titbit of footsteps and the diversified demand of video visual, to realize the mesh of quality that is easy to operate and effectively improving editing video , it greatly enhances the user experience.
Detailed description of the invention
Fig. 1 is a kind of implementation process schematic diagram of multisource video clipping method provided in an embodiment of the present invention;
Fig. 2 is a kind of illustrative view of functional configuration of multisource video editing device provided in an embodiment of the present invention;
Fig. 3 is the illustrative view of functional configuration of another multisource video editing device provided in an embodiment of the present invention;
Fig. 4 is the illustrative view of functional configuration of another multisource video editing device provided in an embodiment of the present invention;
Fig. 5 is a kind of hardware structural diagram of multisource video editing device provided in an embodiment of the present invention.
Specific embodiment
The characteristics of in order to more fully hereinafter understand the embodiment of the present invention and technology contents, with reference to the accompanying drawing to this hair The realization of bright embodiment is described in detail, appended attached drawing purposes of discussion only for reference, is not used to limit the present invention.This field It will be appreciated by the skilled person that between each technical solution documented by the embodiment of the present invention, it in the absence of conflict, can be any Combination.
Fig. 1 is a kind of implementation process schematic diagram of multisource video clipping method provided in an embodiment of the present invention, the multi-source Video clipping method can be applied in terminal device;As shown in Figure 1, the reality of the multisource video clipping method in the embodiment of the present invention Existing process, may comprise steps of:
Step 101: obtaining target music, the target music is divided at least two snatch of music.
It in embodiments of the present invention, include at least one rhythm point in acquired target music, according to target music The target music can be divided at least two snatch of music by rhythm point.For example, target music includes N number of rhythm point, then this N Target music can be divided into N+1 snatch of music by a rhythm point;Wherein, N is the positive integer more than or equal to 1.
Here, the rhythm point of target music can be set according to the musical features of target music, and the musical features include section Clap feature, wherein tempo characteristic may include the acoustic amplitudes information of target music.It is set according to the acoustic amplitudes information of target music The process for setting the rhythm point of target music specifically may is that the acoustic amplitudes information that frequency domain is preset from target extraction of music, choosing Rhythm point of the time point for taking acoustic amplitudes in the default frequency domain to increase sharply as target music, make between adjacent rhythm point when Between interval duration be greater than preset duration.
Time point that the acoustic amplitudes increase sharply is it is to be understood that acoustic amplitudes are from being reduced to increase in default frequency domain Time inflection point.Time interval duration between adjacent rhythm point is greater than preset duration, can be played to avoid adjacent segments between a little when Between be spaced too short and keep matched video clip very short, and then influence editing after video result of broadcast.
Step 102: according to the first quantity of the snatch of music, choosing the second quantity from least one source video file Video clip, wherein first quantity matches with second quantity.
Here, first quantity matches with second quantity, for example, target music includes N number of rhythm point, then this Target music can be divided into N+1 snatch of music by N number of rhythm point, and N is the positive integer more than or equal to 1, then, it can be from M source N+1 video clip is intercepted in video file.Wherein, M is the positive integer more than or equal to 2.
Step 103: judging whether the duration of current music segment meets the constraint condition of setting.
Here, the constraint condition includes the first constraint condition and the second constraint condition.
In embodiments of the present invention, judge whether the duration of current music segment meets the pact of setting in this step 103 Before beam condition, the multisource video clipping method further include:
Detect whether each video frame in the video clip includes facial image, determine include facial image video The video frame including facial image is marked in frame, to distinguish the video frame for not including facial image;
Corresponding 4th snatch of music is distributed for the video frame including facial image, if detecting described at least two Snatch of music is not fully allocated, judges whether the duration of current music segment meets the constraint condition of setting;
Wherein, the current music segment be at least two snatch of music in addition to the 4th snatch of music Other snatch of music.
It should be noted that the embodiment of the present invention is by calling open source computer vision library (OpenCV, Open Source Computer Vision Library) face recognition module in framework, it will be wrapped from the video clip that multiple video sources are chosen The facial image included identifies, and the video frame of the facial image identified is marked, and does not include face to distinguish The video frame of image.OpenCV can be used for developing real-time image procossing, computer vision and pattern recognition program.
Here, described to distribute corresponding 4th snatch of music for the video frame including facial image, it specifically includes:
First duration in the detection video frame section including facial image;
All video frames including facial image are traversed, the snatch of music to match with first duration is searched;
If finding the 4th snatch of music with the first duration successful match, the 4th snatch of music that will be found As the snatch of music distributed for the video frame including facial image.
Wherein, multisource video clipping method further include: if not finding the 4th with the first duration successful match Snatch of music, first duration in the adjustment video frame section including facial image.
Here, it for adjusting first duration in the video frame section including facial image, can use following Mode is realized:
When detecting that the second duration of the 4th snatch of music is greater than first duration, extending described includes face figure The initial time in the video frame section of picture and/or termination time, so that first duration matches with second duration;
When detecting that second duration is less than first duration, shorten the video frame section including facial image Initial time and/or terminate the time so that first duration matches with second duration.
In this way, the embodiment of the present invention choose automatically include facial image video frame, and to include facial image Video frame preferentially distributes corresponding snatch of music, it is ensured that the target video file with music rhythm that final editing goes out goes out Now more facial images have more human interest to meet user to music titbit and the diversified demand of video visual.
It should be pointed out that in embodiments of the present invention, it is corresponding when being distributed for the video frame including facial image After 4th snatch of music, if detecting, at least two snatch of music has been fully allocated, and is not required to execute judgement currently Whether the duration of snatch of music meet the step of constraint condition of setting, but can directly by each video clip with distributed Snatch of music is associated, and generates the target video file with music rhythm;If detecting at least two snatch of music It is not fully allocated, then executes following step 104, using the distribution method of successive ignition, by least two snatch of music In remaining snatch of music distribute into corresponding video clip, until at least two snatch of music has been fully allocated.
Step 104: being based on above-mentioned judging result, the current music segment is assigned in corresponding video clip, directly It is assigned in corresponding video clip completely at least two snatch of music.
In embodiments of the present invention, when the constraint condition is first constraint condition, in this step 104 It is described to be based on above-mentioned judging result, the current music segment is assigned in corresponding video clip for, can use with Under type is realized:
At least two snatch of music is traversed according to snatch of music duration descending, according to the unassigned duration descending of video Traverse the video clip of second quantity;
It determines at least two snatch of music there are at least one unassigned first music segment, and described When the duration of one snatch of music meets first constraint condition, by least one first music segment be assigned to it is corresponding at least In one the first video clip, until detecting that the duration of the first music segment is unsatisfactory for first constraint condition.
Wherein, the duration of the first music segment meets first constraint condition, comprising:
The duration of the first music segment is less than the unassigned duration of video of first video clip, and described the The duration of one snatch of music is less than the snatch of music duration that the video of first video clip should be assigned.
Here, the snatch of music duration that the video of first video clip should be assigned can be determined by following manner: According to the duration of each first video clip, the total duration of video clip of the duration of each first video clip in the second quantity is determined In accounting;According at least one first music piece unassigned in the accounting and at least two snatch of music The total duration of section, determines the snatch of music duration that the video of the first video clip should be assigned.
It should be noted that when the duration for repeating first music segment meets first constraint condition, it will at least One first music segment is assigned at least one corresponding first video clip, until detecting the first music segment Duration be unsatisfactory for until first constraint condition can not continue distribution, detect at least two snatch of music whether there are still Second snatch of music of at least one unassigned, and if it exists, at this point, at least one second snatch of music is assigned to corresponding When at least one second video clip, constraint condition will be relaxed, to guarantee that at least two snatch of music can be fully allocated.
In embodiments of the present invention, when the constraint condition is second constraint condition, in this step 104 It is described to be based on above-mentioned judging result, the current music segment is assigned in corresponding video clip for, can use with Under type is realized:
When detecting that the duration of the first music segment is unsatisfactory for first constraint condition, detection described at least two It whether there is second snatch of music of at least one unassigned in a snatch of music;
It detects at least two snatch of music there are when second snatch of music of at least one unassigned, according to Snatch of music duration descending traverses at least one second snatch of music, according to the unassigned duration descending traversal described second of video Other video clips in the video clip of quantity in addition at least one first video clip;
When determining that the duration of second snatch of music meets second constraint condition, by least one the second musical film Section is assigned at least one corresponding second video clip, until detecting that the duration of second snatch of music is unsatisfactory for institute State the second constraint condition;
Wherein, the duration of second snatch of music meets second constraint condition, comprising:
The duration of second snatch of music is less than the unassigned duration of video of second video clip.
It should be noted that when the duration for repeating the second snatch of music meets the second constraint condition, by least one Second snatch of music is assigned at least one corresponding second video clip, until detect second snatch of music when It is long to be unsatisfactory for until second constraint condition continue distribution, detect at least two snatch of music whether there are still not by At least one third snatch of music of distribution, and if it exists, at this point, at least one third snatch of music is assigned to corresponding video When in segment, constraint condition will be removed, to guarantee that at least two snatch of music can be fully allocated.
In embodiments of the present invention, in this step 104 based on above-mentioned judging result, by the current music segment For being assigned in corresponding video clip, it can realize in the following ways:
When detecting that the duration of second snatch of music is unsatisfactory for second constraint condition, detection described at least two It whether there is at least one unassigned third snatch of music in a snatch of music;
It detects at least two snatch of music there are when at least one unassigned third snatch of music, according to Snatch of music duration descending traverses at least one third snatch of music, according to the unassigned duration descending traversal described second of video Other video clips in the video clip of quantity in addition at least one first video clip and the second video clip;
The longest snatch of music of duration at least one third snatch of music is assigned to the longest third view of corresponding duration In frequency segment, until at least two snatch of music is fully allocated.
In embodiments of the present invention, the current music segment is assigned to corresponding piece of video in this step 104 Duan Zhong, until after at least two snatch of music is assigned to completely in corresponding video clip, the multisource video editing Method can also include:
Determine whether the video frame in the selected video clip has the positional relationship of overlapping;
When determining that the video frame in the video clip has the positional relationship of overlapping, the adjustment position with overlapping The video frame of relationship is set, so that lap is staggered.
Here, time shaft shift method can be used, while increaseing or decreasing start time point and the termination of video frame fragment Time point, to adjust the video frame of the positional relationship with overlapping, so that lap is staggered.
Step 105: determining unappropriated maximum time video frame section in the video clip, the first ratio based on setting Example carries out interval division to maximum time video frame section.
In embodiments of the present invention, for the first ratio based on setting in this step 105, the maximum time is regarded It for frequency frame section carries out interval division, can realize in the following ways: based on first ratio, by the maximum time Video frame interval division is the first subinterval and the second subinterval.
Here, first ratio is any value between 15% to 35%.Preferably, first ratio is chosen as 25%, that is to say, that divided from 25% ratio in maximum time video frame section, maximum time video frame section is drawn It is divided into the first subinterval and the second subinterval, the fragmentation occurred during video clipping can be reduced, in this way so as to more Efficiently utilize video frame space.
It should be noted that can duration carry out sequence to video frame unappropriated in video clip section arrangement, To find maximum time video frame section, no longer it is described in detail here.
Step 106: based on above-mentioned interval division as a result, each video clip is associated with the snatch of music distributed, Generate the target video file with music rhythm.
In embodiments of the present invention, in this step 106 based on above-mentioned interval division as a result, by each video clip with For the snatch of music distributed is associated, it can realize in the following ways:
Determine the longest snatch of music of duration in allocated at least two snatch of music;
Detect whether corresponding first length of the longest snatch of music of the duration is less than or equal to first subinterval pair The longest snatch of music of the duration is placed in by the second length answered if first length is less than or equal to second length The initial position in first subinterval is associated;
Detect whether first length is less than or equal to the corresponding third length in second subinterval, if described first is long Degree is less than or equal to the third length, by the longest snatch of music of the duration be placed in the initial position in second subinterval into Row association;
Detect whether first length is all larger than second length and third length, if first length is all larger than Second length and third length, by the longest snatch of music of the duration be placed in the initial position in first subinterval into Row association.
Here, after being associated each video clip with the snatch of music distributed, it is seen then that each snatch of music Have mapped a video clip, according to the playing sequence of snatch of music, by the corresponding video clip of the snatch of music distributed according to It is secondary to be carried in track of video, and track of video by the snatch of music being carried on audio track and is carried on by synthesis plug-in unit On video clip synthesized, be finally synthesizing and export the target video file with music rhythm.
Using the technical solution of the embodiment of the present invention, video clip is carried out using intercrossed discrete algorithm for multiple source videos Automatic selection, it is ensured that source video file is evenly distributed selection and the continuity of picture and not repeated, can also be to avoid The problem of heavy workload caused by by the way of manual editing, low efficiency, meanwhile, using the technical side of the embodiment of the present invention The video that case editing goes out can take into account the content of multiple videos, meet music titbit and the diversified demand of video visual, with reality The purpose for showing quality that is easy to operate and effectively improving editing video, greatly enhances the user experience.
In order to realize above-mentioned multisource video clipping method, the embodiment of the invention also provides a kind of multisource video editing dresses It sets, the multisource video editing device can be applied in terminal device, and Fig. 2 is a kind of multisource video provided in an embodiment of the present invention The illustrative view of functional configuration of editing device;As shown in Fig. 2, the multisource video editing device includes: to obtain module 21, divide mould Block 22 chooses module 23, judgment module 24, distribution module 25 and relating module 26.Below to the function of above-mentioned each program module It is described in detail.Wherein,
The acquisition module 21, for obtaining target music;
The division module 22, for the target music to be divided at least two snatch of music;
The selection module 23, for the first quantity according to the snatch of music, from least one source video file Choose the video clip of the second quantity, wherein first quantity matches with second quantity;
The judgment module 24, for judging whether the duration of current music segment meets the constraint condition of setting;
The distribution module 25, for the above-mentioned judging result based on the judgment module 24, by the current music piece Section is assigned in corresponding video clip, until at least two snatch of music is assigned to corresponding video clip completely In;
The division module 22 is also used to determine unappropriated maximum time video frame section, base in the video clip In the first ratio of setting, interval division is carried out to maximum time video frame section;
The relating module 26, for based on above-mentioned interval division as a result, by each video clip and the musical film that is distributed Section is associated, and generates the target video file with music rhythm.
In embodiments of the present invention, the constraint condition includes the first constraint condition;The distribution module 25 is based on Above-mentioned judging result, the current music segment is assigned in corresponding video clip for, can come in the following ways It realizes:
At least two snatch of music is traversed according to snatch of music duration descending, according to the unassigned duration descending of video Traverse the video clip of second quantity;
It determines at least two snatch of music there are at least one unassigned first music segment, and described When the duration of one snatch of music meets first constraint condition, by least one first music segment be assigned to it is corresponding at least In one the first video clip, until detecting that the duration of the first music segment is unsatisfactory for first constraint condition;
Wherein, the duration of the first music segment meets first constraint condition, comprising:
The duration of the first music segment is less than the unassigned duration of video of first video clip, and described the The duration of one snatch of music is less than the snatch of music duration that the video of first video clip should be assigned.
In embodiments of the present invention, the constraint condition further includes the second constraint condition;For 25 base of distribution module In above-mentioned judging result, the current music segment is assigned in corresponding video clip for, can be in the following ways To realize:
When detecting that the duration of the first music segment is unsatisfactory for first constraint condition, detection described at least two It whether there is second snatch of music of at least one unassigned in a snatch of music;
It detects at least two snatch of music there are when second snatch of music of at least one unassigned, according to Snatch of music duration descending traverses at least one second snatch of music, according to the unassigned duration descending traversal described second of video Other video clips in the video clip of quantity in addition at least one first video clip;
When determining that the duration of second snatch of music meets second constraint condition, by least one the second musical film Section is assigned at least one corresponding second video clip, until detecting that the duration of second snatch of music is unsatisfactory for institute State the second constraint condition;
Wherein, the duration of second snatch of music meets second constraint condition, comprising:
The duration of second snatch of music is less than the unassigned duration of video of second video clip.
In embodiments of the present invention, above-mentioned judging result is based on for the distribution module 25, by the current music piece Section can be realized in the following ways for being assigned in corresponding video clip:
When detecting that the duration of second snatch of music is unsatisfactory for second constraint condition, detection described at least two It whether there is at least one unassigned third snatch of music in a snatch of music;
It detects at least two snatch of music there are when at least one unassigned third snatch of music, according to Snatch of music duration descending traverses at least one third snatch of music, according to the unassigned duration descending traversal described second of video Other video clips in the video clip of quantity in addition at least one first video clip and the second video clip;
The longest snatch of music of duration at least one third snatch of music is assigned to the longest third view of corresponding duration In frequency segment, until at least two snatch of music is fully allocated.
In embodiments of the present invention, the first ratio for the division module 22 based on setting, to the maximum time Video frame section can realize in the following ways for interval division: based on first ratio, by the maximum Duration video frame interval division is the first subinterval and the second subinterval.
For the relating module 26 based on above-mentioned interval division as a result, by each video clip and the snatch of music distributed For being associated, it can realize in the following ways:
Determine the longest snatch of music of duration in allocated at least two snatch of music;
Detect whether corresponding first length of the longest snatch of music of the duration is less than or equal to first subinterval pair The longest snatch of music of the duration is placed in by the second length answered if first length is less than or equal to second length The initial position in first subinterval is associated;
Detect whether first length is less than or equal to the corresponding third length in second subinterval, if described first is long Degree is less than or equal to the third length, by the longest snatch of music of the duration be placed in the initial position in second subinterval into Row association;
Detect whether first length is all larger than second length and third length, if first length is all larger than Second length and third length, by the longest snatch of music of the duration be placed in the initial position in first subinterval into Row association.
As an implementation, Fig. 3 is the function of another multisource video editing device provided in an embodiment of the present invention Structural schematic diagram;As shown in figure 3, the multisource video editing device further include:
Determining module 27, for the current music segment to be assigned to corresponding video clip in the distribution module 25 In, until after at least two snatch of music is assigned to completely in corresponding video clip, it is described selected by determination Whether the video frame in video clip has the positional relationship of overlapping;
Module 28 is adjusted, the video frame for being determined in the video clip when the determining module 27 has the position of overlapping When setting relationship, the video frame of the adjustment positional relationship with overlapping, so that lap is staggered.
As an implementation, Fig. 4 is the function of another multisource video editing device provided in an embodiment of the present invention Structural schematic diagram;As shown in figure 4, the multisource video editing device further include:
Detection module 29, for judging whether the duration of current music segment meets the pact of setting in the judgment module 24 Before beam condition, detect whether each video frame in the video clip includes facial image, determine include facial image view Frequency frame;
Mark module 210 does not include face figure to distinguish for the video frame including facial image to be marked The video frame of picture;
The distribution module 25 is also used to the video frame to be described including facial image and distributes corresponding 4th musical film Section, if detecting, at least two snatch of music is not fully allocated, is judged whether the duration of current music segment meets and is set Fixed constraint condition;
Wherein, the current music segment be at least two snatch of music in addition to the 4th snatch of music Other snatch of music.
It should be noted that if detecting that at least two snatch of music has been fully allocated, then it is not required to execute judgement Whether the duration of current music segment meets the step of constraint condition of setting, but can directly by each video clip and divide The snatch of music matched is associated, and generates the target video file with music rhythm.
It in embodiments of the present invention, is that the video frame including facial image is distributed accordingly for the distribution module 25 The 4th snatch of music for, can realize in the following ways: the of the detection video frame section including facial image One duration;
All video frames including facial image are traversed, the snatch of music to match with first duration is searched;
If finding the 4th snatch of music with the first duration successful match, the 4th snatch of music that will be found As the snatch of music distributed for the video frame including facial image.
In embodiments of the present invention, the adjustment module 28 is also used to be matched into first duration not finding When four snatch of music of function, first duration in the adjustment video frame section including facial image.
Here, the first duration for adjusting the video frame section including facial image for the adjustment module 28 is come It says, can realize in the following ways:
When detecting that the second duration of the 4th snatch of music is greater than first duration, extending described includes face figure The initial time in the video frame section of picture and/or termination time, so that first duration matches with second duration;
When detecting that second duration is less than first duration, shorten the video frame section including facial image Initial time and/or terminate the time so that first duration matches with second duration.
It should be understood that multisource video editing device provided by the above embodiment is carrying out multisource video editing operation When, only with the division progress of above-mentioned each program module for example, can according to need in practical application and divide above-mentioned processing With by different program module completions, i.e., the internal structure of multisource video editing device is divided into different program modules, with Complete all or part of processing described above.In addition, multisource video editing device provided by the above embodiment and multi-source regard Frequency clipping method embodiment belongs to same design, and specific implementation process is detailed in embodiment of the method, is no longer described in detail here.
In practical applications, above-mentioned each program module can by be located at terminal device on central processing unit (CPU, Central Processing Unit), microprocessor (MPU, Micro Processor Unit), digital signal processor (DSP, Digital Signal Processor) or field programmable gate array (FPGA, Field Programmable Gate ) etc. Array realize.
In order to realize above-mentioned multisource video clipping method, the embodiment of the invention also provides a kind of multisource video editing devices Hardware configuration.The multisource video editing device of the embodiment of the present invention, the multisource video are realized in description with reference to the drawings Editing device can terminal device (such as desktop computer, laptop, smart phone) in a variety of manners implement.Below The hardware configuration of the multisource video editing device of the embodiment of the present invention is described further, it will be understood that Fig. 5 illustrate only The exemplary structure of multisource video editing device rather than entire infrastructure, can be implemented as needed part-structure shown in Fig. 5 or Entire infrastructure.
Referring to Fig. 5, Fig. 5 is a kind of hardware structural diagram of multisource video editing device provided in an embodiment of the present invention, It can be applied to the various terminal equipment of aforementioned operation application program, multisource video editing device shown in fig. 5 in practical application 500 include: at least one processor 501, memory 502, user interface 503 and at least one network interface 504.The multi-source Various components in video clipping device 500 are coupled by bus system 505.It is appreciated that bus system 505 is used for Realize the connection communication between these components.Bus system 505 further includes power bus, control in addition to including data/address bus Bus and status signal bus in addition.But for the sake of clear explanation, various buses are all designated as bus system 505 in Fig. 5.
Wherein, user interface 503 may include display, keyboard, mouse, trace ball, click wheel, key, button, sense of touch Plate or touch screen etc..
It is appreciated that memory 502 can be volatile memory or nonvolatile memory, may also comprise volatibility and Both nonvolatile memories.
Memory 502 in the embodiment of the present invention is for storing various types of data to support multisource video editing device 500 operation.The example of these data includes: any computer program for operating on multisource video editing device 500, Such as executable program 5021 and operating system 5022, realize that the program of the multisource video clipping method of the embodiment of the present invention can wrap It is contained in executable program 5021.
The multisource video clipping method that the embodiment of the present invention discloses can be applied in processor 501, or by processor 501 realize.Processor 501 may be a kind of IC chip, the processing capacity with signal.It is above-mentioned during realization Each step of multisource video clipping method can pass through the integrated logic circuit of the hardware in processor 501 or software form Instruction is completed.Above-mentioned processor 501 can be general processor, DSP or other programmable logic device, discrete gate or Person's transistor logic, discrete hardware components etc..Processor 501 may be implemented or execute to be provided in the embodiment of the present invention Each multisource video clipping method, step and logic diagram.General processor can be microprocessor or any conventional processing Device etc..In conjunction with provided by the embodiment of the present invention the step of multisource video clipping method, it can be embodied directly at hardware decoding Reason device executes completion, or in decoding processor hardware and software module combine and execute completion.Software module can be located at In storage medium, which is located at memory 502, and processor 501 reads the information in memory 502, in conjunction with its hardware The step of completing multisource video clipping method provided in an embodiment of the present invention.
In embodiments of the present invention, the multisource video editing device 500 includes memory 502, processor 501 and storage On memory 502 and the executable program 5021 that can be run by the processor 501, the processor 501 run described It is realized when executable program 5021: obtaining target music, the target music is divided at least two snatch of music;According to institute The first quantity for stating snatch of music chooses the video clip of the second quantity from least one source video file, wherein described One quantity matches with second quantity;Judge whether the duration of current music segment meets the constraint condition of setting;It is based on The current music segment is assigned in corresponding video clip by above-mentioned judging result, until at least two musical film Section is assigned to completely in corresponding video clip;Determine unappropriated maximum time video frame section in the video clip, The first ratio based on setting carries out interval division to maximum time video frame section;Based on above-mentioned interval division as a result, Each video clip is associated with the snatch of music distributed, generates the target video file with music rhythm.
As an implementation, the realization when processor 501 runs the executable program 5021: the constraint item Part includes the first constraint condition;Traverse at least two snatch of music according to snatch of music duration descending, according to video not by Distribution duration descending traverses the video clip of second quantity;Determine that there are unassigned at least two snatch of music At least one first music segment will at least and when the duration of the first music segment meets first constraint condition One first music segment is assigned at least one corresponding first video clip, until detecting the first music segment Duration be unsatisfactory for first constraint condition.
As an implementation, the realization when processor 501 runs the executable program 5021: the constraint item Part further includes the second constraint condition;When detecting that the duration of the first music segment is unsatisfactory for first constraint condition, It detects at least two snatch of music with the presence or absence of second snatch of music of at least one unassigned;Described in detecting extremely There are when second snatch of music of at least one unassigned in few two snatch of music, traversed according to snatch of music duration descending At least one second snatch of music is traversed in the video clip of second quantity according to the unassigned duration descending of video except extremely Other video clips other than few first video clip;Determine that the duration of second snatch of music meets described second about When beam condition, at least one second snatch of music is assigned at least one corresponding second video clip, until detecting The duration of second snatch of music is unsatisfactory for second constraint condition.
As an implementation, the realization when processor 501 runs the executable program 5021: detecting When stating the duration of the second snatch of music and being unsatisfactory for second constraint condition, detects and whether deposited at least two snatch of music In at least one unassigned third snatch of music;Detect at least two snatch of music there are it is unassigned extremely When a few third snatch of music, at least one third snatch of music is traversed according to snatch of music duration descending, not according to video Duration descending is assigned to traverse in the video clip of second quantity except at least one first video clip and the second piece of video Other video clips other than section;The longest snatch of music of duration at least one third snatch of music is assigned to corresponding duration In longest third video clip, until at least two snatch of music is fully allocated.
As an implementation, the realization when processor 501 runs the executable program 5021: based on described the The maximum time video frame interval division is the first subinterval and the second subinterval by one ratio;It determines allocated described The longest snatch of music of duration at least two snatch of music;Detect corresponding first length of the longest snatch of music of the duration Whether corresponding second length in first subinterval is less than or equal to, if first length is less than or equal to second length, The initial position that the longest snatch of music of the duration is placed in first subinterval is associated;Detect first length Whether the corresponding third length in second subinterval is less than or equal to, if first length is less than or equal to the third length, The initial position that the longest snatch of music of the duration is placed in second subinterval is associated;Detect first length Whether second length and third length are all larger than, if first length is all larger than second length and third length, The initial position that the longest snatch of music of the duration is placed in first subinterval is associated.
As an implementation, the realization when processor 501 runs the executable program 5021: described by institute It states current music segment to be assigned in corresponding video clip, until at least two snatch of music is assigned to correspondence completely Video clip in after, determine whether the video frame in the selected video clip has the positional relationship of overlapping;When When determining that the video frame in the video clip has the positional relationship of overlapping, the view of the adjustment positional relationship with overlapping Frequency frame, so that lap is staggered.
As an implementation, the realization when processor 501 runs the executable program 5021: in the judgement Before whether the duration of current music segment meets the constraint condition of setting, detect whether each video frame in the video clip wraps Include facial image, determine include facial image video frame, the video frame including facial image is marked, with area Divide video frame not including facial image;Corresponding 4th snatch of music is distributed for the video frame including facial image, if It detects that at least two snatch of music is not fully allocated, judges whether the duration of current music segment meets the pact of setting Beam condition;Wherein, the current music segment be at least two snatch of music in addition to the 4th snatch of music Other snatch of music.
As an implementation, the realization when processor 501 runs the executable program 5021: the packet is detected Include first duration in the video frame section of facial image;All video frames including facial image are traversed, are searched and described first The snatch of music that duration matches;If finding the 4th snatch of music with the first duration successful match, will be found The 4th snatch of music as the snatch of music distributed for the video frame including facial image.
As an implementation, the realization when processor 501 runs the executable program 5021: if not finding With the 4th snatch of music of the first duration successful match, it is described to detect that the second duration of the 4th snatch of music is greater than When the first duration, the initial time in the video frame section including facial image of extending and/or the time is terminated, so that described the One duration matches with second duration;When detecting that second duration is less than first duration, include described in shortening The initial time in the video frame section of facial image and/or termination time, so that first duration and appearance when described second Matching.
In the exemplary embodiment, the embodiment of the invention also provides a kind of storage medium, the storage medium can be light The storage mediums such as disk, flash memory or disk are chosen as non-moment storage medium.It is stored on storage medium in the embodiment of the present invention Executable program 5021, the executable program 5021 are realized when being executed by processor 501: target music are obtained, by the mesh Mark with phonetic symbols pleasure is divided at least two snatch of music;According to the first quantity of the snatch of music, from least one source video file The middle video clip for choosing the second quantity, wherein first quantity matches with second quantity;Judge current music piece Whether the duration of section meets the constraint condition of setting;Based on above-mentioned judging result, the current music segment is assigned to correspondence Video clip in, until at least two snatch of music is assigned to completely in corresponding video clip;Determine the view Unappropriated maximum time video frame section in frequency segment, the first ratio based on setting, to maximum time video frame area Between carry out interval division;It is raw based on above-mentioned interval division as a result, each video clip is associated with the snatch of music distributed At the target video file with music rhythm.
As an implementation, it is realized when the executable program 5021 is executed by processor 501: the constraint condition Including the first constraint condition;At least two snatch of music is traversed according to snatch of music duration descending, is not divided according to video The video clip of second quantity is traversed with duration descending;Determine that there are unassigned at least two snatch of music At least one first music segment, the and when duration of the first music segment meets first constraint condition, will at least one A first music segment is assigned at least one corresponding first video clip, until detecting the first music segment Duration is unsatisfactory for first constraint condition.
As an implementation, it is realized when the executable program 5021 is executed by processor 501: the constraint condition It further include the second constraint condition;When detecting that the duration of the first music segment is unsatisfactory for first constraint condition, inspection It surveys at least two snatch of music with the presence or absence of second snatch of music of at least one unassigned;Described in detecting at least There are when second snatch of music of at least one unassigned in two snatch of music, according to snatch of music duration descending traverse to Few second snatch of music is traversed in the video clip of second quantity according to the unassigned duration descending of video except at least Other video clips other than one the first video clip;Determine that the duration of second snatch of music meets second constraint When condition, at least one second snatch of music is assigned at least one corresponding second video clip, until detecting institute The duration for stating the second snatch of music is unsatisfactory for second constraint condition.
As an implementation, it is realized when the executable program 5021 is executed by processor 501: described detecting When the duration of second snatch of music is unsatisfactory for second constraint condition, detecting whether there is at least two snatch of music At least one unassigned third snatch of music;Detect at least two snatch of music there are it is unassigned at least When one third snatch of music, at least one third snatch of music is traversed according to snatch of music duration descending, according to video not by Distribution duration descending traverses in the video clip of second quantity except at least one first video clip and the second video clip Other video clips in addition;The longest snatch of music of duration at least one third snatch of music is assigned to corresponding duration most In long third video clip, until at least two snatch of music is fully allocated.
As an implementation, it is realized when the executable program 5021 is executed by processor 501: based on described first The maximum time video frame interval division is the first subinterval and the second subinterval by ratio;Determine it is allocated it is described extremely The longest snatch of music of duration in few two snatch of music;Detecting corresponding first length of the longest snatch of music of the duration is It is no to be less than or equal to corresponding second length in first subinterval, it, will if first length is less than or equal to second length The initial position that the longest snatch of music of duration is placed in first subinterval is associated;Detecting first length is It is no to be less than or equal to the corresponding third length in second subinterval, it, will if first length is less than or equal to the third length The initial position that the longest snatch of music of duration is placed in second subinterval is associated;Detecting first length is It is no to be all larger than second length and third length, it, will if first length is all larger than second length and third length The initial position that the longest snatch of music of duration is placed in first subinterval is associated.
As an implementation, realized when the executable program 5021 is executed by processor 501: it is described will be described Current music segment is assigned in corresponding video clip, until at least two snatch of music be assigned to completely it is corresponding After in video clip, determine whether the video frame in the selected video clip has the positional relationship of overlapping;When true When video frame in the fixed video clip has the positional relationship of overlapping, the video of the adjustment positional relationship with overlapping Frame, so that lap is staggered.
As an implementation, it realizes when the executable program 5021 is executed by processor 501: working as in the judgement Before whether the duration of preceding snatch of music meets the constraint condition of setting, detect in the video clip each video frame whether include Facial image, determine include facial image video frame, the video frame including facial image is marked, with distinguish It does not include the video frame of facial image;Corresponding 4th snatch of music is distributed for the video frame including facial image, if inspection It measures at least two snatch of music not to be fully allocated, judges whether the duration of current music segment meets the constraint of setting Condition;Wherein, the current music segment is its in addition to the 4th snatch of music at least two snatch of music His snatch of music.
As an implementation, it is realized when the executable program 5021 is executed by processor 501: including described in detection First duration in the video frame section of facial image;All video frames including facial image are traversed, when searching with described first The matched snatch of music of appearance;If the 4th snatch of music with the first duration successful match is found, by what is found 4th snatch of music is as the snatch of music distributed for the video frame including facial image.
As an implementation, the executable program 5021 by processor 501 execute when realize: if do not find with 4th snatch of music of the first duration successful match detects that the second duration of the 4th snatch of music is greater than described the When one duration, the initial time in the video frame section including facial image of extending and/or termination time, so that described first Duration matches with second duration;When detecting that second duration is less than first duration, shortening described includes people The initial time in the video frame section of face image and/or termination time, so that first duration and appearance when described second Match.
In conclusion multisource video clipping method provided by the embodiment of the present invention, according to the of the snatch of music of division One quantity chooses the video clip of the second quantity to match from least one source video file, judges current music segment Duration whether meet the constraint condition of setting, be based on judging result, the current music segment be assigned to corresponding video In segment, until at least two snatch of music is assigned to completely in corresponding video clip, the video clip is determined In unappropriated maximum time video frame section, the first ratio based on setting, to maximum time video frame section carry out Interval division;Based on interval division as a result, each video clip is associated with the snatch of music distributed, generating has music The target video file of rhythm.In this way, can be asked to avoid heavy workload, the low efficiency caused by by the way of manual editing Topic, meanwhile, the content of multiple videos can be taken into account using the video that the technical solution editing of the embodiment of the present invention goes out, and meet music Titbit and the diversified demand of video visual, to realize the purpose of quality that is easy to operate and effectively improving editing video, significantly Promote the usage experience of user.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or executable program Product.Therefore, the shape of hardware embodiment, software implementation or embodiment combining software and hardware aspects can be used in the present invention Formula.Moreover, the present invention, which can be used, can use storage in the computer that one or more wherein includes computer usable program code The form for the executable program product implemented on medium (including but not limited to magnetic disk storage and optical memory etc.).
The present invention be referring to according to the method for the embodiment of the present invention, the flow chart of equipment (system) and executable program product And/or block diagram describes.It should be understood that can be by each process in executable program instructions implementation flow chart and/or block diagram And/or the combination of the process and/or box in box and flowchart and/or the block diagram.It can provide these executable programs to refer to Enable the processor of general purpose computer, special purpose computer, Embedded Processor or reference programmable data processing device to generate One machine so that by computer or with reference to programmable data processing device processor execute instruction generate for realizing The device for the function of being specified in one or more flows of the flowchart and/or one or more blocks of the block diagram.
These executable program instructions, which may also be stored in, is able to guide computer or with reference to programmable data processing device 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 executable program instructions can also be loaded into computer or reference programmable data processing device, so that counting Calculation machine or with reference to executing series of operation steps on programmable device to generate computer implemented processing, thus in computer or It provides with reference to the instruction executed on programmable device 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.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention, it is all Made any modifications, equivalent replacements, and improvements etc. within the spirit and principles in the present invention, should be included in protection of the invention Within the scope of.

Claims (13)

1. a kind of multisource video clipping method, which is characterized in that the described method includes:
Target music is obtained, the target music is divided at least two snatch of music;
According to the first quantity of the snatch of music, the video clip of the second quantity is chosen from least one source video file, Wherein, first quantity matches with second quantity;
Judge whether the duration of current music segment meets the constraint condition of setting;
Based on above-mentioned judging result, the current music segment is assigned in corresponding video clip, until described at least two A snatch of music is assigned to completely in corresponding video clip;
Determine unappropriated maximum time video frame section in the video clip, the first ratio based on setting, to it is described most Big duration video frame section carries out interval division;
Based on above-mentioned interval division as a result, each video clip is associated with the snatch of music distributed, generating has music The target video file of rhythm.
2. multisource video clipping method according to claim 1, which is characterized in that the constraint condition includes the first constraint Condition;
It is described to be based on above-mentioned judging result, the current music segment is assigned in corresponding video clip, comprising:
At least two snatch of music is traversed according to snatch of music duration descending, is traversed according to the unassigned duration descending of video The video clip of second quantity;
It determines at least two snatch of music there are at least one unassigned first music segment, and first sound When the duration of happy segment meets first constraint condition, by least one first music segment be assigned to it is corresponding at least one In first video clip, until detecting that the duration of the first music segment is unsatisfactory for first constraint condition;
Wherein, the duration of the first music segment meets first constraint condition, comprising:
The duration of the first music segment is less than the unassigned duration of video of first video clip, and first sound The duration of happy segment is less than the snatch of music duration that the video of first video clip should be assigned.
3. multisource video clipping method according to claim 2, which is characterized in that the constraint condition further includes second about Beam condition;
It is described to be based on above-mentioned judging result, the current music segment is assigned in corresponding video clip, comprising:
When detecting that the duration of the first music segment is unsatisfactory for first constraint condition, at least two sound is detected It whether there is second snatch of music of at least one unassigned in happy segment;
It detects at least two snatch of music there are when second snatch of music of at least one unassigned, according to music Clip durations descending traverses at least one second snatch of music, traverses second quantity according to the unassigned duration descending of video Video clip in other video clips in addition at least one first video clip;
When determining that the duration of second snatch of music meets second constraint condition, by least one the second snatch of music point It is fitted at least one corresponding second video clip, until detecting that the duration of second snatch of music is unsatisfactory for described the Two constraint conditions;
Wherein, the duration of second snatch of music meets second constraint condition, comprising:
The duration of second snatch of music is less than the unassigned duration of video of second video clip.
4. multisource video clipping method according to claim 3, which is characterized in that it is described to be based on above-mentioned judging result, it will The current music segment is assigned in corresponding video clip, comprising:
When detecting that the duration of second snatch of music is unsatisfactory for second constraint condition, at least two sound is detected It whether there is at least one unassigned third snatch of music in happy segment;
It detects at least two snatch of music there are when at least one unassigned third snatch of music, according to music Clip durations descending traverses at least one third snatch of music, traverses second quantity according to the unassigned duration descending of video Video clip in other video clips in addition at least one first video clip and the second video clip;
The longest snatch of music of duration at least one third snatch of music is assigned to the longest third piece of video of corresponding duration Duan Zhong, until at least two snatch of music is fully allocated.
5. multisource video clipping method according to claim 1, which is characterized in that first ratio based on setting, Interval division is carried out to maximum time video frame section, comprising:
It is the first subinterval and the second subinterval by the maximum time video frame interval division based on first ratio;
It is described based on above-mentioned interval division as a result, each video clip is associated with the snatch of music distributed, comprising:
Determine the longest snatch of music of duration in allocated at least two snatch of music;
Detecting corresponding first length of the longest snatch of music of the duration, whether to be less than or equal to first subinterval corresponding The longest snatch of music of the duration is placed in described by the second length if first length is less than or equal to second length The initial position in the first subinterval is associated;
Detect whether first length is less than or equal to the corresponding third length in second subinterval, if first length is small In being equal to the third length, the initial position that the longest snatch of music of the duration is placed in second subinterval is closed Connection;
Detect whether first length is all larger than second length and third length, if first length be all larger than it is described Second length and third length close the initial position that the longest snatch of music of the duration is placed in first subinterval Connection.
6. multisource video clipping method according to claim 1, which is characterized in that described by the current music segment It is assigned in corresponding video clip, until at least two snatch of music is assigned to it in corresponding video clip completely Afterwards, the method also includes:
Determine whether the video frame in the selected video clip has the positional relationship of overlapping;
When determining that the video frame in the video clip has the positional relationship of overlapping, the adjustment position with overlapping is closed The video frame of system, so that lap is staggered.
7. multisource video clipping method according to claim 1, which is characterized in that in the judgement current music segment Before whether duration meets the constraint condition of setting, the method also includes:
Detect whether each video frame in the video clip includes facial image, determine include facial image video frame, it is right The video frame including facial image is marked, to distinguish the video frame for not including facial image;
Corresponding 4th snatch of music is distributed for the video frame including facial image, if detecting at least two music Segment is not fully allocated, judges whether the duration of current music segment meets the constraint condition of setting;
Wherein, the current music segment is other in addition to the 4th snatch of music at least two snatch of music Snatch of music.
8. multisource video clipping method according to claim 7, which is characterized in that described includes facial image for described in Video frame distributes corresponding 4th snatch of music, comprising:
First duration in the detection video frame section including facial image;
All video frames including facial image are traversed, the snatch of music to match with first duration is searched;
If finding the 4th snatch of music with the first duration successful match, using the 4th snatch of music found as For the snatch of music of the video frame distribution including facial image.
9. multisource video clipping method according to claim 8, which is characterized in that the method also includes:
If not finding the 4th snatch of music with the first duration successful match, the adjustment video including facial image First duration in frame section;
First duration in the video frame section described in the adjustment including facial image, comprising:
When detecting that the second duration of the 4th snatch of music is greater than first duration, extending described includes facial image The initial time in video frame section and/or termination time, so that first duration matches with second duration;
When detecting that second duration is less than first duration, shorten rising for the video frame section including facial image Begin time and/or termination time, so that first duration matches with second duration.
10. multisource video clipping method according to any one of claims 1 to 9, which is characterized in that first ratio is Any value between 15% to 35%.
11. a kind of multisource video editing device, which is characterized in that described device includes: to obtain module, division module, choose mould Block, judgment module, distribution module and relating module;Wherein,
The acquisition module, for obtaining target music;
The division module, for the target music to be divided at least two snatch of music;
The selection module chooses for the first quantity according to the snatch of music from least one source video file The video clip of two quantity, wherein first quantity matches with second quantity;
The judgment module, for judging whether the duration of current music segment meets the constraint condition of setting;
The current music segment is assigned to corresponding video clip for being based on above-mentioned judging result by the distribution module In, until at least two snatch of music is assigned to completely in corresponding video clip;
The division module is also used to determine unappropriated maximum time video frame section in the video clip, based on setting The first ratio, to maximum time video frame section carry out interval division;
The relating module, for based on above-mentioned interval division as a result, each video clip and the snatch of music that is distributed are carried out Association generates the target video file with music rhythm.
12. a kind of multisource video editing device, including memory, processor and storage are on a memory and can be by the processing The executable program of device operation, which is characterized in that the processor executed when running the executable program as claim 1 to The step of 10 described in any item multisource video clipping methods.
13. a kind of storage medium, is stored thereon with executable program, which is characterized in that the executable code processor is held The step of multisource video clipping method as described in any one of claim 1 to 10 is realized when row.
CN201810983670.8A 2018-08-27 2018-08-27 Multi-source video editing method and device and storage medium Active CN109257545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810983670.8A CN109257545B (en) 2018-08-27 2018-08-27 Multi-source video editing method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810983670.8A CN109257545B (en) 2018-08-27 2018-08-27 Multi-source video editing method and device and storage medium

Publications (2)

Publication Number Publication Date
CN109257545A true CN109257545A (en) 2019-01-22
CN109257545B CN109257545B (en) 2021-04-13

Family

ID=65049416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810983670.8A Active CN109257545B (en) 2018-08-27 2018-08-27 Multi-source video editing method and device and storage medium

Country Status (1)

Country Link
CN (1) CN109257545B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519638A (en) * 2019-09-06 2019-11-29 Oppo广东移动通信有限公司 Processing method, processing unit, electronic device and storage medium
CN110913271A (en) * 2019-11-29 2020-03-24 Oppo广东移动通信有限公司 Video processing method, mobile terminal and non-volatile computer-readable storage medium
CN110992993A (en) * 2019-12-17 2020-04-10 Oppo广东移动通信有限公司 Video editing method, video editing device, terminal and readable storage medium
CN111225274A (en) * 2019-11-29 2020-06-02 成都品果科技有限公司 Photo music video arrangement system based on deep learning
CN112235631A (en) * 2019-07-15 2021-01-15 北京字节跳动网络技术有限公司 Video processing method and device, electronic equipment and storage medium
CN112822563A (en) * 2019-11-15 2021-05-18 北京字节跳动网络技术有限公司 Method, device, electronic equipment and computer readable medium for generating video
CN114339392A (en) * 2021-11-12 2022-04-12 腾讯科技(深圳)有限公司 Video editing method and device, computer equipment and storage medium
JP2023501813A (en) * 2019-11-18 2023-01-19 北京字節跳動網絡技術有限公司 VIDEO GENERATION METHOD AND APPARATUS, ELECTRONIC DEVICE, AND COMPUTER READABLE MEDIUM

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003259302A (en) * 2002-02-28 2003-09-12 Fuji Xerox Co Ltd Method for automatically producing music video, product including information storage medium for storing information, and program
US20130156321A1 (en) * 2011-12-16 2013-06-20 Shigeru Motoi Video processing apparatus and method
CN106649703A (en) * 2016-12-20 2017-05-10 中国科学院深圳先进技术研究院 Method and device for visualizing audio data
CN107124624A (en) * 2017-04-21 2017-09-01 腾讯科技(深圳)有限公司 The method and apparatus of video data generation
CN107393569A (en) * 2017-08-16 2017-11-24 成都品果科技有限公司 Audio frequency and video clipping method and device
CN108028054A (en) * 2015-09-30 2018-05-11 苹果公司 The Voice & Video component of audio /video show to automatically generating synchronizes

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003259302A (en) * 2002-02-28 2003-09-12 Fuji Xerox Co Ltd Method for automatically producing music video, product including information storage medium for storing information, and program
US20130156321A1 (en) * 2011-12-16 2013-06-20 Shigeru Motoi Video processing apparatus and method
CN108028054A (en) * 2015-09-30 2018-05-11 苹果公司 The Voice & Video component of audio /video show to automatically generating synchronizes
CN106649703A (en) * 2016-12-20 2017-05-10 中国科学院深圳先进技术研究院 Method and device for visualizing audio data
CN107124624A (en) * 2017-04-21 2017-09-01 腾讯科技(深圳)有限公司 The method and apparatus of video data generation
CN107393569A (en) * 2017-08-16 2017-11-24 成都品果科技有限公司 Audio frequency and video clipping method and device

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2600309A (en) * 2019-07-15 2022-04-27 Beijing Bytedance Network Tech Co Ltd Video processing method and apparatus, and electronic device and storage medium
US11978485B2 (en) 2019-07-15 2024-05-07 Beijing Bytedance Network Technology Co., Ltd. Video processing method and apparatus, and electronic device and storage medium
GB2600309B (en) * 2019-07-15 2024-01-31 Beijing Bytedance Network Tech Co Ltd Video processing method and apparatus, and electronic device and storage medium
CN112235631A (en) * 2019-07-15 2021-01-15 北京字节跳动网络技术有限公司 Video processing method and device, electronic equipment and storage medium
WO2021008394A1 (en) * 2019-07-15 2021-01-21 北京字节跳动网络技术有限公司 Video processing method and apparatus, and electronic device and storage medium
JP7368589B2 (en) 2019-07-15 2023-10-24 北京字節跳動網絡技術有限公司 Video processing methods, devices, electronic devices and storage media
JP2022541186A (en) * 2019-07-15 2022-09-22 北京字節跳動網絡技術有限公司 Video processing method, device, electronic device and storage medium
CN110519638A (en) * 2019-09-06 2019-11-29 Oppo广东移动通信有限公司 Processing method, processing unit, electronic device and storage medium
US11818424B2 (en) 2019-11-15 2023-11-14 Beijing Bytedance Network Technology Co., Ltd. Method and apparatus for generating video, electronic device, and computer readable medium
CN112822563A (en) * 2019-11-15 2021-05-18 北京字节跳动网络技术有限公司 Method, device, electronic equipment and computer readable medium for generating video
WO2021093737A1 (en) * 2019-11-15 2021-05-20 北京字节跳动网络技术有限公司 Method and apparatus for generating video, electronic device, and computer readable medium
JP2023501813A (en) * 2019-11-18 2023-01-19 北京字節跳動網絡技術有限公司 VIDEO GENERATION METHOD AND APPARATUS, ELECTRONIC DEVICE, AND COMPUTER READABLE MEDIUM
JP7457804B2 (en) 2019-11-18 2024-03-28 北京字節跳動網絡技術有限公司 VIDEO GENERATION METHOD AND APPARATUS, ELECTRONIC DEVICE, AND COMPUTER READABLE MEDIUM - Patent application
CN110913271B (en) * 2019-11-29 2022-01-18 Oppo广东移动通信有限公司 Video processing method, mobile terminal and non-volatile computer-readable storage medium
CN111225274A (en) * 2019-11-29 2020-06-02 成都品果科技有限公司 Photo music video arrangement system based on deep learning
CN110913271A (en) * 2019-11-29 2020-03-24 Oppo广东移动通信有限公司 Video processing method, mobile terminal and non-volatile computer-readable storage medium
CN110992993B (en) * 2019-12-17 2022-12-09 Oppo广东移动通信有限公司 Video editing method, video editing device, terminal and readable storage medium
EP4068793A4 (en) * 2019-12-17 2023-01-04 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Video editing method, video editing apparatus, terminal, and readable storage medium
WO2021121023A1 (en) * 2019-12-17 2021-06-24 Oppo广东移动通信有限公司 Video editing method, video editing apparatus, terminal, and readable storage medium
CN110992993A (en) * 2019-12-17 2020-04-10 Oppo广东移动通信有限公司 Video editing method, video editing device, terminal and readable storage medium
CN114339392A (en) * 2021-11-12 2022-04-12 腾讯科技(深圳)有限公司 Video editing method and device, computer equipment and storage medium
CN114339392B (en) * 2021-11-12 2023-09-12 腾讯科技(深圳)有限公司 Video editing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109257545B (en) 2021-04-13

Similar Documents

Publication Publication Date Title
CN109257545A (en) A kind of multisource video clipping method, device and storage medium
CN109168084B (en) Video editing method and device
Davis et al. Visual rhythm and beat
CN107124624A (en) The method and apparatus of video data generation
Dixon et al. The Performance Worm: Real time visualisation of expression based on Langner's tempo-loudness animation
CN109348274A (en) A kind of living broadcast interactive method, apparatus and storage medium
CN109451245A (en) A kind of video capture method, apparatus, equipment and storage medium
CN110415723B (en) Method, device, server and computer readable storage medium for audio segmentation
US11804246B2 (en) Automatic video editing using beat matching detection
CN109615682A (en) Animation producing method, device, electronic equipment and computer readable storage medium
CN110324718A (en) Audio-video generation method, device, electronic equipment and readable medium
US11511200B2 (en) Game playing method and system based on a multimedia file
CN110461077A (en) A kind of lamp light control method, Light Control Unit and readable storage medium storing program for executing
WO2020151491A1 (en) Image deformation control method and device and hardware device
CN109891405A (en) The method, system and medium of the presentation of video content on a user device are modified based on the consumption mode of user apparatus
CN107170432A (en) A kind of music generating method and device
CN110377212A (en) Pass through method, apparatus, computer equipment and the storage medium of audio triggering display
WO2019241785A1 (en) Systems and methods for dancification
CN109859729A (en) Wave-shape amplitude control method and device are carried out to audio
US8655466B2 (en) Correlating changes in audio
CN109936762B (en) Method for synchronously playing similar audio or video files and electronic equipment
CN109410972B (en) Method, device and storage medium for generating sound effect parameters
CN108962286A (en) Audio identification methods, device and storage medium
WO2020089144A1 (en) Determining light effects based on video and audio information in dependence on video and audio weights
CN112040290A (en) Multimedia playing method, device, equipment 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
GR01 Patent grant
GR01 Patent grant