Movatterモバイル変換


[0]ホーム

URL:


CN109167934B - A video processing method, device and computer-readable storage medium - Google Patents

A video processing method, device and computer-readable storage medium
Download PDF

Info

Publication number
CN109167934B
CN109167934BCN201811021096.4ACN201811021096ACN109167934BCN 109167934 BCN109167934 BCN 109167934BCN 201811021096 ACN201811021096 ACN 201811021096ACN 109167934 BCN109167934 BCN 109167934B
Authority
CN
China
Prior art keywords
video data
group
duration
fused
video
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.)
Active
Application number
CN201811021096.4A
Other languages
Chinese (zh)
Other versions
CN109167934A (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.)
MIGU Video Technology Co Ltd
Original Assignee
MIGU Video 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 MIGU Video Technology Co LtdfiledCriticalMIGU Video Technology Co Ltd
Priority to CN201811021096.4ApriorityCriticalpatent/CN109167934B/en
Publication of CN109167934ApublicationCriticalpatent/CN109167934A/en
Application grantedgrantedCritical
Publication of CN109167934BpublicationCriticalpatent/CN109167934B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种视频处理方法,包括:对待处理视频数据进行划分,得到至少一组视频数据;对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;将所述第一时长与预设时长进行比较,得到比较结果;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据;对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。本发明还同时公开了一种视频处理装置以及计算机可读存储介质。

Figure 201811021096

The invention discloses a video processing method, which includes: dividing the video data to be processed to obtain at least one group of video data; The video data is used as the first video data, and a first duration corresponding to the first video data is determined; the first duration is compared with a preset duration to obtain a comparison result; when the comparison result represents the first duration When the duration is less than the preset duration, the video data to be fused is determined from the remaining groups of video data; the video data to be fused and the first video data are fused to obtain edited video data. The invention also discloses a video processing device and a computer-readable storage medium at the same time.

Figure 201811021096

Description

Translated fromChinese
一种视频处理方法、装置及计算机可读存储介质A video processing method, device and computer-readable storage medium

技术领域technical field

本发明涉及信息处理技术领域,尤其涉及一种基于视频处理方法、装置及计算机可读存储介质。The present invention relates to the technical field of information processing, and in particular, to a video-based processing method, device, and computer-readable storage medium.

背景技术Background technique

目前,视频的剪辑通常由用户使用视频剪辑软件完成,剪辑的方式包括固定时长和固定镜头数。At present, video editing is usually done by users using video editing software, and the editing methods include a fixed duration and a fixed number of shots.

目前,采用固定时长对视频剪辑时,可能会裁剪掉视频中的部分精彩视频内容,导致剪辑后的视频中的精彩视频内容不完整;采用固定镜头数对视频剪辑时,由于每个镜头对应的视频内容的时长无法确定,可能导致剪辑后的视频中其他视频内容的时长比精彩视频内容的时长要大,可能使用户消耗更多时间观看与精彩视频内容无关的视频内容。At present, when a fixed length of video is used for video editing, part of the wonderful video content in the video may be cropped, resulting in incomplete content of the wonderful video in the edited video; when a fixed number of shots is used for video editing, because the corresponding The length of the video content cannot be determined, which may cause the length of other video content in the edited video to be longer than that of the highlight video content, which may cause users to spend more time watching video content unrelated to the highlight video content.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例期望提供一种视频处理方法、装置及计算机可读存储介质,能够保证剪辑后的视频中保存完整的精彩视频内容。In view of this, the embodiments of the present invention are expected to provide a video processing method, apparatus, and computer-readable storage medium, which can ensure that complete wonderful video content is preserved in the edited video.

本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is realized as follows:

本发明实施例提供一种视频处理方法,所述方法包括:An embodiment of the present invention provides a video processing method, the method includes:

对待处理视频数据进行划分,得到至少一组视频数据;dividing the video data to be processed to obtain at least one set of video data;

对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;Identifying the content type of the at least one group of video data, using a group of video data whose content type meets a preset condition as the first video data, and determining the first duration corresponding to the first video data;

将所述第一时长与预设时长进行比较,得到比较结果;Comparing the first duration with the preset duration to obtain a comparison result;

当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据;When the comparison result indicates that the first duration is less than a preset duration, determining the video data to be fused from the remaining groups of video data;

对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。The video data to be fused and the first video data are fused to obtain edited video data.

上述方案中,所述方法还包括:In the above scheme, the method also includes:

统计不同内容类型的视频数据及对应时长;Statistics of video data of different content types and corresponding duration;

根据统计的不同内容类型的视频数据及对应时长,确定与所述第一视频数据的内容类型相同的至少一个视频数据;Determine at least one video data of the same content type as the first video data according to the statistical video data of different content types and corresponding durations;

基于所述至少一个视频数据对应的时长分布,确定所述预设时长。The preset duration is determined based on the duration distribution corresponding to the at least one piece of video data.

上述方案中,所述从剩余组的视频数据中确定待融合的视频数据,包括:In the above scheme, the video data to be fused to be determined from the video data of the remaining groups, including:

结合所述至少一组视频数据的时间轴,从除第一视频数据外的剩余组视频数据中,确定时间在第一视频数据之前的至少一组视频数据;In combination with the time axis of the at least one group of video data, from the remaining groups of video data except the first video data, determine at least one group of video data whose time is before the first video data;

针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据;For each group of video data whose time is before the first video data, determine whether to use the corresponding group of video data as the video data to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range;

当确定时,将相应组视频数据作为待融合的视频数据。When determined, the corresponding group of video data is used as the video data to be fused.

上述方案中,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:In the above scheme, for each group of video data whose time is before the first video data, it is judged whether to use the corresponding group of video data as the video data to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range, include:

针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否属于第一预设时长范围;For each group of video data whose time is before the first video data, determine whether the duration corresponding to the corresponding group of video data belongs to the first preset duration range;

当确定时,将相应组视频数据作为待融合的视频数据;并针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,判断是否将相应组视频数据作为待融合的视频数据。When determined, the corresponding group of video data is used as the video data to be fused; and for each group of video data whose time is after the first video data, based on the corresponding time length of the corresponding group of video data and the second preset time length range, determine whether to The corresponding group of video data is used as the video data to be fused.

上述方案中,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:In the above scheme, for each group of video data whose time is before the first video data, it is judged whether to use the corresponding group of video data as the video data to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range, include:

针对时间在第一视频数据之前的每组视频数据,判断第i组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;For each group of video data whose time is before the first video data, determine whether the duration corresponding to the i-th group of video data is less than or equal to the start time of the first preset duration range;

当确定时,将第i组视频数据作为待融合的视频数据;并判断第i+1组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;以此类推;When determining, the i group of video data is used as the video data to be fused; and it is judged whether the corresponding duration of the i+1 group video data is less than or equal to the start time of the first preset duration range; and so on;

其中,i=1,2,3,…N,N为正整数。Among them, i=1, 2, 3,...N, and N is a positive integer.

上述方案中,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:In the above scheme, for each group of video data whose time is before the first video data, it is judged whether to use the corresponding group of video data as the video data to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range, include:

针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否大于或等于第一预设时长范围的结束时间;For each group of video data whose time is before the first video data, determine whether the duration corresponding to the corresponding group of video data is greater than or equal to the end time of the first preset duration range;

当确定时,将相应组视频数据作为待融合的视频数据;并统计待融合的视频数据对应的时长总和;When determined, the corresponding group of video data is used as the video data to be fused; and the sum of the durations corresponding to the video data to be fused is counted;

计算所述第一时长与所述时长总和之和,得到第二时长;calculating the sum of the first duration and the sum of the durations to obtain a second duration;

判断所述第二时长是否小于所述预设时长;determining whether the second duration is less than the preset duration;

当确定时,针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,确定待融合的视频数据。When determined, for each group of video data whose time is after the first video data, the video data to be fused is determined based on the duration corresponding to the corresponding group of video data and the second preset duration range.

上述方案中,所述方法还包括:In the above scheme, the method also includes:

确定融合处理后的视频数据对应的时长总和;Determine the sum of the durations corresponding to the video data after fusion processing;

对融合处理后的视频数据进行剪辑,得到时长等于所述预设时长的视频数据;Editing the fused video data to obtain video data with a duration equal to the preset duration;

将时长等于所述预设时长的视频数据作为剪辑后的视频数据。The video data whose duration is equal to the preset duration is used as the edited video data.

本发明实施例提供一种视频处理装置,所述装置包括:An embodiment of the present invention provides a video processing apparatus, and the apparatus includes:

划分模块,用于对待处理视频数据进行划分,得到至少一组视频数据;A division module, for dividing the video data to be processed to obtain at least one group of video data;

识别模块,用于对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;An identification module, configured to identify the content type of the at least one group of video data, take a group of video data whose content type meets a preset condition as the first video data, and determine the first duration corresponding to the first video data ;

比较模块,用于将所述第一时长与预设时长进行比较,得到比较结果;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据;a comparison module, configured to compare the first duration with a preset duration to obtain a comparison result; when the comparison result indicates that the first duration is less than the preset duration, determine the video to be fused from the remaining sets of video data data;

剪辑模块,用于对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。The editing module is configured to perform fusion processing on the video data to be fused and the first video data to obtain edited video data.

本发明实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上面所述任一项视频处理方法的步骤。An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the above video processing methods.

本发明实施例提供一种视频处理装置,包括:存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序;An embodiment of the present invention provides a video processing apparatus, including: a memory, a processor, and a computer program stored in the memory and running on the processor;

其中,所述处理器用于运行所述计算机程序时,执行上面所述任一项视频处理方法的步骤。Wherein, the processor is configured to execute the steps of any one of the above video processing methods when running the computer program.

本发明实施例提供的视频处理方法、装置及计算机可读存储介质,对待处理视频数据进行划分,得到至少一组视频数据;对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;将所述第一时长与预设时长进行比较,得到比较结果;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据;对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。本发明实施例中,将所述第一视频数据对应的第一时长与预设时长进行比较,当比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据,如此,可以保证内容满足预设条件的第一视频数据的完整。对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据;所述剪辑后的视频数据中包含所述第一视频数据。显然,在剪辑后的视频数据中能够保存完整的第一视频数据。In the video processing method, device, and computer-readable storage medium provided by the embodiments of the present invention, the video data to be processed is divided to obtain at least one group of video data; the content type of the at least one group of video data is identified, and the content type satisfies A set of video data of a preset condition is used as the first video data, and a first duration corresponding to the first video data is determined; the first duration is compared with the preset duration to obtain a comparison result; when the comparison result Indicates that when the first duration is less than the preset duration, video data to be fused is determined from the remaining sets of video data; and the video data to be fused and the first video data are fused to obtain edited video data. In this embodiment of the present invention, the first duration corresponding to the first video data is compared with a preset duration, and when the comparison result indicates that the first duration is less than the preset duration, the video data to be fused is determined from the remaining sets of video data. Video data, in this way, the integrity of the first video data whose content satisfies the preset condition can be guaranteed. The video data to be fused and the first video data are fused to obtain clipped video data; the clipped video data includes the first video data. Obviously, the complete first video data can be saved in the edited video data.

附图说明Description of drawings

图1为本发明实施例视频处理方法的实现流程示意图;1 is a schematic diagram of an implementation flow of a video processing method according to an embodiment of the present invention;

图2为本发明实施例视频处理方法的具体实现流程示意图;2 is a schematic flowchart of a specific implementation of a video processing method according to an embodiment of the present invention;

图3为本发明实施例视频数据对应的镜头画面的示意图;3 is a schematic diagram of a shot screen corresponding to video data according to an embodiment of the present invention;

图4为本发明实施例视频处理装置的组成结构示意图一;4 is a schematic diagram 1 of a composition structure of a video processing apparatus according to an embodiment of the present invention;

图5为本发明实施例视频处理装置的组成结构示意图二。FIG. 5 is a second schematic diagram of the composition and structure of a video processing apparatus according to an embodiment of the present invention.

具体实施方式Detailed ways

本发明实施例中,对待处理视频数据进行划分,得到至少一组视频数据;对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;将所述第一时长与预设时长进行比较,得到比较结果;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据;对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。In this embodiment of the present invention, the video data to be processed is divided to obtain at least one group of video data; the content type of the at least one group of video data is identified, and a group of video data whose content type meets a preset condition is used as the first video data, and determine the first duration corresponding to the first video data; compare the first duration with a preset duration to obtain a comparison result; when the comparison result indicates that the first duration is less than the preset duration, Determine the video data to be fused from the remaining groups of video data; perform fusion processing on the video data to be fused and the first video data to obtain edited video data.

为了能够更加详尽地了解本发明实施例的特点与技术内容,下面结合附图对本发明实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本发明。In order to be able to understand the features and technical contents of the embodiments of the present invention in more detail, the implementation of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference only and are not used to limit the present invention.

如图1所示,详细说明本发明实施例视频处理方法,所述视频处理方法应用于终端侧,包括以下步骤:As shown in FIG. 1 , a video processing method according to an embodiment of the present invention is described in detail. The video processing method is applied to the terminal side and includes the following steps:

步骤101:对待处理视频数据进行划分,得到至少一组视频数据。Step 101: Divide the video data to be processed to obtain at least one set of video data.

实际应用于视频剪辑处理时,为了保证剪辑后的视频中仍保存完整的图像,考虑到待剪辑的视频可以由连续的多个图像构成,因此可以对待剪辑的视频进行划分,将一个完整图像对应的视频数据作为一组视频数据。其中,一个完整图像可以对应一个镜头画面。When actually applied to video editing processing, in order to ensure that the complete image is still preserved in the edited video, considering that the video to be edited can be composed of multiple consecutive images, the video to be edited can be divided, and a complete image corresponds to video data as a set of video data. Among them, a complete image can correspond to a lens picture.

考虑到待剪辑的视频对应的图像间存在差异,因而可以对所述待处理视频数据中的每帧视频数据进行特征提取,得到特征数据,比如直方图特征数据;基于相邻两帧视频数据对应的特征数据,计算相应帧视频数据对应的均方差,对计算的均方差进行归一化处理,基于归一化处理后的均方差,计算相邻两帧视频数据对应的特征变化率;特征变化率是相邻两帧视频数据对应的均方差的差值与所有帧视频数据对应的均方差总和的比值;将所述特征变化率与预设阈值比较,得到比较结果;当比较结果表征所述特征变化率小于所述预设阈值时,确定相邻两帧视频数据属于同一个镜头画面;以此类推,将所述待处理视频数据对应的图像划分为至少一个镜头画面。Considering that there are differences between the images corresponding to the video to be edited, feature extraction can be performed on each frame of video data in the video data to be processed to obtain feature data, such as histogram feature data; feature data, calculate the mean square error corresponding to the corresponding frame of video data, normalize the calculated mean square error, and calculate the feature change rate corresponding to two adjacent frames of video data based on the normalized mean square error; The rate is the ratio of the difference between the mean squares corresponding to the adjacent two frames of video data and the sum of the mean squares corresponding to all frames of video data; the characteristic change rate is compared with a preset threshold to obtain a comparison result; when the comparison result characterizes the When the feature change rate is less than the preset threshold, it is determined that two adjacent frames of video data belong to the same shot; and so on, the image corresponding to the video data to be processed is divided into at least one shot.

步骤102:对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长。Step 102: Identify the content type of the at least one group of video data, use a group of video data whose content type meets a preset condition as the first video data, and determine the first duration corresponding to the first video data.

其中,所述内容类型满足预设条件,可以是识别出的内容类型为精彩视频内容,也可以是识别出的内容类型为动漫视频内容等等。Wherein, the content type meets a preset condition, which may be that the identified content type is wonderful video content, or the identified content type is animation video content, and so on.

对所述至少一组视频数据的内容类型进行识别的过程,包括以下几种情况:The process of identifying the content type of the at least one group of video data includes the following situations:

第一种、假设所述预设条件为识别出的内容类型为精彩视频内容,可以基于人工智能算法(AI,Artificial Intelligence),确定动作场景检测模型;针对每组视频数据,利用确定的动作场景检测模型,对相应组视频数据中的人物动作进行识别,判断识别出的人物动作是否为预设动作,比如进球动作、角球动作等等;当确定识别出的人物动作为预设动作时,确定相应组视频数据的内容类型为精彩视频内容。First, assuming that the preset condition is that the identified content type is wonderful video content, the action scene detection model can be determined based on an artificial intelligence algorithm (AI, Artificial Intelligence); for each group of video data, the determined action scene can be used. The detection model recognizes the actions of the characters in the corresponding group of video data, and determines whether the actions of the characters identified are preset actions, such as goal actions, corner kick actions, etc.; when it is determined that the actions of the characters identified are preset actions, It is determined that the content type of the corresponding set of video data is highlight video content.

第二种、假设所述预设条件为识别出的内容类型为动漫视频内容,针对每组视频数据,对相应组视频数据进行图像识别,以识别目标图像;判断识别出的目标图像是否为预设动漫图像,比如柯南头像、火影忍者头像等等;当确定识别出的目标图像为预设动漫图像时,确定相应组视频数据的内容类型为动漫视频内容。The second type, assuming that the preset condition is that the identified content type is animation video content, for each group of video data, image recognition is performed on the corresponding group of video data to identify the target image; determine whether the identified target image is a predetermined target image. Set an anime image, such as a Conan avatar, a Naruto avatar, etc.; when it is determined that the identified target image is a preset anime image, the content type of the corresponding set of video data is determined to be anime video content.

为了提高用户的剪辑兴趣,可以由用户选择的满足预设条件的内容类型,并根据用户选择的内容类型对各组视频数据的内容类型进行识别。具体地,所述终端可以生成提示消息,并显示所述提示消息;所述提示消息用于指示用户选择一个内容类型;接收用户的操作;所述操作为针对所述提示消息的选择操作;响应所述操作,基于用户选择的内容类型,确定相应的识别方法;利用确定的识别方法对各组视频数据的内容类型进行识别。当用户未选择任何内容类型时,所述终端可以基于默认的预设条件对各组视频数据的内容类型进行识别;其中,默认的预设条件可以为识别出的内容类型为精彩视频内容。In order to improve the user's interest in editing, the content type that meets the preset condition may be selected by the user, and the content type of each group of video data may be identified according to the content type selected by the user. Specifically, the terminal may generate a prompt message and display the prompt message; the prompt message is used to instruct the user to select a content type; receive an operation from the user; the operation is a selection operation for the prompt message; In the operation, a corresponding identification method is determined based on the content type selected by the user; the content type of each group of video data is identified by using the determined identification method. When the user does not select any content type, the terminal may identify the content type of each group of video data based on a default preset condition; wherein, the default preset condition may be that the identified content type is wonderful video content.

这里,可以结合所述至少一组视频数据的时间轴,确定所述第一视频数据对应的第一时长的起始时间、结束时间。Here, the start time and the end time of the first duration corresponding to the first video data may be determined in combination with the time axis of the at least one group of video data.

步骤103:将所述第一时长与预设时长进行比较,得到比较结果;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据。Step 103: Compare the first duration with a preset duration to obtain a comparison result; when the comparison result indicates that the first duration is less than the preset duration, determine the video data to be fused from the remaining sets of video data.

所述预设时长可以是用户设置的,也可以是利用机器学习算法,比如大数据算法,结合统计的不同内容类型的视频数据及对应时长进行确定。The preset duration may be set by a user, or may be determined by using a machine learning algorithm, such as a big data algorithm, in combination with statistical video data of different content types and the corresponding duration.

其中,确定所述预设时长的过程,包括:利用机器学习算法,统计不同内容类型的视频数据及对应时长;根据统计的不同内容类型的视频数据及对应时长,确定与所述第一视频数据的内容类型相同的至少一个视频数据;基于所述至少一个视频数据对应的时长分布,确定所述预设时长。所述时长分布可以是正态分布等等。Wherein, the process of determining the preset duration includes: using a machine learning algorithm to count video data of different content types and corresponding durations; at least one piece of video data of the same content type; the preset duration is determined based on the duration distribution corresponding to the at least one piece of video data. The duration distribution may be a normal distribution or the like.

当所述时长分布为正态分布时,基于预设比例,确定对应所述预设比例的正态分布面积;将所述正态分布面积对应的最大时长作为所述预设时长。其中,所述预设比例可以为70%或50%等等。When the duration distribution is a normal distribution, a normal distribution area corresponding to the preset ratio is determined based on a preset ratio; the maximum duration corresponding to the normal distribution area is used as the preset duration. Wherein, the preset ratio may be 70% or 50% and so on.

在一实施例中,所述从剩余组的视频数据中确定待融合的视频数据,包括:结合所述至少一组视频数据的时间轴,从除第一视频数据外的剩余组视频数据中,确定时间在第一视频数据之前的至少一组视频数据;针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据;当确定时,将相应组视频数据作为待融合的视频数据。In an embodiment, the determining the video data to be fused from the video data of the remaining group includes: combining the time axis of the at least one group of video data, from the video data of the remaining group except the first video data, At least one group of video data whose time is before the first video data is determined; for each group of video data whose time is before the first video data, based on the corresponding duration of the corresponding set of video data and the first preset duration range, it is judged whether to The video data is used as the video data to be fused; when determined, the corresponding group of video data is used as the video data to be fused.

考虑到时间在所述第一视频数据之前的至少一组视频数据对应的视频内容,相比时间在所述第一视频数据之后的至少一组视频数据对应的视频内容,更能引起用户的关注,因此,当所述第一时长大于或等于所述预设时长时,从时间在第一视频数据之前的至少一组视频数据中确定待融合的视频数据。Considering the video content corresponding to at least one group of video data whose time is before the first video data, compared with the video content corresponding to at least one group of video data whose time is after the first video data, the user's attention can be more attracted , therefore, when the first duration is greater than or equal to the preset duration, the video data to be fused is determined from at least one group of video data whose time is before the first video data.

第i组视频数据为时间在第一视频数据之前的一组视频数据,确定待融合的视频数据的过程,包括以下三种情况:The i th group of video data is a group of video data whose time is before the first video data, and the process of determining the video data to be fused includes the following three situations:

第一种、如果第i组视频数据对应的时长属于第一预设时长范围,则将第i组视频数据作为待融合的视频数据,并继续从时间在第一视频数据之后的至少一组视频数据中,确定待融合的视频数据;First, if the duration corresponding to the i-th group of video data belongs to the first preset duration range, then the i-th group of video data is used as the video data to be fused, and continues from at least one group of videos whose time is after the first video data In the data, determine the video data to be fused;

第二种、如果第i组视频数据对应的时长小于或等于第一预设时长范围的起始时间,则将第i组视频数据作为待融合的视频数据,并继续判断第i+1组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;The second kind, if the corresponding duration of the i group of video data is less than or equal to the start time of the first preset duration range, then the i group of video data is used as the video data to be fused, and continues to judge the i+1 group video Whether the duration corresponding to the data is less than or equal to the start time of the first preset duration range;

第三种、如果第i组视频数据对应的时长大于或等于第一预设时长范围的结束时间,则将第i组视频数据作为待融合的视频数据,并计算待融合的视频数据与所述第一视频数据对应的时长总和,判断所述时长总和是否小于所述预设时长,当确定时,继续从时间在第一视频数据之后的至少一组视频数据中,确定待融合的视频数据。Third, if the duration corresponding to the i-th group of video data is greater than or equal to the end time of the first preset duration range, then the i-th group of video data is taken as the video data to be fused, and the difference between the video data to be fused and the described video data to be fused is calculated. The sum of the durations corresponding to the first video data is determined, and whether the sum of durations is less than the preset duration is determined, and when determined, the video data to be fused continues to be determined from at least one group of video data whose time is after the first video data.

其中,i=1,2,3,…N,N为正整数。相应地,第1组视频数据与所述第一视频数据在时间轴上距离最近,第N组视频数据与所述第一视频数据在时间轴上距离最远。Among them, i=1, 2, 3,...N, and N is a positive integer. Correspondingly, the distance between the first group of video data and the first video data on the time axis is the closest, and the distance between the Nth group of video data and the first video data is the farthest on the time axis.

在一实施例中,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否属于第一预设时长范围;当确定时,将相应组视频数据作为待融合的视频数据;并针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,判断是否将相应组视频数据作为待融合的视频数据。In one embodiment, for each group of video data whose time is before the first video data, it is determined whether to use the corresponding group of video data as the video to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range. data, including: for each group of video data whose time is before the first video data, judging whether the duration corresponding to the corresponding group of video data belongs to the first preset duration range; when determined, the corresponding group of video data is used as the video data to be fused ; And for each group of video data whose time is after the first video data, based on the corresponding time length of the corresponding group of video data and the second preset time range, determine whether to use the corresponding group of video data as the video data to be fused.

所述第一预设时长范围可以是用户设置的,也可以是基于机器学习算法,比如大数据算法,结合统计的不同内容类型的视频数据进行确定。The first preset duration range may be set by the user, or may be determined based on a machine learning algorithm, such as a big data algorithm, in combination with statistical video data of different content types.

以大数据算法为例,基于机器学习算法,确定第一预设时长范围的过程包括:基于大数据算法,对视频数据进行分类统计;针对不同类别的每个视频数据,将相应视频数据进行划分,得到至少一组视频数据,对所述至少一组视频数据的内容类型进行识别,将识别的内容类型为精彩视频内容的一组短视频数据作为第一视频数据;得到对应不同类别的短视频数据的至少一个第一视频数据;结合视频数据的时间轴,确定时间在第一视频数据之前的各组视频数据对应的时长分布;基于确定的时长分布,确定所述第一预设时长范围。Taking the big data algorithm as an example, the process of determining the first preset duration range based on the machine learning algorithm includes: classifying and counting the video data based on the big data algorithm; for each video data of different categories, dividing the corresponding video data , obtain at least one group of video data, identify the content type of the at least one group of video data, and use a group of short video data whose identified content type is wonderful video content as the first video data; obtain short videos corresponding to different categories at least one first video data of the data; combined with the time axis of the video data, determine the time length distribution corresponding to each group of video data whose time is before the first video data; and determine the first preset time length range based on the determined time length distribution.

所述第二预设时长范围可以是用户设置的,也可以是基于机器学习算法,比如大数据算法,结合统计的不同内容类型的视频数据进行确定。The second preset duration range may be set by the user, or may be determined based on a machine learning algorithm, such as a big data algorithm, in combination with statistical video data of different content types.

以大数据算法为例,基于机器学习算法,确定第二预设时长范围的过程包括:基于大数据算法,对视频数据进行分类统计;针对不同类别的每个视频数据,将相应视频数据进行划分,得到至少一组视频数据,对所述至少一组视频数据的内容类型进行识别,将识别的内容类型为精彩视频内容的一组短视频数据作为第一视频数据;得到对应不同类别的短视频数据的至少一个第一视频数据;结合视频数据的时间轴,确定时间在第一视频数据之后的各组视频数据对应的时长分布;基于确定的时长分布,确定所述第二预设时长范围。Taking the big data algorithm as an example, the process of determining the second preset duration range based on the machine learning algorithm includes: classifying and counting the video data based on the big data algorithm; for each video data of different categories, dividing the corresponding video data , obtain at least one group of video data, identify the content type of the at least one group of video data, and use a group of short video data whose identified content type is wonderful video content as the first video data; obtain short videos corresponding to different categories at least one first video data of the data; combined with the time axis of the video data, determine the time length distribution corresponding to each group of video data whose time is after the first video data; and determine the second preset time length range based on the determined time length distribution.

为了保证第一视频数据的时长较待融合的视频数据的时长更大,通过第一预设时长范围与时间在第一视频数据之前的每组视频数据对应的时长之间的关系,以及第二预设时长范围与时间在第一视频数据之后的每组视频数据对应的时长之间的关系,确定出能够与所述第一视频数据进行融合的待融合视频数据,从而限定与所述第一视频数据进行融合的视频数据的时长。In order to ensure that the duration of the first video data is longer than the duration of the video data to be fused, the relationship between the first preset duration range and the duration corresponding to each group of video data before the first video data, and the second The relationship between the preset duration range and the duration corresponding to each group of video data whose time is after the first video data is determined, and the video data to be fused that can be fused with the first video data is determined, thereby limiting the relationship with the first video data. The duration of the video data to be fused with the video data.

在一实施例中,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:针对时间在第一视频数据之前的每组视频数据,判断第i组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;当确定时,将第i组视频数据作为待融合的视频数据;并判断第i+1组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;以此类推;其中,i=1,2,3,…N,N为正整数。In one embodiment, for each group of video data whose time is before the first video data, it is determined whether to use the corresponding group of video data as the video to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range. Data, including: for each group of video data whose time is before the first video data, determine whether the corresponding duration of the i-th group of video data is less than or equal to the start time of the first preset duration range; The video data is used as the video data to be fused; and it is judged whether the corresponding duration of the i+1 group of video data is less than or equal to the start time of the first preset duration range; and so on; wherein, i=1,2,3, ...N, where N is a positive integer.

在一实施例中,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否大于或等于第一预设时长范围的结束时间;当确定时,将相应组视频数据作为待融合的视频数据;并统计待融合的视频数据对应的时长总和;计算所述第一时长与所述时长总和之和,得到第二时长;判断所述第二时长是否小于所述预设时长;当确定时,针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,确定待融合的视频数据。In one embodiment, for each group of video data whose time is before the first video data, it is determined whether to use the corresponding group of video data as the video to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range. The data includes: for each group of video data whose time is before the first video data, judging whether the duration corresponding to the corresponding group of video data is greater than or equal to the end time of the first preset duration range; when determined, the corresponding group of video data is used as The video data to be fused; and the sum of the durations corresponding to the video data to be fused; calculate the sum of the first duration and the sum of the durations to obtain a second duration; determine whether the second duration is less than the preset duration When determined, for each group of video data whose time is after the first video data, the video data to be fused is determined based on the corresponding duration of the corresponding set of video data and the second preset duration range.

第m组视频数据为时间在第一视频数据之后的一组视频数据,确定待融合的视频数据,包括以下三种情况:The mth group of video data is a group of video data whose time is after the first video data, and the video data to be fused is determined, including the following three situations:

第一种、如果第m组视频数据对应的时长属于第二预设时长范围,则将第m组视频数据作为待融合的视频数据;First, if the duration corresponding to the mth group of video data belongs to the second preset duration range, then the mth group of video data is used as the video data to be fused;

第二种、如果第m组视频数据对应的时长小于或等于第二预设时长范围的起始时间,则将第m组视频数据作为待融合的视频数据,并继续判断第m+1组视频数据对应的时长是否小于或等于第二预设时长范围的起始时间;The second kind, if the corresponding duration of the mth group of video data is less than or equal to the starting time of the second preset duration range, then the mth group of video data is used as the video data to be fused, and continue to judge the m+1th group of video data. Whether the duration corresponding to the data is less than or equal to the start time of the second preset duration range;

第三种、如果第m组视频数据对应的时长大于或等于第二预设时长范围的结束时间,则将第m组视频数据作为待融合的视频数据,并计算待融合的视频数据与所述第一视频数据对应的时长总和,判断所述时长总和是否小于所述预设时长,当确定时,将确定待融合的视频数据与所述第一视频数据进行融合处理,将融合处理后的视频数据作为剪辑后的视频数据。Third, if the duration corresponding to the mth group of video data is greater than or equal to the end time of the second preset duration range, then the mth group of video data is used as the video data to be fused, and the difference between the video data to be fused and the described video data is calculated. The sum of the durations corresponding to the first video data, and it is judged whether the sum of the durations is less than the preset duration. When determined, the determined video data to be fused and the first video data are fused, and the fused video data as clipped video data.

其中,m=1,2,3,…M,M为正整数。相应地,第1组视频数据与所述第一视频数据在时间轴上距离最近,第M组视频数据与所述第一视频数据在时间轴上距离最远。Among them, m=1, 2, 3, ... M, and M is a positive integer. Correspondingly, the distance between the first group of video data and the first video data on the time axis is the closest, and the distance between the Mth group of video data and the first video data is the farthest on the time axis.

这里,从时间在第一视频数据之后的一组视频数据中,确定待融合的视频数据的过程,与从时间在第一视频数据之前的一组视频数据中,确定待融合的视频数据的过程相同,在此不再赘述。Here, the process of determining the video data to be fused from a group of video data whose time is after the first video data is the same as the process of determining the video data to be fused from a group of video data whose time is before the first video data are the same and will not be repeated here.

步骤104:对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。Step 104: Perform fusion processing on the video data to be fused and the first video data to obtain edited video data.

在一实施例中,对所述待融合的视频数据与第一视频数据进行融合处理之后,所述方法还包括:确定融合处理后的视频数据对应的时长总和;对融合处理后的视频数据进行剪辑,得到时长等于所述预设时长的视频数据;将时长等于所述预设时长的视频数据作为剪辑后的视频数据。In one embodiment, after performing fusion processing on the video data to be fused and the first video data, the method further includes: determining the sum of the durations corresponding to the video data after fusion processing; performing fusion processing on the video data after fusion processing. Editing to obtain video data with a duration equal to the preset duration; using the video data with a duration equal to the preset duration as the edited video data.

这里,对视频数据进行剪辑包括以下情况:Here, clipping video data includes the following cases:

第一种、当所述第一视频数据对应的第一时长大于或等于所述预设时长时,不对所述第一视频数据进行融合处理,而是直接对所述第一视频数据进行剪辑。First, when the first duration corresponding to the first video data is greater than or equal to the preset duration, the first video data is not fused, but the first video data is directly edited.

具体地,对所述第一视频数据进行剪辑,剪辑得到的视频数据需满足to-tb≤Tmmax且te-to≤Tmmax。其中,to是识别出的精彩动作对应的时间;tb是所述第一视频数据对应的开始时间,te是所述第一视频数据对应的结束时间,Tmmax为预设时长。Specifically, the first video data is edited, and the video data obtained by editing must satisfy to-tb≤Tmmax and te-to≤Tmmax . Wherein, to is the time corresponding to the identified exciting action; tb is the start time corresponding to the first video data, te is the end time corresponding to the first video data, and Tmmax is a preset duration.

第二种、计算待融合的视频数据与所述第一视频数据对应的时长总和,当所述时长总和大于或等于所述预设时长,对待融合的视频数据与第一视频数据进行融合处理,对融合处理后的视频数据进行剪辑。其中,待融合的视频数据是从时间在所述第一视频数据之前的各组视频数据中确定的。The second is to calculate the sum of the durations corresponding to the video data to be fused and the first video data, when the sum of the durations is greater than or equal to the preset duration, the video data to be fused and the first video data are fused, Edit the fused video data. The video data to be fused is determined from each group of video data whose time is before the first video data.

具体地,将待融合数据与所述第一视频数据进行融合处理,对融合处理后的视频数据进行剪辑。结合融合处理后的视频数据的时间抽,从时间轴的开始处,裁剪掉对应时长为Tp=Tm1-Tmmax的视频数据;Tp≤1/2ΣTpk。其中,Tm1表示待融合的视频数据与所述第一视频数据对应的时长总和,Tpk表示第i组视频数据对应的时长,第i组视频数据为时间在所述第一视频数据之前的至少一组视频数据。Specifically, the data to be fused and the first video data are fused, and the fused video data is edited. Combined with the time extraction of the video data after fusion processing, from the beginning of the time axis, the video data corresponding to the duration Tp=Tm1-Tmmax is cropped; Tp≤1/2ΣTpk . Wherein, Tm1 represents thesum of the time lengths corresponding to the video data to be fused and the first video data, Tpk represents the time length corresponding to the ith group of video data, and the ith group of video data is at least the time before the first video data. A set of video data.

第三种、计算待融合的视频数据与所述第一视频数据对应的时长总和,当所述时长总和大于或等于所述预设时长,对待融合的视频数据与第一视频数据进行融合处理,对融合处理后的视频数据进行剪辑。其中,待融合的视频数据是从时间在所述第一视频数据之前和之后的各组视频数据中确定的。The third method is to calculate the sum of the durations corresponding to the video data to be fused and the first video data. When the sum of the durations is greater than or equal to the preset duration, the video data to be fused and the first video data are fused. Edit the fused video data. The video data to be fused is determined from each group of video data whose time is before and after the first video data.

具体地,将待融合数据与所述第一视频数据进行融合处理,对融合处理后的视频数据进行剪辑。结合融合处理后的视频数据的时间抽,从时间轴的结尾处,裁剪掉对应时长为Tp=Tm2-Tmmax的视频数据;Tp≤1/2ΣTpk。其中,Tm2表示待融合的视频数据与所述第一视频数据对应的时长总和,Tsk表示第i组视频数据对应的时长,第i组视频数据为时间在所述第一视频数据之前的至少一组视频数据。Specifically, the data to be fused and the first video data are fused, and the fused video data is edited. Combined with the time extraction of the video data after fusion processing, from the end of the time axis, the video data corresponding to the duration Tp=Tm2-Tmmax is cropped; Tp≤1/2ΣTpk . Wherein, Tm2 represents thesum of the time lengths corresponding to the video data to be fused and the first video data, Tsk represents the time length corresponding to the i-th group of video data, and the i-th group of video data is at least the time before the first video data. A set of video data.

采用本发明实施例提供的技术方案,将所述第一视频数据对应的第一时长与预设时长进行比较,当比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据,如此,可以保证内容满足预设条件的第一视频数据的完整。基于将剩余组视频数据对应的时长和预设时长范围,从剩余组视频数据中确定待融合的视频数据,如此,可以控制与所述第一视频数据进行融合的视频数据的时长。对所述待融合的视频数据与第一视频数据进行融合处理,对融合处理后的视频数据进行剪辑,得到剪辑后的视频数据;所述剪辑后的视频数据中包含所述第一视频数据。显然,在剪辑后的视频数据中能够保存完整的第一视频数据,同时能够限定与第一视频数据进行融合的视频数据的时长。By adopting the technical solution provided by the embodiment of the present invention, the first duration corresponding to the first video data is compared with the preset duration, and when the comparison result indicates that the first duration is less than the preset duration, the first duration corresponding to the first video data is compared with the preset duration. The video data to be fused is determined. In this way, the integrity of the first video data whose content meets the preset condition can be guaranteed. The video data to be fused is determined from the remaining groups of video data based on the corresponding durations and preset duration ranges of the remaining sets of video data, so that the duration of the video data to be fused with the first video data can be controlled. The video data to be fused and the first video data are fused, and the fused video data is edited to obtain edited video data; the edited video data includes the first video data. Obviously, the complete first video data can be stored in the edited video data, and at the same time, the duration of the video data to be fused with the first video data can be limited.

下面以具体实施例为例,详细说明本发明在实际应用中的实现过程及原理。The implementation process and principle of the present invention in practical applications will be described in detail below by taking specific embodiments as examples.

图2为本发明实施例视频处理方法的具体实现流程示意图,具体实现过程,包括如下步骤:2 is a schematic diagram of a specific implementation flow of a video processing method according to an embodiment of the present invention, and the specific implementation process includes the following steps:

步骤201:获取用户上传的待处理视频数据;并对待处理视频数据进行划分,得到至少一组视频数据。Step 201: Acquire the video data to be processed uploaded by the user; and divide the video data to be processed to obtain at least one set of video data.

其中,一组视频数据对应一个镜头画面。Wherein, a group of video data corresponds to one shot picture.

考虑到一个镜头画面内的图像具有连续性,两个镜头画面对应的两个图像之间具有差异性,因而可以对所述待处理视频数据进行特征提取。将所述待处理视频拆解为多个视频帧;针对每个视频帧,提取直方图特征数据;针对相邻两个视频帧对应的直方图特征数据,计算均方差,并对计算的均方差进行归一化处理;计算视频帧直方图特征变化率;根据预设的的变化率门限值完成镜头分割,若小于阀值则判断为同一镜头;若大于等于阀值则判断为不同镜头Considering that the images in one shot frame are continuous, and the two images corresponding to the two shot frames are different, the feature extraction can be performed on the video data to be processed. The video to be processed is disassembled into multiple video frames; for each video frame, extract histogram feature data; for the histogram feature data corresponding to two adjacent video frames, calculate the mean square error, and compare the calculated mean square error Perform normalization processing; calculate the feature change rate of the histogram of the video frame; complete the shot segmentation according to the preset change rate threshold value, if it is less than the threshold value, it is judged as the same shot; if it is greater than or equal to the threshold value, it is judged as a different shot

步骤202:对所述至少一组视频数据进行识别,得到内容类型为精彩视频内容的一组视频数据,并作为第一视频数据,确定所述第一视频数据对应的第一时长T0。Step 202 : Identify the at least one group of video data, obtain a group of video data whose content type is wonderful video content, and use it as the first video data to determine the first duration T0 corresponding to the first video data.

所述第一视频数据对应的镜头画面为精彩镜头画面。The shot picture corresponding to the first video data is a wonderful shot picture.

可以使用基于AI的动作场景检测模型,检测出对应精彩视频内容的第一视频数据。比如,假设待处理视频为足球比赛视频,识别出的所述第一视频数据对应的精彩视频内容可以为进球或者角球等等。The AI-based action scene detection model can be used to detect the first video data corresponding to the wonderful video content. For example, assuming that the video to be processed is a video of a football game, the identified highlight video content corresponding to the first video data may be a goal or a corner kick or the like.

可以结合所述至少一组视频数据的时间轴,确定第一视频数据对应的精彩镜头画面的开始时间tb以及结束时间te,从而确定所述第一视频数据对应的精彩镜头画面的第一时长T0=te-tb。The start time tb and end time te of the highlight picture corresponding to the first video data can be determined in combination with the time axis of the at least one group of video data, thereby determining the first duration T0 of the highlight picture corresponding to the first video data. =te-tb.

步骤203:基于统计的不同内容类型的视频数据及对应时长,确定预设时长Tmmax;判断T0是否大于或等于Tmmax,当确定时,执行步骤212;否则,执行步骤204。Step 203 : Determine the preset duration Tmmax based on the statistical video data of different content types and corresponding durations; determine whether T0 is greater than or equal to Tmmax , when determined, go toStep 212 ; otherwise, go toStep 204 .

以内容类型为精彩视频内容为例,确定预设时长Tmmax的过程包括:Taking the content type as wonderful video content as an example, the process of determining the preset duration Tmmax includes:

以短视频为例,基于大数据算法,对存储的短视频数据和用户历史播放的短视频数据进行分类统计;针对不同类别的每个短视频数据,将相应短视频数据进行划分,得到至少一组短视频数据,对所述至少一组短视频数据的内容类型进行识别,将识别的内容类型为精彩视频内容的一组短视频数据作为第一短视频数据;得到对应不同类别的短视频数据的至少一个第一短视频数据;确定所述第一短视频数据对应的时长分布,假设为正态分布;假设预设比例为50%,确定50%的正态分布面积对应的各个时长,将确定的各个时长中的最大时长作为所述预设时长TmmaxTaking short videos as an example, based on big data algorithms, the stored short video data and the short video data played by users in the past are classified and counted; for each short video data of different categories, the corresponding short video data is divided to obtain at least one Group short video data, identify the content type of the at least one group of short video data, and use a group of short video data whose identified content type is wonderful video content as the first short video data; obtain short video data corresponding to different categories at least one first short video data; determine the time length distribution corresponding to the first short video data, assuming a normal distribution; assuming that the preset ratio is 50%, determine each time length corresponding to the 50% normal distribution area, and set the The maximum duration among the determined durations is taken as the preset duration Tmmax .

举例来说,假设针对足球比赛类的短视频数据,识别出的第一短视频数据对应的最大时长为200s,假设针对竞技游戏类的短视频数据,识别出的第一短视频数据对应的最大时长为260s,假设针对电影类的短视频数据,识别出的第一短视频数据对应的最大时长为180s。For example, it is assumed that for the short video data of football matches, the maximum duration corresponding to the first short video data identified is 200s, and for the short video data of competitive games, the maximum duration corresponding to the first short video data identified is 200s. The duration is 260s, and it is assumed that for the short video data of the movie type, the maximum duration corresponding to the identified first short video data is 180s.

确定第一预设时长范围的过程包括:The process of determining the first preset duration range includes:

基于大数据算法,对存储的短视频数据和用户历史播放的短视频数据进行分类统计;针对不同类别的每个短视频数据,将相应短视频数据进行划分,得到至少一组短视频数据,对所述至少一组短视频数据的内容类型进行识别,将识别的内容类型为精彩视频内容的一组短视频数据作为第一短视频数据;得到对应不同类别的短视频数据的至少一个第一短视频数据;结合视频数据的时间轴,确定时间在所述第一短视频数据之前的各组视频数据对应的时长分布,假设为正态分布;假设预设比例为50%,确定50%的正态分布面积对应的各个时长,将确定的各个时长中的最小时长作为所述第一预设时长范围的开始时间Tpmin,将确定的各个时长中的最大时长作为所述第一预设时长范围的结束时间TpmaxBased on the big data algorithm, classify and count the stored short video data and the short video data played by users in the past; for each short video data of different categories, divide the corresponding short video data to obtain at least one set of short video data. The content type of the at least one group of short video data is identified, and a group of short video data whose identified content type is wonderful video content is used as the first short video data; at least one first short video data corresponding to different categories of short video data is obtained. Video data; combined with the time axis of the video data, determine the time length distribution corresponding to each group of video data before the first short video data, assuming a normal distribution; assuming that the preset ratio is 50%, determine the 50% positive Each time length corresponding to the state distribution area, the minimum time length among the determined time lengths is used as the start time Tpmin of the first preset time length range, and the maximum time length among the determined time lengths is used as the first preset time length range. The end time Tpmax .

举例来说,假设针对足球比赛类的短视频数据,识别出时间在第一短视频数据之前的各组视频数据即各个前导镜头画面,确定各个前导镜头画面对应的时长分布,基于所述时长分布,确定出最小时长为30s、最大时长为90s;假设针对竞技游戏类的短视频数据,识别出时间在第一短视频数据之前的各组视频数据即各个前导镜头画面,确定各个前导镜头画面对应的时长分布,基于所述时长分布,确定出最小时长为20s、最大时长为100s,假设针对电影类的短视频数据,识别出时间在第一短视频数据之前的各组视频数据即各个前导镜头画面,确定各个前导镜头画面对应的时长分布,基于所述时长分布,确定出最小时长为15s、最大时长为80s。For example, it is assumed that for the short video data of a football match, each group of video data whose time is before the first short video data, that is, each leading shot, is determined, and the duration distribution corresponding to each leading shot is determined, based on the duration distribution. , determine that the minimum duration is 30s and the maximum duration is 90s; assuming that for the short video data of competitive games, each group of video data whose time is before the first short video data, that is, each leading shot, is determined to correspond to each leading shot. Based on the duration distribution, it is determined that the minimum duration is 20s and the maximum duration is 100s. Assuming that for the short video data of the movie category, each group of video data whose time is before the first short video data is identified as each leading shot picture, determine the duration distribution corresponding to each leading shot picture, and based on the duration distribution, determine that the minimum duration is 15s and the maximum duration is 80s.

确定第二预设时长范围的过程包括:The process of determining the second preset duration range includes:

基于大数据算法,对存储的短视频数据和用户历史播放的短视频数据进行分类统计;针对不同类别的每个短视频数据,将相应短视频数据进行划分,得到至少一组短视频数据,对所述至少一组短视频数据的内容类型进行识别,将识别的内容类型为精彩视频内容的一组短视频数据作为第一短视频数据;得到对应不同类别的短视频数据的至少一个第一短视频数据;结合视频数据的时间轴,确定时间在所述第一短视频数据之后的各组视频数据对应的时长分布,假设为正态分布;假设预设比例为50%,确定50%的正态分布面积对应的各个时长,将确定的各个时长中的最小时长作为所述第二预设时长范围的开始时间Tsmin,将确定的各个时长中的最大时长作为所述第二预设时长范围的结束时间TsmaxBased on the big data algorithm, classify and count the stored short video data and the short video data played by users in the past; for each short video data of different categories, divide the corresponding short video data to obtain at least one set of short video data. The content type of the at least one group of short video data is identified, and a group of short video data whose identified content type is wonderful video content is used as the first short video data; at least one first short video data corresponding to different categories of short video data is obtained. Video data; combined with the time axis of the video data, determine the time length distribution corresponding to each group of video data after the first short video data, assuming a normal distribution; assuming that the preset ratio is 50%, determine the 50% positive Each time length corresponding to the state distribution area, the minimum time length among the determined time lengths is used as the start time Tsmin of the second preset time length range, and the maximum time length among the determined time lengths is used as the second preset time length range. The end time Tsmax .

举例来说,假设针对足球比赛类的短视频数据,识别出时间在第一短视频数据之后的各组视频数据即各个后继镜头画面,确定各个后继镜头画面对应的时长分布,基于所述时长分布,确定出最小时长为20s、最大时长为80s;假设针对竞技游戏类的短视频数据,识别出时间在第一短视频数据之后的各组视频数据即各个后继镜头画面,确定各个后继镜头画面对应的时长分布,基于所述时长分布,确定出最小时长为30s、最大时长为90s,假设针对电影类的短视频数据,识别出时间在第一短视频数据之后的各组视频数据即各个后继镜头画面,确定各个后继镜头画面对应的时长分布,基于所述时长分布,确定出最小时长为10s、最大时长为70s。For example, it is assumed that for the short video data of a football match, each group of video data after the first short video data, that is, each subsequent shot, is identified, and the duration distribution corresponding to each subsequent shot is determined, based on the duration distribution. , determine that the minimum duration is 20s and the maximum duration is 80s; assuming that for the short video data of competitive games, identify each group of video data after the first short video data, that is, each subsequent shot, and determine the correspondence of each subsequent shot. Based on the duration distribution, it is determined that the minimum duration is 30s and the maximum duration is 90s. Suppose that for the short video data of the movie category, each group of video data whose time is after the first short video data is identified as each subsequent shot. picture, determine the duration distribution corresponding to each subsequent shot picture, and based on the duration distribution, determine that the minimum duration is 10s and the maximum duration is 70s.

步骤204:判断第i组视频数据对应的时长Tpk是否小于或等于第一预设时长范围的起始时间Tpmin;当确定时,则将第i组视频数据作为待融合的视频数据,并继续判断第i+1组视频数据对应的时长Tpk是否小于或等于第一预设时长范围的起始时间Tpmin;否则,执行步骤205。Step 204: Judging whether the corresponding duration Tpk of the i-th group of video data is less than or equal to the start time Tpmin of the first preset duration range; when determined, then the i-th group of video data is used as the video data to be fused, and Continue to judge whether the duration Tpk corresponding to the i+1 th group of video data is less than or equal to the start time Tpmin of the first preset duration range; otherwise, go to step 205 .

其中,第i组视频数据为时间在所述第一视频数据之前的至少一组视频数据,第m组视频数据为时间在所述第一视频数据之后的至少一组视频数据。i=1,2,3,…N,N为正整数,m=1,2,3,…M,M为正整数。Wherein, the i-th group of video data is at least one group of video data whose time is before the first video data, and the m-th group of video data is at least one group of video data whose time is after the first video data. i=1,2,3,...N, where N is a positive integer, m=1, 2,3,...M, where M is a positive integer.

图3是视频数据对应的镜头画面的示意图,如图3所示,所述第一视频数据对应的镜头画面为精彩镜头画面,第i组视频数据对应的镜头画面为前导镜头画面,第m组视频数据对应的镜头画面为后继镜头画面。FIG. 3 is a schematic diagram of a shot picture corresponding to video data. As shown in FIG. 3 , the shot picture corresponding to the first video data is a wonderful shot picture, the shot picture corresponding to the i-th group of video data is a leading shot picture, and the m-th group of video data is a leading shot picture. The shot picture corresponding to the video data is the subsequent shot picture.

由于用户对精彩镜头画面、前导镜头画面和后继镜头画面的关注度不同,关注度的优先级可以为:精彩镜头画面>前导镜头画面>后继镜头画面,所以在确定与所述第一视频数据进行融合的待融合视频数据时,优先从前导镜头画面对应的视频数据中确定待融合数据。Since the user pays different attention to the highlight shot, the leading shot, and the subsequent shot, the priority of the attention can be: highlight image > leading shot > subsequent shot, so after determining the first video data to perform When the video data to be fused is fused, the data to be fused is preferentially determined from the video data corresponding to the leading shot.

步骤205:判断第i组视频数据对应的时长Tpk是否小于第一预设时长范围的结束时间Tpmax;当确定时,则将第i组视频数据作为待融合的视频数据,并执行步骤208;否则,将第i组视频数据作为待融合的视频数据,执行步骤206。Step 205: determine whether the corresponding duration Tpk of the i-th group of video data is less than the end time Tpmax of the first preset duration range; when determined, then take the i-th group of video data as the video data to be fused, and executeStep 208 ; otherwise, the ith group of video data is used as the video data to be fused, and step 206 is executed.

步骤206:计算待融合的视频数据与所述第一视频数据对应的时长总和Tm1,并执行步骤207。Step 206 : Calculate the total duration Tm1 corresponding to the video data to be fused and the first video data, and executeStep 207 .

按照公式(1)计算时长总和Tm 1。Thetotal duration Tm 1 is calculated according to formula (1).

Tm1=T0+∑Tpk (1)Tm1=T0+∑Tpk (1)

其中,T0表示所述第一视频数据对应的第一时长,∑Tpk表示确定出的所有待融合视频数据对应的时长总和。Wherein, T0 represents the first duration corresponding to the first video data, andΣTpk represents the determined sum of durations corresponding to all the video data to be fused.

步骤207:判断所述时长总和Tm 1是否大于或等于所述预设时长Tmmax,当确定时,执行步骤209;否则,执行步骤208。Step 207 : Determine whether thetotal duration Tm 1 is greater than or equal to the preset duration Tmmax , when determined, go toStep 209 ; otherwise, go toStep 208 .

步骤208:判断第m组视频数据对应的时长Tsk是否小于或等于第二预设时长范围的起始时间Tsmin;当确定时,则将第m组视频数据作为待融合的视频数据,并继续判断第m+1组视频数据对应的时长Tsk是否小于或等于第二预设时长范围的起始时间Tsmin;否则,执行步骤210。Step 208: Judge whether the durationTsk corresponding to the mth group of video data is less than or equal to the start timeTsmin of the second preset duration range; when determined, then use the mth group of video data as the video data to be fused, and Continue to judge whether the duration Tsk corresponding to the m+ 1th group of video data is less than or equal to the start timeTsmin of the second preset duration range; otherwise,step 210 is performed.

步骤209:将待融合数据与所述第一视频数据进行融合处理,对融合处理后的视频数据进行剪辑。Step 209: Perform fusion processing on the data to be fused and the first video data, and edit the video data after fusion processing.

结合融合处理后的视频数据的时间抽,从时间轴的开始处,裁剪掉对应时长为Tp=Tm1-Tmmax的视频数据。其中,Tp≤1/2ΣTpkCombined with the time extraction of the video data after fusion processing, from the beginning of the time axis, the video data corresponding to the duration Tp=Tm1-Tmmax is cut out. Among them, Tp≤1/2ΣTpk .

步骤210:判断第m组视频数据对应的时长Tsk是否小于第二预设时长范围的结束时间Tsmax;当确定时,则将第m组视频数据作为待融合的视频数据;否则,将第m组视频数据作为待融合的视频数据,并执行步骤211。Step 210: judge whether the durationTsk corresponding to the mth group of video data is less than the end timeTsmax of the second preset duration range; when determined, the mth group of video data is used as the video data to be fused; otherwise, the The m groups of video data are used as the video data to be fused, and step 211 is executed.

步骤211:计算待融合的视频数据与所述第一视频数据对应的时长总和Tm2,并执行步骤213。Step 211 : Calculate the total duration Tm2 corresponding to the video data to be fused and the first video data, and executeStep 213 .

按照公式(2)计算时长总和Tm2。Calculate the total duration Tm2 according to formula (2).

Tm2=T0+∑Tsk+∑Tpk (2)Tm2=T0+∑Tsk +∑Tpk (2)

其中,T0表示所述第一视频数据对应的第一时长,∑Tsk+∑Tpk表示确定出的所有待融合视频数据对应的时长总和。Wherein, T0 represents the first duration corresponding to the first video data, and ∑Tsk +∑Tpk indicates the sum of the determined durations corresponding to all the video data to be fused.

步骤212:对所述第一视频数据进行剪辑,得到剪辑后的视频数据。Step 212: Edit the first video data to obtain edited video data.

对所述第一视频数据进行剪辑,剪辑得到的视频数据需满足to-tb≤Tmmax且te-to≤Tmmax。其中,to是识别出的精彩动作对应的时间;tb是所述第一视频数据对应的开始时间,te是所述第一视频数据对应的结束时间。The first video data is clipped, and the clipped video data needs to satisfy to-tb≤Tmmax and te-to≤Tmmax . Wherein, to is the time corresponding to the identified exciting action; tb is the start time corresponding to the first video data, and te is the end time corresponding to the first video data.

步骤213:判断所述时长总和Tm2是否大于或等于所述预设时长Tmmax,当确定时,执行步骤214;否则,执行步骤215。Step 213 : Determine whether the total duration Tm2 is greater than or equal to the preset duration Tmmax , when determined, go toStep 214 ; otherwise, go toStep 215 .

步骤214:将待融合数据与所述第一视频数据进行融合处理,对融合处理后的视频数据进行剪辑。Step 214: Perform fusion processing on the data to be fused and the first video data, and edit the video data after fusion processing.

结合融合处理后的视频数据的时间抽,从时间轴的结尾处,裁剪掉对应时长为Tp=Tm2-Tmmax的视频数据。其中,Tp≤1/2ΣTpkCombined with the time extraction of the video data after fusion processing, from the end of the time axis, the video data corresponding to the duration Tp=Tm2-Tmmax is cut out. Among them, Tp≤1/2ΣTpk .

步骤215:将确定的待融合数据与所述第一视频数据进行融合处理,将融合处理后的视频数据作为剪辑后的视频数据,得到剪辑后的短视频。Step 215: Perform fusion processing on the determined data to be fused and the first video data, and use the video data after fusion processing as edited video data to obtain a edited short video.

基于本申请各实施例提供的视频处理方法,本申请还提供一种视频处理装置,所述装置设置在终端上,如图4所示,所述装置包括:Based on the video processing methods provided by the embodiments of the present application, the present application further provides a video processing apparatus, where the apparatus is set on a terminal, as shown in FIG. 4 , the apparatus includes:

划分模块41,用于对待处理视频数据进行划分,得到至少一组视频数据;The dividing module 41 is used for dividing the video data to be processed to obtain at least one group of video data;

识别模块42,用于对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;The identification module 42 is configured to identify the content type of the at least one group of video data, take a group of video data whose content type meets a preset condition as the first video data, and determine the first video data corresponding to the first video data. duration;

比较模块43,用于将所述第一时长与预设时长进行比较,得到比较结果;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定待融合的视频数据;The comparison module 43 is configured to compare the first duration with a preset duration to obtain a comparison result; when the comparison result indicates that the first duration is less than the preset duration, determine the video data to be fused from the remaining groups of video data. video data;

剪辑模块44,用于对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。The editing module 44 is configured to perform fusion processing on the video data to be fused and the first video data to obtain edited video data.

在一实施例中,所述比较模块43,具体用于结合所述至少一组视频数据的时间轴,从除第一视频数据外的剩余组视频数据中,确定时间在第一视频数据之前的至少一组视频数据;针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据;当确定时,将相应组视频数据作为待融合的视频数据。In one embodiment, the comparison module 43 is specifically configured to combine the time axis of the at least one group of video data, from the remaining groups of video data except the first video data, to determine the time before the first video data. At least one group of video data; for each group of video data whose time is before the first video data, based on the corresponding duration of the corresponding group of video data and the first preset duration range, determine whether to use the corresponding group of video data as the video data to be fused; When determined, the corresponding group of video data is used as the video data to be fused.

所述比较模块43,具体用于针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否属于第一预设时长范围;当确定时,将相应组视频数据作为待融合的视频数据;并针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,判断是否将相应组视频数据作为待融合的视频数据。The comparison module 43 is specifically configured to, for each group of video data whose time is before the first video data, determine whether the corresponding time length of the corresponding group of video data belongs to the first preset time length range; when determined, the corresponding group of video data is used as video data to be fused; and for each group of video data whose time is after the first video data, based on the corresponding duration of the corresponding group of video data and the second preset duration range, determine whether to use the corresponding group of video data as the video data to be fused .

所述比较模块43,具体用于针对时间在第一视频数据之前的每组视频数据,判断第i组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;当确定时,将第i组视频数据作为待融合的视频数据;并判断第i+1组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;以此类推;其中,i=1,2,3,…N,N为正整数。The comparison module 43 is specifically configured to, for each group of video data whose time is before the first video data, determine whether the corresponding duration of the i-th group of video data is less than or equal to the start time of the first preset duration range; when determining , take the i group of video data as the video data to be fused; and judge whether the corresponding duration of the i+1 group video data is less than or equal to the start time of the first preset duration range; and so on; wherein, i=1 ,2,3,…N, where N is a positive integer.

所述比较模块43,具体用于针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否大于或等于第一预设时长范围的结束时间;当确定时,将相应组视频数据作为待融合的视频数据;并统计待融合的视频数据对应的时长总和;计算所述第一时长与所述时长总和之和,得到第二时长;判断所述第二时长是否小于所述预设时长;当确定时,针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,确定待融合的视频数据。The comparison module 43 is specifically configured to judge whether the duration corresponding to the corresponding set of video data is greater than or equal to the end time of the first preset duration range for each group of video data whose time is before the first video data; The corresponding group of video data is used as the video data to be fused; and the corresponding duration sum of the video data to be fused is counted; the sum of the first duration and the duration sum is calculated to obtain the second duration; it is judged whether the second duration is less than the preset duration; when determined, for each group of video data whose time is after the first video data, the video data to be fused is determined based on the duration corresponding to the corresponding group of video data and the second preset duration range.

在一实施例中,所述剪辑模块44,具体用于确定融合处理后的视频数据对应的时长总和;对融合处理后的视频数据进行剪辑,得到时长等于所述预设时长的视频数据;将时长等于所述预设时长的视频数据作为剪辑后的视频数据。In one embodiment, the editing module 44 is specifically configured to determine the sum of durations corresponding to the video data after fusion processing; edit the video data after fusion processing to obtain video data whose duration is equal to the preset duration; Video data with a duration equal to the preset duration is used as edited video data.

在一实施例中,所述装置还包括:确定模块;In one embodiment, the apparatus further includes: a determining module;

所述确定模块,用于利用机器学习算法,统计不同内容类型的视频数据及对应时长;利用统计的不同内容类型的视频数据及对应时长,确定与所述第一视频数据的内容类型相同的至少一个视频数据,以及所述至少一个视频数据对应的时长分布;基于所述时长分布,确定所述预设时长。The determining module is configured to use a machine learning algorithm to count video data of different content types and corresponding durations; use the statistical video data of different content types and corresponding durations to determine at least the same content type as the first video data. One piece of video data, and a duration distribution corresponding to the at least one piece of video data; the preset duration is determined based on the duration distribution.

需要说明的是:上述实施例提供的视频处理装置在进行视频处理时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的视频处理装置与视频处理方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the video processing apparatus provided in the above-mentioned embodiments performs video processing, only the division of the above-mentioned program modules is used as an example for illustration. In practical applications, the above-mentioned processing can be allocated to different program modules as required. That is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the video processing apparatus and the video processing method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.

在实际应用中,划分模块41、识别模块42、比较模块43、剪辑模块44、确定模块可由位于视频处理装置上的处理器比如中央处理器(CPU,Central Processing Unit)、微处理器(MPU,Micro Processor Unit)、数字信号处理器(DSP,Digital Signal Processor)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等实现。In practical applications, the division module 41 , the identification module 42 , the comparison module 43 , the editing module 44 , and the determination module can be processed by processors located on the video processing device, such as a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Micro Processor Unit), Digital Signal Processor (DSP, Digital Signal Processor), or Field Programmable Gate Array (FPGA, Field Programmable Gate Array) etc.

图5是本发明视频处理装置的结构示意图,图5所示的视频处理装置500设置在所述终端上,包括:至少一个处理器501、存储器502、用户接口503、至少一个网络接口504。视频处理装置500中的各个组件通过总线系统505耦合在一起。可理解,总线系统505用于实现这些组件之间的连接通信。总线系统505除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图5中将各种总线都标为总线系统505。5 is a schematic structural diagram of a video processing apparatus according to the present invention. Thevideo processing apparatus 500 shown in FIG. The various components invideo processing apparatus 500 are coupled together bybus system 505 . It is understood that thebus system 505 is used to implement the connection communication between these components. In addition to the data bus, thebus system 505 also includes a power bus, a control bus and a status signal bus. However, for clarity of illustration, the various buses are labeled asbus system 505 in FIG. 5 .

其中,用户接口503可以包括显示器、键盘、鼠标、轨迹球、点击轮、按键、按钮、触感板或者触摸屏等。Theuser interface 503 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen, and the like.

本发明实施例中的存储器502用于存储各种类型的数据以支持视频处理装置500的操作。这些数据的示例包括:用于在视频处理装置500上操作的任何计算机程序,如操作系统5021和应用程序5022;其中,操作系统5021包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务。应用程序5022可以包含各种应用程序,用于实现各种应用业务。实现本发明实施例方法的程序可以包含在应用程序5022中。Thememory 502 in the embodiment of the present invention is used to store various types of data to support the operation of thevideo processing apparatus 500 . Examples of such data include: any computer program for operating on thevideo processing apparatus 500, such as anoperating system 5021 and anapplication program 5022; wherein theoperating system 5021 contains various system programs, such as a framework layer, a core library layer, a driver layer etc., used to implement various basic services and handle hardware-based tasks. Theapplication program 5022 may include various application programs for implementing various application services. The program for implementing the method of the embodiment of the present invention may be included in theapplication program 5022 .

上述本发明实施例揭示的方法可以应用于处理器501中,或者由处理器501实现。处理器501可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器501中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器501可以是通用处理器、数字信号处理器,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器501可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器502,处理器501读取存储器502中的信息,结合其硬件完成前述方法的步骤。The methods disclosed in the above embodiments of the present invention may be applied to theprocessor 501 or implemented by theprocessor 501 . Theprocessor 501 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in theprocessor 501 or an instruction in the form of software. The above-mentionedprocessor 501 may be a general-purpose processor, a digital signal processor, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Theprocessor 501 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, and the storage medium is located in thememory 502, and theprocessor 501 reads the information in thememory 502, and completes the steps of the foregoing method in combination with its hardware.

可以理解,存储器502可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可视频处理可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可视频处理可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random AccessMemory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,SynchronousDynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器502旨在包括但不限于这些和任意其它适合类型的存储器。It will be appreciated that thememory 502 may be either volatile memory or non-volatile memory, and may include both volatile and non-volatile memory. Wherein, the non-volatile memory can be read only memory (ROM, Read Only Memory), programmable read only memory (PROM, Programmable Read-Only Memory), video processing programmable read only memory (EPROM, Erasable Programmable Read-Only Memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory, Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a magnetic disk memory or a tape memory. The volatile memory may be Random Access Memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM, SynchronousDynamic Random Access Memory), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, SyncLink Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access Memory) . Thememory 502 described in the embodiments of the present invention is intended to include, but not be limited to, these and any other suitable types of memory.

基于本申请各实施例提供的视频处理方法,本申请还提供一种计算机可读存储介质,参照图5所示,所述计算机可读存储介质可以包括:用于存储计算机程序的存储器502,上述计算机程序可由视频处理装置500的处理器501执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器。Based on the video processing methods provided by the embodiments of the present application, the present application further provides a computer-readable storage medium. Referring to FIG. 5 , the computer-readable storage medium may include: amemory 502 for storing computer programs, the above-mentioned The computer program can be executed by theprocessor 501 of thevideo processing apparatus 500 to complete the steps of the aforementioned methods. The computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM.

需要说明的是:本发明实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。It should be noted that the technical solutions described in the embodiments of the present invention may be combined arbitrarily unless there is a conflict.

以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.

Claims (10)

Translated fromChinese
1.一种视频处理方法,其特征在于,所述方法包括:1. a video processing method, is characterized in that, described method comprises:对待处理视频数据进行划分,得到至少一组视频数据;dividing the video data to be processed to obtain at least one set of video data;对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;Identifying the content type of the at least one group of video data, using a group of video data whose content type meets a preset condition as the first video data, and determining the first duration corresponding to the first video data;将所述第一时长与预设时长进行比较,得到比较结果;Comparing the first duration with the preset duration to obtain a comparison result;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定至少一组视频数据;基于相应组视频数据对应的时长和第一预设时长范围,确定待融合的视频数据;When the comparison result indicates that the first duration is less than the preset duration, at least one set of video data is determined from the remaining sets of video data; based on the duration corresponding to the corresponding set of video data and the first preset duration range, determine the video data;对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。The video data to be fused and the first video data are fused to obtain edited video data.2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, wherein the method further comprises:统计不同内容类型的视频数据及对应时长;Statistics of video data of different content types and corresponding duration;根据统计的不同内容类型的视频数据及对应时长,确定与所述第一视频数据的内容类型相同的至少一个视频数据;Determine at least one video data of the same content type as the first video data according to the statistical video data of different content types and corresponding durations;基于所述至少一个视频数据对应的时长分布,确定所述预设时长。The preset duration is determined based on the duration distribution corresponding to the at least one piece of video data.3.根据权利要求1所述的方法,其特征在于,从剩余组视频数据中确定至少一组视频数据;基于相应组视频数据对应的时长和第一预设时长范围,确定待融合的视频数据,包括:3. The method according to claim 1, wherein at least one group of video data is determined from the remaining groups of video data; based on the corresponding duration of the corresponding group of video data and the first preset duration range, determine the video data to be fused ,include:结合所述至少一组视频数据的时间轴,从除第一视频数据外的剩余组视频数据中,确定时间在第一视频数据之前的至少一组视频数据;In combination with the time axis of the at least one group of video data, from the remaining groups of video data except the first video data, determine at least one group of video data whose time is before the first video data;针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据;For each group of video data whose time is before the first video data, determine whether to use the corresponding group of video data as the video data to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range;当确定时,将相应组视频数据作为待融合的视频数据。When determined, the corresponding group of video data is used as the video data to be fused.4.根据权利要求3所述的方法,其特征在于,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:4. The method according to claim 3, wherein, for each group of video data whose time is before the first video data, based on the corresponding duration of the corresponding group of video data and the first preset duration range, it is judged whether to The corresponding group of video data is used as the video data to be fused, including:针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否属于第一预设时长范围;For each group of video data whose time is before the first video data, determine whether the duration corresponding to the corresponding group of video data belongs to the first preset duration range;当确定时,将相应组视频数据作为待融合的视频数据;并针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,判断是否将相应组视频数据作为待融合的视频数据。When determined, the corresponding group of video data is used as the video data to be fused; and for each group of video data whose time is after the first video data, based on the corresponding time length of the corresponding group of video data and the second preset time length range, determine whether to The corresponding group of video data is used as the video data to be fused.5.根据权利要求3所述的方法,其特征在于,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:5. The method according to claim 3, wherein, for each group of video data whose time is before the first video data, based on the corresponding duration of the corresponding group of video data and the first preset duration range, determine whether to The corresponding group of video data is used as the video data to be fused, including:针对时间在第一视频数据之前的每组视频数据,判断第i组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;For each group of video data whose time is before the first video data, determine whether the duration corresponding to the i-th group of video data is less than or equal to the start time of the first preset duration range;当确定时,将第i组视频数据作为待融合的视频数据;并判断第i+1组视频数据对应的时长是否小于或等于第一预设时长范围的起始时间;以此类推;When determining, the i group of video data is used as the video data to be fused; and it is judged whether the corresponding duration of the i+1 group video data is less than or equal to the start time of the first preset duration range; and so on;其中,i=1,2,3,…N,N为正整数。Among them, i=1, 2, 3,...N, and N is a positive integer.6.根据权利要求3所述的方法,其特征在于,所述针对时间在第一视频数据之前的每组视频数据,基于相应组视频数据对应的时长和第一预设时长范围,判断是否将相应组视频数据作为待融合的视频数据,包括:6. The method according to claim 3, wherein, for each group of video data whose time is before the first video data, based on the corresponding duration of the corresponding group of video data and the first preset duration range, determine whether to The corresponding group of video data is used as the video data to be fused, including:针对时间在第一视频数据之前的每组视频数据,判断相应组视频数据对应的时长是否大于或等于第一预设时长范围的结束时间;For each group of video data whose time is before the first video data, determine whether the duration corresponding to the corresponding group of video data is greater than or equal to the end time of the first preset duration range;当确定时,将相应组视频数据作为待融合的视频数据;并统计待融合的视频数据对应的时长总和;When determined, the corresponding group of video data is used as the video data to be fused; and the sum of the durations corresponding to the video data to be fused is counted;计算所述第一时长与所述时长总和之和,得到第二时长;calculating the sum of the first duration and the sum of the durations to obtain a second duration;判断所述第二时长是否小于所述预设时长;determining whether the second duration is less than the preset duration;当确定时,针对时间在第一视频数据之后的每组视频数据,基于相应组视频数据对应的时长和第二预设时长范围,确定待融合的视频数据。When determined, for each group of video data whose time is after the first video data, the video data to be fused is determined based on the duration corresponding to the corresponding group of video data and the second preset duration range.7.根据权利要求1或2所述的方法,其特征在于,所述方法还包括:7. The method according to claim 1 or 2, wherein the method further comprises:确定融合处理后的视频数据对应的时长总和;Determine the sum of the durations corresponding to the video data after fusion processing;对融合处理后的视频数据进行剪辑,得到时长等于所述预设时长的视频数据;Editing the fused video data to obtain video data with a duration equal to the preset duration;将时长等于所述预设时长的视频数据作为剪辑后的视频数据。The video data whose duration is equal to the preset duration is used as the edited video data.8.一种视频处理装置,其特征在于,所述装置包括:8. A video processing device, wherein the device comprises:划分模块,用于对待处理视频数据进行划分,得到至少一组视频数据;A division module, for dividing the video data to be processed to obtain at least one group of video data;识别模块,用于对所述至少一组视频数据的内容类型进行识别,将内容类型满足预设条件的一组视频数据作为第一视频数据,并确定所述第一视频数据对应的第一时长;An identification module, configured to identify the content type of the at least one group of video data, take a group of video data whose content type meets a preset condition as the first video data, and determine the first duration corresponding to the first video data ;比较模块,用于将所述第一时长与预设时长进行比较,得到比较结果;当所述比较结果表征所述第一时长小于预设时长时,从剩余组视频数据中确定至少一组视频数据;基于相应组视频数据对应的时长和第一预设时长范围,确定待融合的视频数据;a comparison module, configured to compare the first duration with a preset duration to obtain a comparison result; when the comparison result indicates that the first duration is less than the preset duration, determine at least one set of videos from the remaining sets of video data data; determine the video data to be fused based on the corresponding duration of the corresponding group of video data and the first preset duration range;剪辑模块,用于对所述待融合的视频数据与第一视频数据进行融合处理,以得到剪辑后的视频数据。The editing module is configured to perform fusion processing on the video data to be fused and the first video data to obtain edited video data.9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7任一项所述方法的步骤。9 . A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.10.一种视频处理装置,其特征在于,包括:存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序;10. A video processing device, comprising: a memory, a processor, and a computer program stored in the memory and running on the processor;其中,所述处理器用于运行所述计算机程序时,执行权利要求1至7任一项所述方法的步骤。Wherein, the processor is configured to execute the steps of the method of any one of claims 1 to 7 when running the computer program.
CN201811021096.4A2018-09-032018-09-03 A video processing method, device and computer-readable storage mediumActiveCN109167934B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201811021096.4ACN109167934B (en)2018-09-032018-09-03 A video processing method, device and computer-readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201811021096.4ACN109167934B (en)2018-09-032018-09-03 A video processing method, device and computer-readable storage medium

Publications (2)

Publication NumberPublication Date
CN109167934A CN109167934A (en)2019-01-08
CN109167934Btrue CN109167934B (en)2020-12-22

Family

ID=64893847

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201811021096.4AActiveCN109167934B (en)2018-09-032018-09-03 A video processing method, device and computer-readable storage medium

Country Status (1)

CountryLink
CN (1)CN109167934B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109982109B (en)*2019-04-032021-08-03睿魔智能科技(深圳)有限公司Short video generation method and device, server and storage medium
CN111246124B (en)*2020-03-092021-05-25三亚至途科技有限公司Multimedia digital fusion method and device
CN111800673A (en)*2020-07-312020-10-20聚好看科技股份有限公司Video playing method, display equipment and server
CN113015005B (en)*2021-05-252021-08-31腾讯科技(深圳)有限公司Video clipping method, device and equipment and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101072305A (en)*2007-06-082007-11-14华为技术有限公司Lens classifying method, situation extracting method, abstract generating method and device
CN101896906A (en)*2007-12-172010-11-24国际商业机器公司Based on the extraction of time slice and the robustness coupling of video finger print
CN102770861A (en)*2010-12-132012-11-07英特尔公司Data highlighting and extraction
CN103635967A (en)*2011-06-212014-03-12诺基亚公司Video remixing system
CN103873927A (en)*2012-12-172014-06-18联想(北京)有限公司Stream media data processing method and electronic equipment
CN107483843A (en)*2017-08-162017-12-15成都品果科技有限公司Audio frequency and video match clipping method and device
CN107566907A (en)*2017-09-202018-01-09广东欧珀移动通信有限公司 Video editing method, device, storage medium and terminal
CN108259990A (en)*2018-01-262018-07-06腾讯科技(深圳)有限公司A kind of method and device of video clipping

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP4758161B2 (en)*2004-07-302011-08-24パナソニック株式会社 Digest creation method and apparatus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101072305A (en)*2007-06-082007-11-14华为技术有限公司Lens classifying method, situation extracting method, abstract generating method and device
CN101896906A (en)*2007-12-172010-11-24国际商业机器公司Based on the extraction of time slice and the robustness coupling of video finger print
CN102770861A (en)*2010-12-132012-11-07英特尔公司Data highlighting and extraction
CN103635967A (en)*2011-06-212014-03-12诺基亚公司Video remixing system
CN103873927A (en)*2012-12-172014-06-18联想(北京)有限公司Stream media data processing method and electronic equipment
CN107483843A (en)*2017-08-162017-12-15成都品果科技有限公司Audio frequency and video match clipping method and device
CN107566907A (en)*2017-09-202018-01-09广东欧珀移动通信有限公司 Video editing method, device, storage medium and terminal
CN108259990A (en)*2018-01-262018-07-06腾讯科技(深圳)有限公司A kind of method and device of video clipping

Also Published As

Publication numberPublication date
CN109167934A (en)2019-01-08

Similar Documents

PublicationPublication DateTitle
CN109167934B (en) A video processing method, device and computer-readable storage medium
US9961403B2 (en)Visual summarization of video for quick understanding by determining emotion objects for semantic segments of video
CN108966012B (en)Video playing rate determining method and device and electronic equipment
US20190096441A1 (en)Method And Apparatus For Finding And Using Video Portions That Are Relevant To Adjacent Still Images
US8804999B2 (en)Video recommendation system and method thereof
US11594032B1 (en)Media player and video verification system
WO2021114710A1 (en)Live streaming video interaction method and apparatus, and computer device
US12283102B2 (en)System and method for merging asynchronous data sources
CN111429341A (en)Video processing method, video processing equipment and computer readable storage medium
CN108961314A (en)Moving image generation method, device, electronic equipment and computer readable storage medium
WO2018076710A1 (en)Method and device for smart photographing and storage medium
CN110019951B (en)Method and equipment for generating video thumbnail
CN119450165A (en) Method, device, electronic device and storage medium for determining video description information
US8358381B1 (en)Real-time video segmentation on a GPU for scene and take indexing
CN114222159A (en)Method and system for determining video scene change point and generating video clip
CN113923472A (en)Video content analysis method and device, electronic equipment and storage medium
CN116017041B (en) Video push method, device, computer equipment and storage medium
CN109327713B (en)Method and device for generating media information
CN111046232A (en)Video classification method, device and system
CN117858744A (en)System and method for generating daily updated ratings of individual player performances in sports
CN113472834A (en)Object pushing method and device
WO2024002092A1 (en)Method and apparatus for pushing video, and storage medium
WO2019042249A1 (en)Page-turning method and apparatus, and storage medium
US11527106B1 (en)Automated video verification
CN115187287A (en)Method and device for determining similar people, electronic equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp