Video segment recognition method, device, equipment and storage medium

Through the automatic identification method of video frame characteristics and occurrence time difference, the problem of low manual annotation efficiency in the existing technology is solved, and efficient processing of automatically determining the position of the beginning and end of the TV series is realized.

CN114550070BActive Publication Date: 2024-09-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202210219364.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2024-09-17
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

In the existing technology, determining the positions of the beginning and end of TV series requires a large amount of manual annotation, resulting in low efficiency.

Method used

By automatically identifying video frame pairs based on the similarity and occurrence time difference of video frame features, and fusion-determining candidate video segments, the target video segment within the target time range is finally determined.

Benefits of technology

No manual intervention is required, which improves the efficiency of determining the beginning and ending positions of TV series and realizes automated processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114550070B
    Figure CN114550070B
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for identifying video clips, which can be applied to video clip identification, artificial intelligence and vehicle-mounted scenes in computer technology. Through the technical solution provided in the embodiment of the present application, a video frame pair containing similar video frames is determined based on the similarity between the video frame features. The first video frame in the video frame pair is fused based on the appearance time difference to obtain at least one candidate video clip. Finally, a target video clip within the target time range is determined from at least one candidate video clip. The process of determining the target clip does not require human participation, and can be automatically performed by a computer device directly based on the first video and at least one second video, which is highly efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for identifying video clips. Background Art

[0002] With the development of computer technology, videos are growing in volume, and more and more users are watching videos online. Videos include TV series, and TV series usually have opening and ending credits. In order to facilitate users to watch TV series, video platforms provide the function of skipping the opening and ending credits, and the basis for skipping the opening and ending credits is to determine the position of the opening and ending credits in the TV series.

[0003] In the related art, the positions of the opening and ending credits of a TV series are determined by manual marking, that is, a person watches the TV series and then marks the positions of the opening and ending credits of the TV series.

[0004] However, the manual labeling method consumes a lot of time and human resources, resulting in low efficiency in determining the positions of the opening and ending credits of a TV series. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, device, and storage medium for identifying video clips, which can improve the efficiency of determining the positions of the beginning and the end of a TV series. The technical solution is as follows:

[0006] In one aspect, a method for identifying a video segment is provided, the method comprising:

[0007] Determine, based on video frame features of the first video and video frame features of at least one second video, a plurality of video frame pairs, the video frame pairs comprising a first video frame and a second video frame whose similarity meets a similarity condition, the first video frame belonging to the first video, and the second video frame belonging to the at least one second video;

[0008] Based on the appearance time difference of the multiple video frame pairs, first video frames in the multiple video frame pairs are merged to obtain at least one candidate video segment in the first video, wherein the appearance time difference refers to the difference between the appearance times of two video frames in the video frame pairs in the video;

[0009] At least one target video segment in the first video is determined based on the at least one candidate video segment and the target time range, where the target video segment is within the target time range of the first video.

[0010] In one aspect, a video segment recognition device is provided, the device comprising:

[0011] a video frame pair determination module, configured to determine a plurality of video frame pairs based on video frame features of a first video and video frame features of at least one second video, wherein the video frame pairs include a first video frame and a second video frame whose similarity meets a similarity condition, the first video frame belongs to the first video, and the second video frame belongs to the at least one second video;

[0012] a fusion module, configured to fuse first video frames of the plurality of video frame pairs based on appearance time differences of the plurality of video frame pairs to obtain at least one candidate video segment in the first video, wherein the appearance time difference refers to a difference between appearance times of two video frames of the video frame pairs in the video;

[0013] The target video segment determination module is used to determine at least one target video segment in the first video based on the at least one candidate video segment and the target time range, where the target video segment is within the target time range of the first video.

[0014] In a possible implementation, the fusion module is used to divide the multiple video frame pairs into multiple video frame groups based on the appearance time differences of the multiple video frame pairs, and the video frame pairs in the same video frame group correspond to the same appearance time difference; for any video frame group in the multiple video frame groups, the first video frame of the video frame pair in the video frame group is fused into one of the candidate video segments according to the appearance time of the first video frame of the video frame pair in the video frame group in the first video.

[0015] In a possible implementation, the fusion module is used to divide video frame pairs with the same appearance time difference into an initial video frame group; based on the appearance time difference corresponding to multiple initial video frame groups, the multiple initial video frame groups are fused to obtain the multiple video frame groups.

[0016] In a possible implementation, the fusion module is used to sort the multiple initial video frame groups according to a target order to obtain multiple candidate video frame groups; when the matching time difference between any two adjacent candidate video frame groups in the multiple candidate video frame groups meets the matching time difference condition, the two adjacent candidate video frame groups are fused into one video frame group, and the matching time difference refers to the difference between the corresponding appearance time differences of the two adjacent candidate video frame groups.

[0017] In a possible implementation, the two adjacent candidate video frame groups include a first candidate video frame group and a second candidate video frame group, and the fusion module is used to add the video frame pairs in the first candidate video frame group to the second candidate video frame group to obtain the video frame group when a matching time difference between an appearance time difference corresponding to the first candidate video frame group and an appearance time difference corresponding to the second candidate video frame group is less than or equal to a matching difference threshold.

[0018] In a possible implementation, the fusion module is used to add the video frame pairs in the first candidate video frame group to the second candidate video frame group; based on the appearance time difference corresponding to the second candidate video frame group, a reference second video frame is used to replace the target second video frame to obtain the video frame group, wherein the target second video frame is the second video frame newly added to the second candidate video frame group, the reference second video frame is the second video frame in the second video whose appearance time difference with the target first video frame is the appearance time difference corresponding to the second candidate video frame group, and the target first video frame is the first video frame in the video frame pair to which the target second video frame belongs.

[0019] In a possible implementation, the fusion module is used to compare the appearance time of the first video frames of any two adjacent video frame pairs in the video frame group in the first video; if the difference between the appearance time of the first video frames of the two adjacent video frame pairs in the first video meets the appearance time condition, the two adjacent video frame pairs are added to the temporary frame list; if the difference between the appearance time of the first video frames of the two adjacent video frame pairs in the first video does not meet the appearance time condition, the video frame pairs in the temporary frame list are fused into a reference video segment; based on multiple reference video segments, the at least one candidate video segment is determined.

[0020] In a possible implementation, the multiple reference video segments include a first overlapping video segment and / or a second overlapping video segment, the first overlapping video segment refers to a reference video segment belonging to a first reference video segment among the multiple reference video segments, and the second overlapping video segment refers to a reference video segment partially overlapping with a second reference video segment among the multiple reference video segments, and the fusion module is used to perform at least one of the following:

[0021] In a case where the multiple reference video segments include the first overlapping video segment, deleting the first overlapping video segment to obtain the at least one candidate video segment;

[0022] In a case where the multiple reference video segments include the second overlapping video segment, an overlapping portion between the second overlapping video segment and the second reference segment is deleted to obtain the at least one candidate video segment.

[0023] In a possible implementation, the fusion module is also used to: compare the duration of a third-category reference video segment with a target duration, wherein the third-category reference video segment refers to the second overlapping video segment with the overlapping portion deleted; if the duration of the third-category reference video segment is greater than or equal to the target duration, retain the third-category reference video segment; if the duration of the third-category reference video segment is less than the target duration, delete the third-category reference video segment.

[0024] In a possible implementation, the target video segment determination module is used to determine the at least one target candidate video segment based on the at least one candidate video segment, and the number of occurrences of the target candidate video segment in the at least one candidate video segment meets a number condition;

[0025] In the case that the appearance time of any of the target candidate video segments in the first video is within the target time range, the target candidate video segment is determined as the target video segment in the first video.

[0026] In a possible implementation, the target video segment determination module is used to determine at least one reference candidate video segment based on the at least one candidate video segment; determine the number of occurrences of each of the reference candidate video segments in the at least one reference candidate video segment; and determine the reference candidate video segment whose number of occurrences meets the number of occurrence conditions as the target candidate video segment.

[0027] In a possible implementation, the at least one candidate video segment includes a third overlapping video segment and / or a fourth overlapping video segment, the third overlapping video segment refers to a candidate video segment belonging to a first candidate video segment among the at least one candidate video segment, the fourth overlapping video segment refers to a candidate video segment partially overlapping with a second candidate video segment among the at least one candidate video segment, and the target video segment determination module is used to perform at least one of the following:

[0028] In a case where the at least one candidate video segment includes the third overlapping video segment, deleting the third overlapping video segment to obtain the at least one reference candidate video segment;

[0029] In a case where the at least one candidate video segment includes the fourth overlapping video segment, and the degree of overlap between the fourth overlapping video segment and the second candidate video segment meets the overlap condition, determining the number of occurrences of the fourth overlapping video segment; and determining the at least one reference candidate video segment based on the number of occurrences of the fourth overlapping video segment;

[0030] When the at least one candidate video segment includes the fourth overlapping video segment, and the degree of overlap between the fourth overlapping video segment and the second candidate video segment does not meet the overlap condition, deleting the fourth overlapping video segment to obtain the at least one reference candidate video segment;

[0031] In the case that the at least one candidate video segment includes the fourth overlapping video segment and the duration of the fourth overlapping video segment is shorter than that of the second candidate video segment, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

[0032] In a possible implementation manner, the target video segment determination module is configured to perform any of the following:

[0033] When the number of occurrences of the fourth overlapping video segment is greater than or equal to the first occurrence number threshold, fusing the fourth overlapping video segment with the second candidate video segment to obtain the at least one reference candidate video segment;

[0034] When the number of occurrences of the fourth overlapping video segment is less than the first occurrence threshold, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

[0035] In a possible implementation, the device further includes:

[0036] A feature extraction module, used for extracting features from a plurality of target video frames of a target video to be identified, and obtaining video frame features of the plurality of target video frames;

[0037] The target video segment determination module is further used to determine at least one target video segment of the target video based on the video frame features of the multiple target video frames, the video frame features of the first video frame, and the video frame features of the at least one second video.

[0038] On the one hand, a computer device is provided, which includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, and the computer program is loaded and executed by the one or more processors to implement the video clip recognition method.

[0039] On the one hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the video segment recognition method.

[0040] In one aspect, a computer program product is provided, comprising a computer program, which implements the above-mentioned video segment recognition method when executed by a processor.

[0041] Through the technical solution provided in the embodiment of the present application, based on the similarity between the video frame features, a video frame pair containing similar video frames is determined. Based on the appearance time difference, the first video frame in the video frame pair is fused to obtain at least one candidate video segment. Finally, a target video segment in a target time range is determined from the at least one candidate video segment. The process of determining the target segment does not require human participation, and can be automatically performed by a computer device directly based on the first video and at least one second video, which is highly efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 is a schematic diagram of an implementation environment of a method for identifying video clips provided in an embodiment of the present application;

[0044] Figure 2 is a flow chart of a method for identifying video clips provided in an embodiment of the present application;

[0045] Figure 3 is a flow chart of a method for identifying video clips provided in an embodiment of the present application;

[0046] Figure 4 is a flow chart of a method for extracting video frame features provided by an embodiment of the present application;

[0047] Figure 5 is a schematic diagram of a first sub-segment and a second sub-segment provided in an embodiment of the present application;

[0048] Figure 6 is a schematic diagram of a first sub-segment of a different overlapping method provided in an embodiment of the present application;

[0049] Figure 7 is a schematic diagram of a candidate video segment fusion provided in an embodiment of the present application;

[0050] Figure 8 is a flow chart of a method for identifying video clips provided in an embodiment of the present application;

[0051] Fig. 9 is a flow chart of a fragment mining system provided by an embodiment of the present application;

[0052] Fig.10 This is a flow chart of a method for obtaining the opening and ending credits of a TV series provided in an embodiment of the present application;

[0053] Fig.11 is a schematic diagram of a storage method of a fragment database provided in an embodiment of the present application;

[0054] Fig.12 This is a flow chart of a method for obtaining the opening and ending credits of a TV series provided in an embodiment of the present application;

[0055] Fig.13 is a flow chart of a method for identifying infringing videos provided by an embodiment of the present application;

[0056] Fig.14 is a flow chart of a method for identifying video clips provided in an embodiment of the present application;

[0057] Fig.15 It is a schematic diagram of the structure of a video clip recognition device provided in an embodiment of the present application;

[0058] Fig.16 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0059] Fig.17 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0061] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity and execution order.

[0062] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0063] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0064] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge sub-models to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.

[0065] Hamming distance: It is used to measure the distance between binary features. It is achieved by counting the number of feature bits with different values ​​as the distance. For example, the Hamming distance between (1000) and (0011) is 3.

[0066] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0067] Figure 1 is a schematic diagram of an implementation environment of a video clip recognition method provided in an embodiment of the present application, see Figure 1 , the implementation environment may include a terminal 110 and a server 140.

[0068] The terminal 110 is connected to the server 140 via a wireless network or a wired network. Optionally, the terminal 110 is a vehicle-mounted terminal, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a smart TV, but is not limited thereto. The terminal 110 is installed and runs an application that supports video segment recognition.

[0069] The server 140 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The server 140 provides background services for the application running on the terminal 110.

[0070] The embodiment of the present application does not limit the number of terminals 110 and servers 140.

[0071] After introducing the implementation environment of the embodiment of the present application, the application scenario of the embodiment of the present application will be introduced in combination with the above-mentioned implementation environment. In the following description, the terminal is the terminal 110 in the above-mentioned implementation environment, and the server is the server 140 in the above-mentioned implementation environment.

[0072] The video clip recognition method provided in the embodiment of the present application can be applied to the scenario of identifying the opening and ending of a video, for example, it can be applied to the scenario of identifying the opening and ending of a TV series, or it can be applied to the scenario of identifying the opening and ending of a documentary, or it can be applied to the scenario of identifying the opening and ending of a short video collection, etc.

[0073] Taking the application of the video clip recognition method provided in the embodiment of the present application in the scenario of recognizing the title and ending of a TV series as an example, the technician selects a TV series that needs to be recognized by the title and ending through the terminal. The TV series includes multiple videos, and each video is an episode in the TV series. In the case of selecting the TV series through the terminal, the server can adopt the technical solution provided in the embodiment of the present application to process based on the multiple videos in the TV series to obtain the title and ending of the multiple videos. In the process of processing the multiple videos, the server determines multiple video frame pairs based on the video frame features of the first video and the video frame features of at least one second video. Each video frame pair includes a first video frame and a second video frame whose similarity meets the similarity condition. The first video frame belongs to the first video, and the second video frame belongs to the at least one second video. That is, each video frame pair includes a video frame in the first video and a video frame in the second video, and the first video and the at least one second video frame both belong to the multiple videos. The server fuses the first video frame in the multiple video frame pairs based on the appearance time difference of the multiple video frame pairs to obtain at least one candidate video segment in the first video. The appearance time difference refers to the difference between the appearance time of two video frames in the video frame pair in the video, that is, the difference between the appearance time of the first video frame in the first video and the appearance time of the second video frame in the second video. The server determines at least one target video segment in the first video based on at least one candidate video segment and a target time range. Since it is applied in the scenario of identifying the opening and ending of a TV series, the target time period is also the time period where the opening or ending is located, and the determined target video segment is also the opening or ending of the first video.

[0074] It should be noted that the above is described using the example of the method for identifying video clips provided in an embodiment of the present application in the scenario of identifying the opening and ending credits of a TV series. The implementation process of the above-mentioned other application scenarios belongs to the same inventive concept as the above description, and the implementation process will not be repeated here.

[0075] In addition, the video clip recognition method provided in the embodiment of the present application can be applied to the above-mentioned scenarios of identifying the opening and ending credits of TV series, identifying the opening and ending credits of documentaries, and identifying the opening and ending credits of short video collections. It can also be applied to the scenarios of identifying the opening and ending credits of other types of videos, and the embodiment of the present application is not limited to this.

[0076] After introducing the implementation environment and application scenarios of the embodiment of the present application, the following describes the video clip recognition method provided by the embodiment of the present application. Figure 2The technical solution provided in the embodiment of the present application can be executed by a terminal or a server, or can be executed by a terminal and a server together. In the embodiment of the present application, the execution subject is taken as an example to illustrate, and the method includes:

[0077] 201. The server determines a plurality of video frame pairs based on video frame features of a first video and video frame features of at least one second video, the video frame pairs comprising a first video frame and a second video frame whose similarity meets a similarity condition, the first video frame belonging to the first video, and the second video frame belonging to the at least one second video.

[0078] The first video and at least one second video belong to the same video set, for example, the first video and the second video are different episodes of the same TV series. The video frame feature is an embedded feature of the video frame, such as a deep hash feature. The similarity between the first video frame and the second video frame is determined by the video frame feature of the first video frame and the video frame feature of the second video frame. Each video frame pair includes a first video frame and a second video frame, and the similarity between the first video frame and the second video frame in the video frame pair meets the similarity condition, that is, the first video frame and the second video frame in the video frame pair are two video frames with higher similarity.

[0079] 202. The server fuses the first video frames in the multiple video frame pairs based on the appearance time difference of the multiple video frame pairs to obtain at least one candidate video segment in the first video, wherein the appearance time difference refers to the difference between the appearance times of two video frames in the video frame pair in the video.

[0080] The first video frame in the video frame pair is a video frame with a high similarity to the second video frame, and the candidate video segment is obtained by fusing the first video frames in multiple video frame pairs, so the candidate video segment is a video segment in the first video that has overlapping content with at least one second video. The appearance time difference can reflect the deviation of the appearance time of the first video frame and the second video frame in the first video and the second video.

[0081] 203. The server determines at least one target video segment in the first video based on the at least one candidate video segment and the target time range, where the target video segment is within the target time range of the first video.

[0082] Among them, the target time range refers to the time range in the video. The target time range is set by technical personnel according to actual conditions, and the embodiments of the present application do not limit this.

[0083] Through the technical solution provided in the embodiment of the present application, based on the similarity between the video frame features, a video frame pair containing similar video frames is determined. Based on the appearance time difference, the first video frame in the video frame pair is fused to obtain at least one candidate video segment. Finally, a target video segment in a target time range is determined from the at least one candidate video segment. The process of determining the target segment does not require human participation, and can be automatically performed by a computer device directly based on the first video and at least one second video, which is highly efficient.

[0084] The above steps 201-203 are a brief introduction to the video segment recognition method provided in the embodiment of the present application. The following will combine some examples to explain the video segment recognition method provided in the embodiment of the present application in more detail. Figure 3 The technical solution provided in the embodiment of the present application can be executed by a terminal or a server, or can be executed by a terminal and a server together. In the embodiment of the present application, the execution subject is taken as an example to illustrate, and the method includes:

[0085] 301. The server extracts features from a first video and at least one second video to obtain video frame features of the first video and video frame features of the at least one second video.

[0086] In a possible implementation, the server inputs the first video and at least one second video into a feature extraction model, performs feature extraction on the first video and the at least one second video through the feature extraction model, and obtains video frame features of the first video and video frame features of the at least one second video.

[0087] Among them, the server performs feature extraction on the first video and at least one second video through a feature extraction model, that is, the process of extracting features from the first video frame of the first video and the second video frame of the second video. In this case, the feature extraction model is an image feature extraction model.

[0088] In this embodiment, features of the first video and the at least one second video are extracted through a feature extraction model to obtain video frame features of the first video and video frame features of at least one second video, thereby achieving abstract expression of the first video and the at least one second video and improving subsequent computing efficiency.

[0089] In order to illustrate the above embodiment, the above embodiment is described below through three examples.

[0090] Example 1: The server inputs the first video and the at least one second video into a feature extraction model, and performs convolution and pooling on multiple first video frames and multiple second video frames through the feature extraction model to obtain video frame features of the multiple first video frames and video frame features of the multiple second video frames, wherein the multiple first video frames are video frames of the first video, and the multiple second video frames are video frames of at least one second video.

[0091] The following is an explanation of a method for extracting features from a first video by a server. The server inputs multiple first video frames of the first video into a feature extraction model, and convolves the multiple first video frames through the convolution layer of the feature extraction model to obtain feature maps of the multiple first video frames. The server performs either maximum pooling or average pooling on the feature maps of the multiple first video frames through the pooling layer of the feature extraction model to obtain video frame features of the multiple first video frames. In some embodiments, the server represents the first video frame in the form of a matrix and represents the video frame features in the form of a vector. In the process of convolving the first video frame, the convolution kernel is used to slide on the first video frame.

[0092] In some embodiments, the feature extraction model is a feature extractor based on a convolutional neural network (CNN), such as a neural network Resnet-101 (residual network 101) pre-trained on a large-scale open source dataset imagenet, and the structure of the neural network Resnet101 is shown in Table 1. The output result of the pooling layer of the neural network Resnet-101 is a video frame feature, where 101 refers to the number of layers of the model, and the video frame feature is a 1×2048 vector.

[0093] Table 1

[0094]

[0095]

[0096] Among them, Layer name is the name of each layer in the feature extraction model ResNet-101, Output size is the size of the output feature map, max pool refers to maximum value pooling, stride refers to the step size, blocks refers to the layer, a layer may include multiple convolution kernels, Conv refers to the convolution layer, Pool refers to the pooling layer, Class refers to the classification layer, and full connection refers to full connection. In the above process of extracting video frame features, the Class layer is not used.

[0097] It should be noted that the above description is based on the example of ResNet-101 as the feature extraction model. In other possible implementations, the feature extraction model may also be other structures, which is not limited in the embodiments of the present application.

[0098] In addition, the above feature extraction process is implemented based on convolution, and the obtained video frame features are used to express the characteristics of the image texture of the video frame. Such video frame features are also called the underlying features of the video frame. In other possible implementations, the feature extraction model can also extract semantic features of the video frame, and the obtained video frame features can reflect the semantics of the video frame. The following describes a method for the server to extract semantic features of the video frame through the feature extraction model.

[0099] Example 2: The server inputs the first video and the at least one second video into a feature extraction model, and encodes the multiple first video frames and the multiple second video frames based on the attention mechanism through the feature extraction model to obtain the video frame features of the multiple first video frames and the video frame features of the multiple second video frames, wherein the multiple first video frames are video frames of the first video, and the multiple second video frames are video frames of at least one second video, and the video frame features obtained by the feature extraction model are also the semantic features of the corresponding video frames. In this embodiment, the feature extraction model is a semantic feature encoder, such as a Transformer encoder.

[0100] The following is a method for extracting features from multiple first videos by a server. The server inputs multiple first video frames of the first video into a feature extraction model. Through the feature extraction model, the multiple first video frames are embedded and encoded to obtain multiple embedding vectors. One embedding vector corresponds to one first video frame. The embedding vector is used to represent the position of the first video frame in the first video and the content of the first video frame. The server inputs multiple embedding vectors into the feature extraction model. Through the three linear transformation matrices of the feature extraction model, the multiple embedding vectors are linearly transformed to obtain the query vector, key vector and value vector corresponding to each first video frame. The server obtains the attention weights of the multiple first video frames based on the query vectors and key vectors corresponding to the multiple first video frames through the feature extraction model. The server obtains the attention encoding vector of each first video frame based on the attention weight of each first video frame and the value vector of each first video frame through the feature extraction model. The attention encoding vector is also the video frame feature of the first video frame.

[0101] For example, the server uses a feature extraction model to multiply each embedding vector by three linear transformation matrices to obtain a query vector, a key vector, and a value vector corresponding to each first video frame. For the first first video frame among multiple first video frames, the server uses a feature extraction model to determine multiple attention weights between multiple first video frames and the first first video frame based on the query vector of the first first video frame and the key vectors of the multiple first video frames. For the first first video frame among multiple first video frames, the server uses a feature extraction model to weightedly sum the attention weights of the multiple first video frames to the first first video frame and the value vectors of the multiple first video frames to obtain an attention encoding vector of the first first video frame, which is the video frame feature of the first first video frame.

[0102] The above Examples 1 and 2 are respectively described using the feature extraction model to extract the underlying features and semantic features of the video frame. In other possible implementations, the server can also simultaneously obtain the underlying features and semantic features of the video frame through the feature extraction model, which is illustrated in Example 3 below.

[0103] Example 3: The server inputs the first video and the at least one second video into a feature extraction model, and performs convolution and pooling on the multiple first video frames and the multiple second video frames through the feature extraction model to obtain the underlying features of the multiple first video frames and the underlying features of the multiple second video frames, wherein the multiple first video frames are video frames of the first video, and the multiple second video frames are video frames of at least one second video. The server encodes the multiple first video frames and the multiple second video frames based on the attention mechanism through the feature extraction model to obtain the semantic features of the multiple first video frames and the semantic features of the multiple second video frames. The server fuses the underlying features and semantic features of each first video frame to obtain the video frame features of each first video frame. The server fuses the underlying features and semantic features of each second video frame to obtain the video frame features of each second video frame.

[0104] For example, the feature extraction model includes a first sub-model and a second sub-model, the first sub-model is used to extract the underlying features of the video frame, and the second sub-model is used to extract the semantic features of the video frame. After the server inputs the first video and the at least one second video into the feature extraction model, the underlying features of the multiple first video frames and the underlying features of the multiple second video frames are obtained through the first sub-model, and the semantic features of the multiple first video frames and the semantic features of the multiple second video frames are obtained through the second sub-model. When the server fuses the underlying features and semantic features of each video frame, a weighted summation method can be adopted. The weight of the weighted summation is set by the technician according to the actual situation, such as being set to 0.5, and the embodiment of the present application does not limit this. The method for the server to obtain the underlying features and semantic features of the video frame through the first sub-model and the second sub-model is the same as that of Examples 1 and 2 above, and the implementation process is not repeated here.

[0105] It should be noted that the above is explained using the feature extraction model to extract the underlying features and semantic features of the video frame as an example. With the development of science and technology, the server can also use feature extraction models with other structures to obtain video frame features, and the embodiments of the present application do not limit this.

[0106] In some embodiments, the first video and at least one second video are videos belonging to the same video set, wherein the first video is a video of a target video segment to be determined, and the at least one second video is all videos in the video set except the first video, or the at least one second video is a video extracted from the video set, and the first video is shielded during extraction. In the case where the at least one second video is a video extracted from the video set, the server randomly extracts a target number of second videos from the video set, and during the extraction process, the first video is shielded, that is, the target number of second videos extracted does not include the first video, and the target number of videos is set by the technician according to the actual situation, and the embodiments of the present application do not limit this. The server groups the first video and the at least one second video into at least one video pair, each video pair including the first video and one second video in the at least one second video.

[0107] For example, when the video set includes 46 videos, for each first video i, the server randomly selects 10 second videos r from the remaining videos of the video set, and groups the first video i and the 10 second videos r into 10 video pairs respectively. In the subsequent processing, the processing is carried out in units of video pairs, where 10 is the target number of videos.

[0108] In addition, in some embodiments, before the server extracts features from the first video and the at least one second video, it extracts frames from the first video and the at least one second video to obtain multiple first video frames of the first video and multiple second video frames of each second video. By extracting frames from the video, the amount of computation in the subsequent feature extraction process can be reduced, and the efficiency of feature extraction can be improved.

[0109] Taking the first video as an example, the server extracts frames from the first video at a target interval to obtain multiple first video frames of the first video, wherein the target interval refers to the target playback duration of the first video, such as 1s, or the target interval refers to a target number of frame intervals, such as 25 frames. When the target interval refers to the target playback duration of the first video, the server extracts one frame from the first video as the first video frame for every target playback duration. When the first video is 6s and the target playback duration is 1s, the server extracts 6 first video frames from the first video. When the target time interval refers to a target number of frame intervals, the server extracts from the first video for every target number of video frames to obtain multiple first video frames. When the first video includes 100 video frames and the target number is 10, the server extracts 10 first video frames from the first video. For example, see Figure 4 The server extracts frames from the first video 400 at a target interval to obtain a plurality of first video frames 401 of the first video. The server inputs the plurality of first video frames 401 of the first video into a feature extraction model 402, and outputs video frame features 403 of the plurality of first video frames 401 through the feature extraction model 402.

[0110] It should be noted that the above step 301 is an optional step, which can be executed by the server in advance or when the server executes the technical solution provided in the embodiment of the present application. The embodiment of the present application does not limit this.

[0111] 302. The server determines a plurality of video frame pairs based on video frame features of the first video and video frame features of at least one second video, the video frame pairs comprising a first video frame and a second video frame whose similarity meets a similarity condition, the first video frame belonging to the first video, and the second video frame belonging to the at least one second video.

[0112] In a possible implementation, the server determines the similarity between the video frame features of the plurality of first video frames and the video frame features of the plurality of second video frames. The server determines the first video frames and the second video frames whose similarities meet the target condition as a video frame pair, each video frame pair including a first video frame and a second video frame.

[0113] The similarity between the video frame features is measured by Euclidean distance or cosine similarity, which is not limited in the embodiments of the present application.

[0114] Under this implementation, the server can determine multiple video frame pairs based on the similarity between the first video frame and the second video frame. Since the video frames in the video frame pairs are video frames with higher similarity in different videos, similar video segments can be quickly determined based on the video frame pairs, and thus the target video segment can be ultimately determined, which is more efficient.

[0115] When the similarity is the Euclidean distance, the server determines the Euclidean distance between the video frame features of multiple first video frames and the video frame features of multiple second video frames. The server determines the first video frame and the second video frame whose Euclidean distance is less than or equal to the distance threshold as a video frame pair. Among them, the distance threshold is set by the technician according to the actual situation, and the embodiment of the present application does not limit this. When the distance threshold is 0.5, when the Euclidean distance between the video frame feature of any first video frame and the video frame feature of any second video frame is less than or equal to 0.5, the server determines the first video frame and the second video frame as a video frame pair.

[0116] When the similarity is cosine similarity, the server determines the cosine similarity between the video frame features of the plurality of first video frames and the video frame features of the plurality of second video frames. The server determines the first video frame and the second video frame whose cosine similarity is greater than or equal to the similarity threshold as a video frame pair. When the similarity threshold is 0.8, when the cosine similarity between the video frame features of any first video frame and the video frame features of any second video frame is greater than or equal to 0.8, the server determines the first video frame and the second video frame as a video frame pair.

[0117] In some embodiments, when the server groups a first video and at least one second video into at least one video pair, the server determines the similarity between the video frame features of the first video and the video frame features of the second video in the video pair in units of video pairs, thereby determining multiple video frame pairs under the video pair. For example, for the video pair (i, r), the server determines the similarity between the video frame features of the first video i and the video frame features of the second video r. The server determines the first video frame and the second video frame whose similarity meets the target condition as a video frame pair. That is, for each video frame j in the first video i, the Euclidean distance between the video frame features of the first video frame j and each second video frame in the second video r is determined. The server determines the Euclidean distance less than t 0The second video frame of j is used as a similar frame of the first video frame j, and the first video frame j and the similar frame form a video frame pair. The server stores the acquired similar frames of the first video frame j in a first list, which is also called a similar frame list (sim-id-list). In some embodiments, the server stores the identifier of the frame in the first list, and the identifier of the frame is used to indicate the video to which the frame belongs and the position of the frame in the video. For example, for the first video frame with j=1, the similar frame list sim-id-list is [1, 2, 3], indicating that the video frames corresponding to the 1st, 2nd, and 3rd seconds of the second video r are similar frames, wherein j=1 represents the video frame corresponding to the 1st second in the first video.

[0118] Optionally, after step 302, when the determined number of video frame pairs is 0, the server determines that there is no target video segment in the first video.

[0119] 303. The server determines appearance time differences of multiple video frame pairs.

[0120] In a possible implementation, the server subtracts the appearance time of the first video frame in the multiple video frame pairs in the first video from the appearance time of the second video frame in the video frame pair in the second video to obtain the appearance time difference of the multiple video frame pairs. In some embodiments, the server stores the appearance time difference of the multiple video frame pairs in a second list, which is also called the appearance time difference list (diff-time-list). In subsequent processing, the corresponding appearance time difference can be directly called from the second list. For example, for the first video frame with j=1, the similar frame list sim-id-list is [1, 2, 3], then the corresponding appearance time difference list diff-time-list is [0, 1, 2].

[0121] 304. The server divides the multiple video frame pairs into multiple video frame groups based on the appearance time differences of the multiple video frame pairs, and the video frame pairs in the same video frame group correspond to the same appearance time difference, which refers to the difference between the appearance times of two video frames in the video frame pair in the video.

[0122] In a possible implementation, the server divides video frame pairs with the same appearance time difference into an initial video frame group. The server merges the multiple initial video frame groups based on the appearance time differences corresponding to the multiple initial video frame groups to obtain the multiple video frame groups.

[0123] The initial video frame group includes multiple video frame pairs with the same appearance time difference, and different initial video frame groups correspond to different appearance time differences, wherein the appearance time difference corresponding to the initial video frame group refers to the appearance time difference of the video frame pairs in the initial video frame group.

[0124] In this implementation, video frames in a video frame pair with the same time difference may constitute a complete video segment. By aggregating the video frame pairs into video frame groups, it is convenient to subsequently determine similar video segments.

[0125] For example, the server sorts the multiple initial video frame groups according to the target order to obtain multiple candidate video frame groups. When the matching time difference between any two adjacent candidate video frame groups in the multiple candidate video frame groups meets the matching time difference condition, the server merges the two adjacent candidate video frame groups into one video frame group, and the matching time difference refers to the difference between the corresponding appearance time differences of the two adjacent candidate video frame groups.

[0126] In order to more clearly illustrate the technical process described in the above example, the above example will be further explained in two parts below.

[0127] In the first part, the server sorts the multiple initial video frame groups according to a target order to obtain multiple candidate video frame groups.

[0128] In a possible implementation, the server sorts the multiple initial video frame groups according to the order of the corresponding occurrence time difference from small to large to obtain multiple candidate video frame groups. In this case, the target order refers to the order of the occurrence time difference from large to small. In some embodiments, in any initial video frame group, the server sorts according to the order of the occurrence time of the first video frame in the first video frame in the video frame pair.

[0129] In this implementation, the server sorts the multiple initial video frame groups in descending order, and among the multiple candidate video frame groups obtained, the appearance time difference values ​​corresponding to any two candidate video frame groups are relatively close, which is convenient for the subsequent fusion process.

[0130] For example, a plurality of initial video frame groups are [3, 5], [11, 12], [2, 4], [4, 6], [6, 9], [7, 10], [10, 11], wherein each bracket represents a video frame pair [i, r], the first number in the bracket is the identifier of the first video frame i, the second number is the identifier of the second video frame r, and the identifier is the appearance time of the video frame in the video. For the video frame pair [3, 5], the appearance time difference is 5-3=2, and for the video frame pair [6, 9], the appearance time difference is 9-6=3. The server sorts the plurality of initial video frame groups in the order of the corresponding appearance time difference from small to large, and obtains a plurality of candidate video frame groups [10, 11], [11, 12], [2, 4], [3, 5], [4, 6], [6, 9], [7, 10].

[0131] In a possible implementation, the server sorts the multiple initial video frame groups according to the order of the corresponding appearance time difference from small to large to obtain multiple candidate video frame groups. In this case, the target order refers to the order of the appearance time difference from small to large. In some embodiments, in any initial video frame group, the server sorts according to the order of the appearance time of the first video frame in the first video frame in the video frame pair.

[0132] In this implementation, the server sorts the multiple initial video frame groups in ascending order, and among the multiple candidate video frame groups obtained, the appearance time difference values ​​corresponding to any two candidate video frame groups are relatively close, which is convenient for the subsequent fusion process.

[0133] In some embodiments, when the first list is used to store video frame pairs and the second list is used to store occurrence differences, the server generates a third list based on the first list and the second list, and the third list is used to store video frame pairs and occurrence differences. The third list can store multiple initial video frame groups. For example, the third list is in the form of a third list (match-dt-list): {d: {count, start-id, match-id-list}, ...}, where d is the occurrence time difference, d: {count, start-id, match-id-list} represents the initial video frame group with an occurrence time difference of d, count is the number of video frame pairs in the initial video frame group, start-id is the minimum identifier of the first video frame, and match-id-list is the video frame pair.

[0134] In the second part, when the matching time difference between any two adjacent candidate video frame groups in the multiple candidate video frame groups meets the matching time difference condition, the server merges the two adjacent candidate video frame groups into one video frame group.

[0135] In a possible implementation, the two adjacent candidate video frame groups include a first candidate video frame group and a second candidate video frame group, and when a matching time difference between an appearance time difference corresponding to the first candidate video frame group and an appearance time difference corresponding to the second candidate video frame group is less than or equal to a matching difference threshold, the server adds the video frame pairs in the first candidate video frame group to the second candidate video frame group to obtain the video frame group.

[0136] Wherein, the fusion of the multiple candidate video frame groups into multiple video frame groups includes multiple iterative processes. After the first candidate video frame group and the second candidate video frame group are fused into one video frame group, the server can also determine the matching time difference between the newly fused video frame group and the next candidate video frame group. When the matching time difference meets the matching time difference condition, the newly fused video frame group is once again fused with the next candidate video frame group. The fusion process and the process of fusing the first candidate video frame group and the second candidate video frame group belong to the same inventive concept, and the implementation process is not repeated. Of course, when the matching time difference does not meet the matching time difference condition, the server determines the matching time difference between the next candidate video frame group and the next two candidate video frame groups, so as to further process based on the matching time difference. The matching difference threshold is set by the technician according to the actual situation, and the embodiment of the present application does not limit this.

[0137] In this implementation, by fusing candidate video frame groups based on the occurrence time difference, the number of candidate video frame groups can be reduced, thereby reducing the amount of computation required for subsequent processing and improving computational efficiency.

[0138] For example, the server determines a matching time difference between the first candidate video frame group and the second candidate video frame group. When the matching time difference is less than or equal to a matching difference threshold, the server replaces the target second video frame with a reference second video frame based on the appearance time difference corresponding to the second candidate video frame group to obtain the video frame group, wherein the target second video frame is a second video frame newly added to the second candidate video frame group, the reference second video frame is a second video frame in the second video whose appearance time difference with the target first video frame is the appearance time difference corresponding to the second candidate video frame group, and the target first video frame is the first video frame in the video frame pair to which the target second video frame belongs.

[0139] Under this embodiment, after adding the video frame pairs in the first candidate video frame group to the second candidate video frame group, the server can also adjust the video frame pairs newly added to the second candidate video frame group according to the appearance time difference of the second candidate video frame group, so that the appearance time difference of the adjusted video frame pairs is the same as that of the second candidate video frame group, maintaining consistency between the appearance difference of the video frame pairs and the appearance difference of the video frame groups.

[0140] For a clearer explanation, the following example is taken as follows: the appearance time difference corresponding to the first candidate video frame group is 3, including two video frame pairs [6, 9] and [7, 10], the appearance time difference corresponding to the second candidate video frame group is 2, including three video frame pairs [2, 4], [3, 5] and [4, 6], and the matching difference threshold is 3. Since the matching time difference between the first candidate video frame group and the second candidate video frame group is 1, the server determines that the matching time difference is less than the matching difference threshold, and the first candidate video frame group and the second candidate video frame group need to be merged. The server adds the two video frame pairs [6, 9] and [7, 10] in the first candidate video frame group to the second candidate video frame group, and the second candidate video frame group becomes [2, 4], [3, 5], [4, 6], [6, 9], [7, 10]. Since the appearance time difference corresponding to the second candidate video frame group is 2, the server adjusts the second video frame added to the two video frame pairs [6, 9] and [7, 10] in the second candidate video frame group based on the appearance time difference 2, and obtains two new video frame pairs [6, 8] and [7, 9]. After adjusting the second video frame newly added to the second candidate video frame group, the second candidate video frame group becomes [2, 4], [3, 5], [4, 6], [6, 8], [7, 9], and the appearance time difference of each video frame pair is 2.

[0141] It should be noted that the above is explained using the example of the server adding the video frame pairs in the first candidate video frame group to the second candidate video frame group. In other possible implementations, the server can also add the video frame pairs in the second candidate video frame to the first candidate video frame group.

[0142] In some embodiments, the server determines whether to add the video frame pairs in the first candidate video frame group to the second candidate video frame group or to add the video frame pairs in the second candidate video frame group to the first candidate video frame group based on the number of video frame pairs in the first candidate video frame group and the second candidate video frame group. For example, when the number of video frame pairs in the first candidate video frame group is greater than the number of video frame pairs in the second candidate video frame group, the server adds the video frame pairs in the second candidate video frame group to the first candidate video frame group. When the number of video frame pairs in the second candidate video frame group is greater than the number of video frame pairs in the first candidate video frame group, the server adds the video frame pairs in the first candidate video frame group to the second candidate video frame group. When the number of video frame pairs in the second candidate video frame group is equal to the number of video frame pairs in the first candidate video frame group, the server adds the video frame pairs in the first candidate video frame group to the second candidate video frame group. Or, when the number of video frame pairs in the second candidate video frame group is equal to the number of video frame pairs in the first candidate video frame group, the server adds the video frame pairs in the second candidate video frame group to the first candidate video frame group.

[0143] In this case, the server can determine the method of merging candidate video frame groups according to the number of video frame pairs in the candidate video frame groups, and add candidate video frame groups including fewer video frames to video frame groups including more video frames to reduce the amount of calculation and improve efficiency.

[0144] 305. For any video frame group in the multiple video frame groups, the server merges the first video frame of the video frame pair in the video frame group into a candidate video segment according to the appearance time of the first video frame of the video frame pair in the video frame group in the first video.

[0145] In a possible implementation, the server compares the appearance time of the first video frames of any two adjacent video frame pairs in the video frame group in the first video. When the difference between the appearance time of the first video frames of the two adjacent video frame pairs in the first video meets the appearance time condition, the server adds the two adjacent video frame pairs to the temporary frame list. When the difference between the appearance time of the first video frames of the two adjacent video frame pairs in the first video does not meet the appearance time condition, the server merges the video frame pairs in the temporary frame list into a reference video segment. The server determines the at least one candidate video segment based on multiple reference video segments.

[0146] The temporary frame list is used to store video frame pairs whose difference between appearance times meets the appearance time condition. In some embodiments, the difference between appearance times meets the appearance time condition means that the difference between appearance times is less than or equal to the appearance time difference threshold, and the appearance time difference threshold is set by technicians according to actual conditions, such as being set to 8s, and the embodiments of the present application do not limit this.

[0147] In order to explain the above implementation more clearly, the above implementation will be explained in four parts below.

[0148] In the first part, the server compares the appearance time of the first video frame of any two adjacent video frame pairs in the video frame group in the first video.

[0149] In some embodiments, the server uses the appearance time of the first video frame in the first video as the identifier of the first video frame, and uses the appearance time of the second video frame in the second video as the identifier of the second video frame. In this case, when the server compares the appearance time of the first video frames of any two adjacent video frame pairs in the first video, it can compare the identifiers of the two first video frames. For example, the video frame group includes video frame pairs [2, 4], [3, 5], [4, 6], [6, 8], [7, 9], and the server compares the appearance time of the first video frames of the video frame pairs in the first video in sequence. In the first comparison process, the server compares the appearance time of the first video frame 2 of the first video frame pair [2, 4] with the first video frame 3 of the second video frame pair [3, 5] in the first video.

[0150] In the second part, when the difference between the appearance times of the first video frames of the two adjacent video frame pairs in the first video meets the appearance time condition, the server adds the two adjacent video frame pairs to the temporary frame list.

[0151] In a possible implementation, when the difference between the appearance times of the first video frames of the two adjacent video frame pairs in the first video is less than or equal to the appearance time difference threshold, the server adds the two adjacent video frame pairs to the temporary frame list. For example, still taking the video frame pairs [2, 4], [3, 5], [4, 6], [6, 8], [7, 9] of the video frame group as an example, for the video frame pairs [2, 4] and [3, 5], when the appearance time difference threshold is 3, since the appearance time difference of the first video frames in [2, 4] and [3, 5] in the first video is 3-2=1, the server adds the two video frame pairs to the temporary frame list (Tmplist), Tmplist=[[2, 4], [3, 5]].

[0152] The server determines that adding a video frame pair to the temporary frame list includes multiple iterations. In any iteration, the server compares the appearance time difference between the first video frame of the current video frame pair and the first video frame of the previous video frame pair in the first video, where the current video frame pair refers to the video frame pair currently being processed, and the previous video frame pair refers to the video frame pair processed in the previous iteration. For example, after the server adds the video frame pairs [2, 4] and [3, 5] to the temporary frame list, it further determines the relationship between the appearance time difference of the first video frames of the video frame pairs [3, 5] and [4, 6] in the first video and the appearance time difference threshold. Since the appearance time difference of the first video frames in [3, 5] and [4, 6] in the first video is 4-3=1, the server adds the video frame pair [4, 6] to the temporary frame list (Tmplist), Tmplist=[[2, 4], [3, 5], [4, 6]]. Through multiple iterative processes, a temporary frame list Tmplist = [[2, 4], [3, 5], [4, 6], [6, 8], [7, 9]] is obtained.

[0153] Part three: When the difference between the appearance times of the first video frames of the two adjacent video frame pairs in the first video does not meet the appearance time condition, the server merges the video frame pairs in the temporary frame list into a reference video segment.

[0154] The reference video segment includes a first sub-segment and a second sub-segment, the first sub-segment is composed of a first video frame in a video frame pair, and the second sub-segment is composed of a second video frame in the video frame pair.

[0155] In a possible implementation, when the difference between the appearance times of the first video frames of the two adjacent video frame pairs in the first video is greater than the appearance time difference threshold, the server merges the first video frame in the temporary frame list into a first sub-segment, and merges the second video frame in the temporary frame list into a second sub-segment, and the first sub-segment and the second sub-segment constitute the reference video segment. Since the first video frame and the second video frame in the video frame pair are video frames with high similarity, the first sub-segment and the second sub-segment are also segments with high similarity. For example, see Figure 5 , shows the form of a first sub-segment 501 and a second sub-segment 502, the first video frame at the beginning of the first sub-segment 501 and the first video frame at the beginning of the second sub-segment 502 constitute a video frame pair, and the first video frame at the end of the first sub-segment 501 and the first video frame at the end of the second sub-segment 502 constitute another video frame pair. In some embodiments, the first sub-segment and the second sub-segment in a reference video segment are also referred to as matching segments.

[0156] For example, the two adjacent video frame pairs are [9, 11] and [2, 4], and the difference between the appearance times of the first video frames of the two video frame pairs in the first video is 9-2=7, then the server merges the first video frames in the temporary frame list into a reference video segment. For example, if the temporary frame list Tmplist = [[2, 4], [3, 5], [4, 6], [6, 8], [7, 9]], then the server merges the first video frame [2,], [3,], [4,], [6,], [7,] in the temporary frame list into the first sub-segment (2, 7), and merges the second video frame [, 4], [, 5], [, 6], [, 8], [, 9] in the temporary frame list into the second sub-segment (4, 9). The first sub-segment (2, 7) and the second sub-segment (4, 9) constitute the reference video segment (2, 7, 4, 9), where the format of the reference video segment is (src-startTime, src-endTime, ref-startTime, ref-endTime), where src-startTime refers to the beginning of the first sub-segment, that is, the first video frame with the smallest sequence number in the temporary frame list, src-endTime refers to the end of the first sub-segment, that is, the first video frame with the largest sequence number in the temporary frame list, ref-startTime refers to the beginning of the second sub-segment, that is, the second video frame with the smallest sequence number in the temporary frame list, ref-endTime refers to the end of the second sub-segment, that is, the second video frame with the largest sequence number in the temporary frame list, and the sequence number refers to the identifier of the video frame, indicating the position of the video frame in the video. The smaller the sequence number, the closer the position of the video frame in the video is, and the smaller the sequence number, the closer the position of the video frame in the video is. In some embodiments, the server stores the reference video segment in the matching segment list match-duration-list. Since all video frames of the first video and the second video are traversed when determining the video frame pair, it may be that a certain video frame is similar to multiple video frames, so that the time of two reference video segments in match-duration-list overlaps.

[0157] In some embodiments, the reference video segment can also carry information such as the appearance time difference corresponding to the first sub-segment, the duration of the first sub-segment, and the number of video frames included in the first sub-segment, so as to facilitate server calls.

[0158] In addition, in addition to the method provided in the third part above, the embodiment of the present application provides another method for triggering the fusion of video frame pairs in the temporary frame list into reference video segments.

[0159] In a possible implementation, when the currently processed video frame pair is the last video frame pair in the video frame group, the server adds the video frame pair to the temporary frame list, and fuses the video frame pairs in the temporary frame list into a reference video frame segment. For example, the video frame group includes five video frame pairs [2, 4], [3, 5], [4, 6], [6, 8], and [7, 9]. When the server processes the video frame pair [7, 9], since the video frame pair [7, 9] is the last video frame pair in the video frame group, the server adds the video frame pair [7, 9] to the temporary frame list, and fuses the video frame pairs in the temporary frame list into a reference video segment. The fusion process is described in the previous implementation, and will not be repeated here.

[0160] Part 4: The server determines the at least one candidate video segment based on multiple reference video segments.

[0161] Among them, the multiple reference video clips include a first overlapping video clip and / or a second overlapping video clip, the first overlapping video clip refers to a reference video clip belonging to a first reference video clip among the multiple reference video clips, and the second overlapping video clip refers to a reference video clip that partially overlaps with a second reference video clip among the multiple reference video clips.

[0162] The first overlapping video segment belongs to the first reference video segment, which means that the content of the first overlapping video segment is completely included in the first reference video segment, or the first reference video segment completely includes the first overlapping video segment.

[0163] In order to explain the content of the fourth part more clearly, the method for the server to determine the first overlapping video segment from multiple reference video segments is explained below.

[0164] In a possible implementation, the server determines the first overlapping video segment from the multiple reference video segments based on the appearance time of the first sub-segment in the first video in the multiple reference video segments.

[0165] The first sub-segment is a video segment formed by the first video frame, and the appearance time includes the start time and the end time of the first sub-segment in the first video.

[0166] For example, for a reference video segment A among the multiple reference video segments 1 and reference video clip B 1 , the server compares the reference video segment A 1 The appearance time of the first sub-segment in the first video and the reference video segment B 1 The appearance time of the first sub-segment in the first video, in the reference video segment B 1The appearance time of the first sub-segment in the first video is the reference video segment A 1 In the case of a subset of the appearance time of the first sub-segment in the first video, the reference video segment B is determined 1 is the first overlapping video segment. For example, see Figure 6 The multiple reference video segments include reference video segment A 1 and reference video clip B 1 , the server compares the reference video segment A 1 The first sub-segment m 1 The appearance time in the first video and the reference video segment B 1 The first sub-fragment n 1 The appearance time in the first video. 1 The start time of the first sub-segment m 1 After that, the first sub-segment n 1 The end time of the first sub-segment m 1 In the previous case, the server will use the reference video segment B 1 Determined as the first overlapping video segment, the reference video segment A 1 That is the first reference video clip mentioned above.

[0167] After describing the method for the server to determine the first overlapping video segment from multiple reference video segments, the method for the server to determine the second overlapping video segment from multiple reference video segments is described below.

[0168] In a possible implementation, the server determines the second overlapping video segment from the multiple reference video segments based on the appearance time of the first sub-segment in the first video in the multiple reference video segments.

[0169] For example, for a reference video segment A among the multiple reference video segments 2 and reference video clip B 2 , the server compares the reference video segment A 2 The appearance time of the first sub-segment in the first video and the reference video segment B 2 In the case where the appearance time of the first sub-segment of the reference video segment B in the first video and the appearance time of the first sub-segment of the reference video segment A in the first video overlap, the reference video segment A and the reference video segment B with the shorter duration are determined as the second overlapping video segment. Figure 6 The multiple reference video segments include reference video segment A 2 and reference video clip B 2 , the server compares the reference video segment A2 The first sub-segment m 2 The appearance time in the first video and the reference video segment B 2 The first sub-fragment n 2 The appearance time in the first video. 2 The start time of the first sub-segment m 2 After the start time and before the end time of 2 The end time of the first sub-segment m 2 Afterwards, or the first sub-segment n 2 The start time of the first sub-segment m 2 Before, and the first sub-segment n 2 The end time of the first sub-segment m 2 Before the end time and after the start time, refer to video segment B 2 The duration is shorter than the reference video segment A 2 In the case of 2 Determined as the second overlapping video segment, the reference video segment A 2 That is the second reference video clip mentioned above.

[0170] After introducing the method for the server to determine the first overlapping video segment and the second overlapping video segment, the steps provided in the fourth part above are described below.

[0171] In a possible implementation, when the multiple reference video segments include the first overlapping video segment, the server deletes the first overlapping video segment to obtain the at least one candidate video segment.

[0172] In this implementation, the server can delete repeated first overlapping video segments from multiple reference video segments to reduce the number of obtained candidate video segments, reduce the amount of calculation, and improve calculation efficiency.

[0173] In a possible implementation, when the multiple reference video segments include the second overlapping video segment, the server deletes the overlapping portion between the second overlapping video segment and the second reference segment to obtain the at least one candidate video segment.

[0174] Based on the above implementation, optionally, the server can also perform the following steps:

[0175] In some embodiments, after deleting the overlapping portion between the second overlapping video segment and the second reference segment, the server compares the duration of the third-category reference video segment with the target duration, and the third-category reference video segment refers to the second overlapping video segment with the overlapping portion deleted. If the duration of the third-category reference video segment is greater than or equal to the target duration, the server retains the third-category reference video segment. If the duration of the third-category reference video segment is less than the target duration, the server deletes the third-category reference video segment.

[0176] The target duration is set by the technician according to the actual situation, and the embodiment of the present application does not limit this. When the server retains the third type of reference video clip, the third type of reference video clip is used to replace the original second overlapping video clip.

[0177] The above implementation is described below through two examples:

[0178] Example 1: For a reference video segment A among the multiple reference video segments 2 and reference video clip B 2 , in this reference video segment A 2 The first sub-segment m 2 and the reference video clip B 2 The first sub-fragment n 2 There is partial overlap, and the first sub-segment m 2 The start time is earlier than the first sub-segment n 2 In the case of 2 The start time is moved to the first sub-segment m 2 The end time of the sub-segment l 1 , the sub-fragment l 1 is the first sub-segment of the third type of reference video segment. 1 If the duration of the sub-segment is less than or equal to the target duration, the server deletes the sub-segment l 1 , and delete the sub-segment l 1 The third type of reference video segment belongs to. In this sub-segment l 1 If the duration of the sub-segment is greater than the target duration, the server retains the sub-segment l 1 , while retaining the sub-fragment l 1 The third category of reference video clips.

[0179] Example 2: For reference video segment A among the multiple reference video segments 2 and reference video clip B 2 , in this reference video segment A 2 The first sub-segment m 2 and the reference video clip B2 The first sub-fragment n 2 There is partial overlap, and the first sub-segment n 2 The start time is earlier than the first sub-segment m 2 In the case of 2 The end time of the first sub-segment m is moved to 2 The start time of the sub-segment l 2 , the sub-fragment l 2 is the first sub-segment of the third type of reference video segment. 2 If the duration of the sub-segment is less than or equal to the target duration, the server deletes the sub-segment l 2 , and delete the sub-segment l 2 The third type of reference video segment belongs to. In this sub-segment l 2 If the duration of the sub-segment is greater than the target duration, the server retains the sub-segment l 2 , while retaining the sub-fragment l 2 The third category of reference video clips.

[0180] 306. The server determines the at least one target candidate video segment based on the at least one candidate video segment, and the number of occurrences of the target candidate video segment in the at least one candidate video segment meets a number condition.

[0181] In a possible implementation, the server determines at least one reference candidate video segment based on the at least one candidate video segment. The server determines the number of occurrences of each reference candidate video segment in the at least one reference candidate video segment. The server determines the reference candidate video segment whose number of occurrences meets the number of occurrences condition as the target candidate video segment.

[0182] The number of occurrences of the reference candidate video segment in the at least one reference candidate video segment refers to the number of the reference candidate video segment in the at least one reference candidate video segment. For example, if the at least one reference candidate video segment is 1, 2, 3, 1, 4, 5, then for reference candidate video segment 1, the number of occurrences is 2.

[0183] In order to illustrate the above implementation, the above implementation will be described in three parts below.

[0184] In the first part, the server determines at least one reference candidate video segment based on the at least one candidate video segment.

[0185] Among them, the at least one candidate video segment includes a third overlapping video segment and / or a fourth overlapping video segment, the third overlapping video segment refers to a candidate video segment belonging to the first candidate video segment in the at least one candidate video segment, and the fourth overlapping video segment refers to a candidate video segment that partially overlaps with the second candidate video segment in the at least one candidate video segment.

[0186] In order to explain the content of the first part more clearly, the method for the server to determine the third overlapping video segment from at least one candidate video segment is explained below.

[0187] In a possible implementation, the server determines the third overlapping video segment from the at least one candidate video segment based on the appearance time of the first sub-segment in the at least one candidate video segment in the first video.

[0188] The candidate video segment includes a first sub-segment and a second sub-segment, the first sub-segment is composed of a first video frame in a video frame pair, and the second sub-segment is composed of a second video frame in the video frame pair.

[0189] For example, the at least one candidate video segment is two candidate video segments. For candidate video segment C in the at least one candidate video segment, 1 and candidate video segments D 1 , the server compares the candidate video segment C 1 The appearance time of the first sub-segment in the first video and the candidate video segment D 1 The appearance time of the first sub-segment in the first video, in the candidate video segment D 1 The appearance time of the first sub-segment of the candidate video segment C in the first video is 1 In the case of a subset of the appearance time of the first sub-segment in the first video, the candidate video segment D is determined. 1 This is the third overlapping video clip.

[0190] For example, the at least one candidate video segment is two candidate video segments, including candidate video segments C and C. 1 and candidate video segments D 1 , the server compares the candidate video segment C 1 The first sub-fragment o 1 The appearance time in the first video and the candidate video segment D 1 The first sub-fragment p 1 The appearance time in the first video. 1 The start time is in the first sub-segment o 1 After that, and the first sub-segment p 1 The end time of the first sub-segment o1 In the previous case, the server will take the candidate video segment D 1 Determined as the third overlapping video segment, the candidate video segment C 1 That is the first candidate video segment mentioned above.

[0191] After describing the method for the server to determine the third overlapping video segment from at least one candidate video segment, the method for the server to determine the fourth overlapping video segment from at least one candidate video segment is described below.

[0192] In a possible implementation, the server determines the fourth overlapping video segment from the at least one candidate video segment based on the appearance time of the first sub-segment in the at least one candidate video segment in the first video.

[0193] For example, the at least one candidate video segment is two candidate video segments. For candidate video segment C in the at least one candidate video segment, 2 and candidate video segments D 2 , the server compares the candidate video segment C 2 The appearance time of the first sub-segment in the first video and the candidate video segment D 2 The appearance time of the first sub-segment in the first video, in the candidate video segment D 2 The appearance time of the first sub-segment in the first video is the same as that of the candidate video segment C 2 If the appearance time of the first sub-segment of the candidate video segment C in the first video has an intersection, 2 and candidate video segments D 2 The candidate video segment with a shorter duration is determined as the fourth overlapping video segment.

[0194] For example, the at least one candidate video segment is two candidate video segments, including candidate video segments C and C. 2 and candidate video segments D 2 , the server compares the candidate video segment C 2 The first sub-fragment o 2 The appearance time in the first video and the candidate video segment D 2 The first sub-fragment p 2 The appearance time in the first video. 2 The start time is in the first sub-segment o 2 After the start time and before the end time of the first sub-segment p 2 The end time of the first sub-segment o 2 Afterwards, or the first sub-segment p 2 The start time is in the first sub-segment o 2Before, and the first sub-segment p 2 The end time of the first sub-segment o 2 Before the end time and after the start time, candidate video segment D 2 The duration of the candidate video segment C is less than 2 In the case of 2 Determined as the fourth overlapping video segment, the candidate video segment C 2 That is the second candidate video segment mentioned above.

[0195] After introducing the method for the server to determine the third overlapping video segment and the fourth overlapping video segment, the steps provided in the first part above are described below.

[0196] In a possible implementation, when the at least one candidate video segment includes the third overlapping video segment, the server deletes the third overlapping video segment to obtain the at least one reference candidate video segment. In some embodiments, before deleting the third overlapping video segment, the server superimposes the number of occurrences of the third overlapping video segment on the first candidate video segment. Since the third overlapping video segment is completely included in the first candidate video segment, superimposing the number of occurrences of the third overlapping video segment on the first candidate video segment can increase the weight of the first candidate video segment in subsequent processing.

[0197] In this implementation, the server can delete the repeated third overlapping video segment from at least one candidate video segment to reduce the number of reference candidate video segments obtained, reduce the amount of calculation, and improve calculation efficiency.

[0198] The following is an explanation using a specific example.

[0199] In the candidate video segment D 1 The first sub-fragment o 1 is the candidate video segment C 1 The first sub-fragment p 1 A subset of , and the first sub-fragment o 1 Duration>0.5*first sub-segment p 1 In the case of, the server deletes the first sub-segment o 1 , and delete the candidate video segment D 1 , the candidate video segment D 1 The number of occurrences of the candidate video segment C is added to 1 superior.

[0200] On the basis of the above implementation, optionally, before the server superimposes the number of occurrences of the third overlapping video segment onto the first candidate video segment, it can also determine the duration of the third overlapping video segment and the duration of the first candidate video segment, and determine whether to superimpose the number of occurrences of the third overlapping video segment onto the first candidate video segment based on the duration of the third overlapping video segment and the duration of the first candidate video segment.

[0201] For example, the server determines the duration of the third overlapping video segment and the duration of the first candidate video segment. The server determines a first ratio between the duration of the third overlapping video segment and the duration of the first candidate video segment. When the first ratio is greater than or equal to a ratio threshold, the server superimposes the number of occurrences of the third overlapping video segment on the first candidate video segment; when the first ratio is less than the ratio threshold, the server does not superimpose the number of occurrences of the third overlapping video segment on the first candidate video segment, wherein the ratio threshold is set by a technician according to actual conditions, such as being set to 0.5, and the embodiments of the present application do not limit this.

[0202] In a possible implementation, when the at least one candidate video segment includes the fourth overlapping video segment, and the overlap between the fourth overlapping video segment and the second candidate video segment meets the overlap condition, the server determines the number of occurrences of the fourth overlapping video segment. The server determines the at least one reference candidate video segment based on the number of occurrences of the fourth overlapping video segment.

[0203] The overlap degree refers to the ratio between the duration of the overlapping video segments and the duration of the compared video segments. For example, for the fourth overlapping video segment and the second candidate video segment, the second candidate video segment is the compared video segment. When determining the overlap degree between the fourth overlapping video segment and the second candidate video segment, the duration of the overlapping video segments between the fourth overlapping video segment and the second candidate video segment is divided by the duration of the second candidate video segment. The overlap degree meets the overlap degree condition, which means that the overlap degree is greater than or equal to the overlap degree threshold.

[0204] The following describes the method for the server to determine the at least one reference candidate video segment based on the number of occurrences of the fourth overlapping video segment in the above embodiment through two embodiments.

[0205] Embodiment 1: When the number of occurrences of the fourth overlapping video segment is greater than or equal to the first number of occurrences threshold, the server merges the fourth overlapping video segment with the second candidate video segment to obtain the at least one reference candidate video segment. In some embodiments, before the fourth overlapping video segment is merged with the second candidate video segment, the server superimposes the number of occurrences of the fourth overlapping video segment on the second candidate video segment.

[0206] The first occurrence threshold is set by the technician according to the actual situation, for example, 3, and the embodiment of the present application does not limit this. The occurrence number is greater than or equal to the first occurrence threshold, indicating that the fourth overlapping video segment cannot be ignored and needs further processing to improve the accuracy of obtaining the target video segment.

[0207] The following describes a method for the server in the above implementation manner to merge the fourth overlapping video segment with the second candidate video segment.

[0208] In some embodiments, taking the example that the duration of the fourth overlapping video segment is shorter than that of the second candidate video segment, the server will delete the repeated portion between the fourth overlapping video segment and the second candidate video segment, and add the remaining portion to the second candidate video segment to obtain a candidate video segment. Figure 7 , the duration of the fourth overlapping video segment 701 is shorter than the second candidate video segment 702, and the duration of the fourth overlapping video segment 704 is shorter than the second candidate video segment 705. In the case that the end time of the fourth overlapping video segment 701 is later than the second candidate video segment 702, the server merges the fourth overlapping video segment 701 with the second candidate video segment 702 to obtain a candidate video segment 703. In the case that the start time of the fourth overlapping video segment 704 is earlier than the second candidate video segment 705, the server merges the fourth overlapping video segment 704 with the second candidate video segment 705 to obtain a candidate video segment 706.

[0209] Embodiment 2: When the number of occurrences of the fourth overlapping video segment is less than the first occurrence number threshold, the server deletes the fourth overlapping video segment to obtain the at least one reference candidate video segment. The server superimposes the number of occurrences of the fourth overlapping video segment on the second candidate video segment.

[0210] Among them, if the number of occurrences is less than the first number of occurrences threshold, it means that the fourth overlapping video segment can be ignored, and the server can delete the fourth overlapping video segment.

[0211] In a possible implementation, when the at least one candidate video segment includes the fourth overlapping video segment, and the overlap between the fourth overlapping video segment and the second candidate video segment does not meet the overlap condition, the server deletes the fourth overlapping video segment to obtain the at least one reference candidate video segment. In some embodiments, before deleting the fourth overlapping video segment, the server adds the number of occurrences of the fourth overlapping video segment to the second candidate video segment.

[0212] In a possible implementation, when the at least one candidate video segment includes the fourth overlapping video segment, and the duration of the fourth overlapping video segment is shorter than that of the second candidate video segment, the server deletes the fourth overlapping video segment to obtain the at least one reference candidate video segment. In some embodiments, before deleting the fourth overlapping video segment, the server superimposes the number of occurrences of the fourth overlapping video segment on the second candidate video segment.

[0213] In some embodiments, at least one reference candidate video segment is stored in a match list by the server for easy retrieval.

[0214] In the second part, the server determines the number of occurrences of the reference candidate video segment in the at least one reference candidate video segment.

[0215] Through the processing of the first part above, the server determines at least one reference candidate video segment based on at least one candidate video segment, and the determination process involves merging and deleting the number of occurrences, and the server re-determines the number of occurrences of the at least one reference candidate video segment. In some embodiments, the server can store the number of occurrences of the at least one reference candidate video segment in an occurrence count list (count-list) for easy retrieval.

[0216] For example, when determining the target video segment in the first video, the server uses three second videos for mining. For the convenience of explanation, the first video is named i, and the three second videos are named vid1, vid2, and vid3. After adopting the above steps, the server determines two candidate video segments [(2, 7, 4, 9), (10, 11, 11, 12)] based on the first video i and the second video vid1, determines a candidate video segment [(2, 7, 4, 9)] based on the first video i and the second video vid2, and determines a candidate video segment [(2, 7, 4, 10)] based on the first video i and the second video vid3. The server counts the four candidate video segments and determines that the candidate video segment (2, 7, 4, 9) appears 2 times, the number of appearances of (2, 7, 4, 10) is 1 time, and the number of appearances of (10, 11, 11, 12) is 1 time. After fusing these four candidate video segments through the method of the first part mentioned above, two reference candidate video segments [(2, 7, 4, 9), (10, 11, 11, 12)] are obtained, and the number of occurrences of the reference candidate video segment (2, 7, 4, 9) is 3, and the number of occurrences of the reference candidate video segment (10, 11, 11, 12) is 1. When stored in a count-list, count-list = [3, 1].

[0217] Part 3: The server determines the reference candidate video segment whose appearance times meet the appearance times condition as the target candidate video segment.

[0218] In a possible implementation, the server determines a reference candidate video segment whose appearance number is greater than or equal to a second appearance number threshold as a target candidate video segment.

[0219] The second occurrence threshold is positively correlated with the number of the at least one reference candidate video segment, that is, the more the number of the at least one reference candidate video segment is, the larger the second occurrence threshold is; the fewer the number of the at least one reference candidate video segment is, the smaller the second occurrence threshold is. In some embodiments, the second occurrence threshold is the product of a target ratio and the number of the at least one reference candidate video segment, and the target ratio is a positive number less than 1.

[0220] For example, when two reference candidate video segments are obtained [(2, 7, 4, 9), (10, 11, 11, 12)], and the number of occurrences of the reference candidate video segment (2, 7, 4, 9) is 3, the number of occurrences of the reference candidate video segment (10, 11, 11, 12) is 1, and the second number of occurrences threshold is 3, the server deletes the reference candidate video segment (10, 11, 11, 12), and finally retains the reference candidate video segment (2, 7, 4, 9) and the number of occurrences 3. When storing with a match list (match-list) and a count list (count-list), that is, match-list = (2, 7, 4, 9); count-list = [3].

[0221] 307. When the appearance time of any target candidate video segment in the first video is within the target time range, the server determines the target candidate video segment as the target video segment in the first video.

[0222] Among them, the target time range is set by the technician according to the actual situation. For example, when the technical solution provided in the embodiment of the present application is applied to the scene of identifying the title and end of the video, the target time range is the time range in which the title and end of the video may exist. In this case, the target time range includes a first time range and a second time range. The first time range is the range in which the title may exist, and the second time range is the range in which the end may exist. For example, the first 1 / 5 of the video time is set as the title time, which is also the first time range, and the last 1 / 5 of the time is the end time, which is also the second time range. For a 10-minute video, the title is set to appear only in the first 2 minutes, and the end is in the last 2 minutes. Among them, 1 / 5 is set by the technician according to the actual situation, and corresponding adjustments can be made for different types of videos. For example, 1 / 5 can be taken for children's cartoons of about 15 minutes, and 1 / 8 can be taken for 45-minute long videos of TV series.

[0223] It should be noted that the above steps 301-307 are described using the example of the server determining the target video segment in the first video. When the first video and the at least one second video belong to the same video set, the server can use the same method as the above steps 301-307 to determine the target video segments of other videos in the video set, where other videos refer to videos other than the first video.

[0224] Combine the following Figure 8 The technical solution provided in the embodiments of the present application is described.

[0225] See also Figure 8In an embodiment of the present application, the server performs matching based on the similarity between the video frame features to obtain multiple video frame pairs. The server divides the multiple video frame pairs into multiple initial video frame groups based on the appearance time difference. The server merges the multiple initial video frame groups into multiple candidate video frame groups based on the appearance time difference. The server merges the multiple candidate video frame groups into multiple video frame groups. The server outputs the target video segment of the first video based on the multiple video frame groups.

[0226] In some embodiments, the above steps 301-307 can be implemented by a segment mining system. When the technical solution provided in the embodiment of the present application is applied to the scene of identifying the opening and ending of a video, the segment mining system is also a segment mining system. Fig. 9 The video clip mining system provides the following functions. Extract video frame features of multiple videos. For each video, form a video pair with the other videos in the multiple videos. Perform matching based on multiple video pairs to obtain multiple video frame pairs. Fusion multiple video frame pairs to obtain multiple video frame groups. Based on the multiple video frame groups, determine the position of the target video clip in the video. Based on the position of the target video clip in the video, obtain the target video clip. When the technical solution provided in the embodiment of the present application is applied to the scenario of identifying the opening and ending of a video, the target video clip is also the opening or ending of the video.

[0227] See also Fig.10 The technical solution provided in the embodiment of the present application is applied to the scenario of identifying the opening and ending of a TV series, obtaining a TV series, the TV series including multiple videos. The multiple videos are input into a segment mining system, and the segment mining system outputs the opening and ending of the multiple videos. In some embodiments, the segment mining system can output the timestamps of the opening and ending of the multiple videos.

[0228] 308. The server stores the target video segment in the first video in a segment database.

[0229] In a possible implementation, the server extracts features from the target video segment of the first video to obtain video frame features of the target video segment. The server stores the video frame features of the target video segment in the segment database. In some embodiments, the server associates the video frame features of the target video segment with the first video, for example, the server sets the identifier of the video frame features of the target video segment as the identifier of the first video. In the case where the first video belongs to a certain video set, the server associates the identifier of the first video with the identifier of the video set to facilitate subsequent query processes.

[0230] Among them, extracting features from the target video segment to obtain the video frame features of the target video segment belongs to the same inventive concept as the above step 301. The implementation process refers to the description of the above step 301 and will not be repeated here.

[0231] For example, the target video segment is (2, 7), and the server obtains the target video segment corresponding to 2-7 seconds from the first video, and extracts multiple reference video frames from the target video segment. The server extracts features from the multiple reference video frames to obtain video frame features of the multiple reference video frames. The server stores the video frame features of the multiple reference video frames in a segment database. The server associates the video frame features of the multiple reference video frames with the identifier Vid1 of the first video, and associates the identifier Vid1 of the first video with the identifier Cid1 of the video set to which the first video belongs. Fig.11 A storage format of a fragment database is shown, see Fig.11 In the database 1100, em1-emN are video frame features, vid1-vidK are identifiers of different videos, and N and K are both positive integers.

[0232] After the server stores the target video segment in the first video in the segment database, it can also use the segment database to perform video segment retrieval, as follows:

[0233] In a possible implementation, the server extracts features from multiple target video frames of the target video to be identified to obtain video frame features of the multiple target video frames. The server determines at least one target video segment of the target video based on the video frame features of the multiple target video frames, the video frame features of the first video frame, and the video frame features of the at least one second video.

[0234] Among them, the process in which the server extracts features from multiple target video frames of the target video to obtain the video frame features of the multiple target video frames belongs to the same inventive concept as the above-mentioned step 301. The implementation process refers to the description of the above-mentioned step 301, which will not be repeated here. The process in which the server determines at least one target video segment of the target video based on the video frame features of the multiple target video frames, the video frame features of the first video frame, and the video frame features of the at least one second video belongs to the same inventive concept as the above-mentioned steps 302-307. The implementation process refers to the description of the above-mentioned steps 302-307, which will not be repeated here. In some embodiments, video segment retrieval in the segment database is implemented by a video retrieval system. In some embodiments, the video frame features of the first video frame and the video frame features of the at least one second video are stored in the segment database.

[0235] The above-mentioned method of video clip recognition can be applied to the scenario of identifying the opening and ending of video clips, and can also be applied to the scenario of identifying infringing videos. These two application scenarios will be introduced respectively below.

[0236] The video clip retrieval method is applied to the scene of retrieving the opening and ending of video clips. The target video to be identified is input into the video retrieval system, and the video retrieval system extracts features of the target video to obtain the video frame features of the multiple target video frames. Through the video retrieval system, the video frame features of the multiple target video frames are matched in the clip database to obtain the target video clip in the target video, and the target video clip is also the opening or ending of the target video.

[0237] Take the identification of the title and end of the newly updated video in the TV series as an example. For example, the TV series has been updated with 10 episodes. The title and end of the 10 episodes are obtained through the above steps 301-307, and the title and end of the 10 episodes are stored in the segment database through the above step 308. When the TV series updates the 11th episode, the 11th episode is used as the target video, and the target video is input into the video retrieval system. The video retrieval system extracts features of the target video to obtain the video frame features of the multiple target video frames. Through the video retrieval system, the video frame features of the multiple target video frames are matched in the segment database to obtain the target video segment in the target video, and the target video segment is also the title or end of the target video. In the case of associating the video frame features with the identifier of the video and the identifier of the video set in the segment database, matching can be performed within a limited range based on the identifier of the video set, thereby improving the efficiency of determining the target video segment, wherein the video set is also the TV series.

[0238] The following will be combined Fig.12 Further explanation.

[0239] Determine the TV series for which the title and ending of the TV series are to be identified. Obtain multiple videos in the TV series. Input the multiple videos into the segment mining system 1201, and the segment mining system 1201 outputs the title and ending of the multiple videos. Store the title and ending of the multiple videos in the segment database 1202. In the case that the TV series updates the target video, input the target video into the video retrieval system 1203, and the video retrieval system 1203 uses the target video to search in the segment database 1202 to obtain the title and ending of the target video. The technical solution provided in the embodiment of the present application adopts the method of retrieving the same time period of the video to mine the title and ending of the video in the same video set, that is, for the same video set, the same video segment is found through retrieval and time sequence positioning as the mined title and ending. Cross-duplicate removal refers to finding duplicate video segments through mutual retrieval of videos within the video set. The purpose of video duplicate removal retrieval is to retrieve the same video segment as the stock video for the first video.

[0240] It should be noted that a video may have multiple opening or ending credits that meet the above requirements. This is normal. For TV series with the opening song + this episode's highlights + the same ad placement + the main film, the opening song and ad placement can be matched in multiple videos, but the highlights will not be matched because they are different in each episode, so there will be two opening credits.

[0241] In the scenario of identifying infringing videos, the retrieval method of the video clip is applied to input the target video to be identified into the video retrieval system, and the video retrieval system extracts features of the target video to obtain the video frame features of the multiple target video frames, wherein the target video is also the video to be identified for infringement. Through the video retrieval system, the video frame features of the multiple target video frames are matched in the clip database to obtain the target video clip in the target video, and the target video clip is also the opening or ending of the target video. The target video clip is deleted from the target video, and infringement identification is performed based on the target video after deleting the target video clip. The purpose of infringement identification is to determine whether the content of the target video after deleting the target video clip is the same as that of the specified video. Among them, infringement identification is realized by the infringement identification system, and the infringement identification system can deduce the query video in the infringement protection video database. If duplication is found, it indicates infringement. However, since only the main film content needs to be protected, the opening and ending of conventional film and television dramas are not within the scope of infringement deduplication. The technical solution provided by the embodiment of the present application can realize the identification of the opening and ending of film and television dramas.

[0242] The following will be combined Fig.13 Further explanation.

[0243] Determine the TV series to be identified for infringement. Obtain multiple videos in the TV series, and store the multiple videos in the infringement protection video database 1301. Input the multiple videos into the segment mining system 1302, and the segment mining system 1302 outputs the headers and the tails of the multiple videos. Store the headers and the tails of the multiple videos in the segment database 1303. In the case where it is necessary to identify the target video for infringement, input the target video into the video retrieval system 1304, and the video retrieval system 1304 uses the target video to search in the segment database 1303 to obtain the header and the tail of the target video. Delete the header and the tail of the target video, and output the infringement result of the target video through the infringement identification system 1305, and the infringement result includes infringement and non-infringement.

[0244] In some embodiments, after searching the segment database based on the target video in the above manner, when multiple target video segments of the target video are obtained, the server determines the longest target video segment among the multiple target video segments as the final target video segment. When the technical solution provided in the embodiment of the present application is applied to identifying the beginning and end of a video, the target video segment is also the beginning and end of the target video. For this process, see Fig.14 .

[0245] In addition, the video retrieval system and the segment mining system can provide external interfaces at the same time, that is, retrieval into the library, mining into the library to open the specific functions specified by the user. Alternatively, only one identification interface can be provided, and the background will determine whether to search or mine based on whether the video identifier corresponds to the opening and ending of the TV series in the inventory, and the background will trigger the specific function to be used, which includes retrieval and mining.

[0246] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0247] Through the technical solution provided in the embodiment of the present application, based on the similarity between the video frame features, a video frame pair containing similar video frames is determined. Based on the appearance time difference, the first video frame in the video frame pair is fused to obtain at least one candidate video segment. Finally, a target video segment in a target time range is determined from the at least one candidate video segment. The process of determining the target segment does not require human participation, and can be automatically performed by a computer device directly based on the first video and at least one second video, which is highly efficient.

[0248] Through the above video segment matching algorithm design, a similar video segment matching method based on video frame features is implemented, which can support matching of similar video segments with variable length (reflected in the matching logic, when merging video frame pairs under the same appearance time difference, it is not required that the merged frames must be continuous) and position change (reflected in the matching logic, when the appearance time difference is 0, the position does not change, and when the appearance time difference is greater than 0, the position can change). This method takes little time and has excellent performance.

[0249] Fig.15 is a schematic diagram of the structure of a video clip recognition device provided in an embodiment of the present application, see Fig.15 The device includes: a video frame pair determination module 1501, a fusion module 1502 and a target video segment determination module 1503.

[0250] The video frame pair determination module 1501 is used to determine multiple video frame pairs based on video frame features of a first video and video frame features of at least one second video, wherein the video frame pairs include a first video frame and a second video frame whose similarity meets a similarity condition, the first video frame belongs to the first video, and the second video frame belongs to the at least one second video.

[0251] The fusion module 1502 is used to fuse the first video frames in the multiple video frame pairs based on the appearance time difference of the multiple video frame pairs to obtain at least one candidate video segment in the first video, and the appearance time difference refers to the difference between the appearance time of two video frames in the video frame pair in the video.

[0252] The target video segment determination module 1503 is configured to determine at least one target video segment in the first video based on the at least one candidate video segment and the target time range, where the target video segment is within the target time range of the first video.

[0253] In a possible implementation, the fusion module 1502 is used to divide the multiple video frame pairs into multiple video frame groups based on the appearance time differences of the multiple video frame pairs, and the video frame pairs in the same video frame group correspond to the same appearance time difference. For any video frame group in the multiple video frame groups, according to the appearance time of the first video frame of the video frame pair in the video frame group in the first video, the first video frame of the video frame pair in the video frame group is fused into one of the candidate video segments.

[0254] In a possible implementation, the fusion module 1502 is used to divide video frame pairs with the same appearance time difference into an initial video frame group. Based on the appearance time differences corresponding to the multiple initial video frame groups, the multiple initial video frame groups are fused to obtain the multiple video frame groups.

[0255] In a possible implementation, the fusion module 1502 is used to sort the multiple initial video frame groups according to the target order to obtain multiple candidate video frame groups. When the matching time difference between any two adjacent candidate video frame groups in the multiple candidate video frame groups meets the matching time difference condition, the two adjacent candidate video frame groups are fused into one video frame group, and the matching time difference refers to the difference between the corresponding appearance time differences of the two adjacent candidate video frame groups.

[0256] In one possible implementation, the two adjacent candidate video frame groups include a first candidate video frame group and a second candidate video frame group, and the fusion module 1502 is used to add the video frame pairs in the first candidate video frame group to the second candidate video frame group to obtain the video frame group when a matching time difference between an appearance time difference corresponding to the first candidate video frame group and an appearance time difference corresponding to the second candidate video frame group is less than or equal to a matching difference threshold.

[0257] In a possible implementation, the fusion module 1502 is used to add the video frame pair in the first candidate video frame group to the second candidate video frame group. Based on the appearance time difference corresponding to the second candidate video frame group, the reference second video frame is used to replace the target second video frame to obtain the video frame group, the target second video frame is the second video frame newly added to the second candidate video frame group, the reference second video frame is the second video frame in the second video whose appearance time difference with the target first video frame is the appearance time difference corresponding to the second candidate video frame group, and the target first video frame is the first video frame in the video frame pair to which the target second video frame belongs.

[0258] In a possible implementation, the fusion module 1502 is used to compare the appearance time of the first video frames of any two adjacent video frame pairs in the video frame group in the first video. When the difference between the appearance time of the first video frames of the two adjacent video frame pairs in the first video meets the appearance time condition, the two adjacent video frame pairs are added to the temporary frame list. When the difference between the appearance time of the first video frames of the two adjacent video frame pairs in the first video does not meet the appearance time condition, the video frame pairs in the temporary frame list are fused into a reference video segment. Based on multiple reference video segments, the at least one candidate video segment is determined.

[0259] In a possible implementation, the multiple reference video segments include a first overlapping video segment and / or a second overlapping video segment, the first overlapping video segment refers to a reference video segment belonging to a first reference video segment among the multiple reference video segments, and the second overlapping video segment refers to a reference video segment partially overlapping with a second reference video segment among the multiple reference video segments, and the fusion module 1502 is configured to perform at least one of the following:

[0260] In a case where the multiple reference video segments include the first overlapping video segment, the first overlapping video segment is deleted to obtain the at least one candidate video segment.

[0261] In the case that the multiple reference video segments include the second overlapping video segment, the overlapping portion between the second overlapping video segment and the second reference segment is deleted to obtain the at least one candidate video segment.

[0262] In a possible implementation, the fusion module 1502 is further used to: compare the duration of the third-category reference video segment with the target duration, where the third-category reference video segment refers to the second overlapping video segment with the overlapping portion deleted. If the duration of the third-category reference video segment is greater than or equal to the target duration, retain the third-category reference video segment. If the duration of the third-category reference video segment is less than the target duration, delete the third-category reference video segment.

[0263] In a possible implementation, the target video segment determination module 1503 is configured to determine the at least one target candidate video segment based on the at least one candidate video segment, and the number of occurrences of the target candidate video segment in the at least one candidate video segment meets a number condition.

[0264] In the case that the appearance time of any target candidate video segment in the first video is within the target time range, the target candidate video segment is determined as the target video segment in the first video.

[0265] In a possible implementation, the target video segment determination module 1503 is configured to determine at least one reference candidate video segment based on the at least one candidate video segment, determine the number of occurrences of each reference candidate video segment in the at least one reference candidate video segment, and determine the reference candidate video segment whose number of occurrences meets the number of occurrences condition as the target candidate video segment.

[0266] In a possible implementation, the at least one candidate video segment includes a third overlapping video segment and / or a fourth overlapping video segment, the third overlapping video segment refers to a candidate video segment belonging to a first candidate video segment in the at least one candidate video segment, the fourth overlapping video segment refers to a candidate video segment partially overlapping with a second candidate video segment in the at least one candidate video segment, and the target video segment determination module 1503 is used to perform at least one of the following:

[0267] In a case where the at least one candidate video segment includes the third overlapping video segment, the third overlapping video segment is deleted to obtain the at least one reference candidate video segment.

[0268] When the at least one candidate video segment includes the fourth overlapping video segment, and the overlap between the fourth overlapping video segment and the second candidate video segment meets the overlap condition, the number of occurrences of the fourth overlapping video segment is determined. Based on the number of occurrences of the fourth overlapping video segment, the at least one reference candidate video segment is determined.

[0269] When the at least one candidate video segment includes the fourth overlapping video segment, and the degree of overlap between the fourth overlapping video segment and the second candidate video segment does not meet the overlap condition, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

[0270] In the case that the at least one candidate video segment includes the fourth overlapping video segment, and the duration of the fourth overlapping video segment is shorter than that of the second candidate video segment, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

[0271] In a possible implementation, the target video segment determination module 1503 is configured to perform any of the following:

[0272] When the number of occurrences of the fourth overlapping video segment is greater than or equal to the first occurrence number threshold, the fourth overlapping video segment is merged with the second candidate video segment to obtain the at least one reference candidate video segment.

[0273] When the number of occurrences of the fourth overlapping video segment is less than the first occurrence threshold, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

[0274] In a possible implementation, the device further includes:

[0275] The feature extraction module is used to extract features from multiple target video frames of the target video to be identified, and obtain video frame features of the multiple target video frames.

[0276] The target video segment determination module 1503 is further configured to determine at least one target video segment of the target video based on the video frame features of the multiple target video frames, the video frame features of the first video frame, and the video frame features of the at least one second video.

[0277] It should be noted that: the video segment recognition device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when recognizing video segments. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the video segment recognition device provided in the above embodiment and the video segment recognition method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0278] Through the technical solution provided in the embodiment of the present application, based on the similarity between the video frame features, a video frame pair containing similar video frames is determined. Based on the appearance time difference, the first video frame in the video frame pair is fused to obtain at least one candidate video segment. Finally, a target video segment in a target time range is determined from the at least one candidate video segment. The process of determining the target segment does not require human participation, and can be automatically performed by a computer device directly based on the first video and at least one second video, which is highly efficient.

[0279] The embodiment of the present application provides a computer device for executing the above method. The computer device can be implemented as a terminal or a server. The structure of the terminal is first introduced below:

[0280] Fig.16 It is a structural diagram of a terminal provided in an embodiment of the present application.

[0281] Typically, the terminal 1600 includes: one or more processors 1601 and one or more memories 1602 .

[0282] The processor 1601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0283] The memory 1602 may include one or more computer-readable storage media, which may be non-transitory. The memory 1602 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1602 is used to store at least one computer program, which is used to be executed by the processor 1601 to implement the video segment recognition method provided in the method embodiment of the present application.

[0284] In some embodiments, the terminal 1600 may further optionally include: a peripheral device interface 1603 and at least one peripheral device. The processor 1601, the memory 1602 and the peripheral device interface 1603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1604, a display screen 1605, a camera assembly 1606, an audio circuit 1607 and a power supply 1608.

[0285] The peripheral device interface 1603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1601 and the memory 1602. In some embodiments, the processor 1601, the memory 1602, and the peripheral device interface 1603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1601, the memory 1602, and the peripheral device interface 1603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0286] The radio frequency circuit 1604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1604 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 1604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like.

[0287] Display screen 1605 is used to display UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1605 is a touch display screen, display screen 1605 also has the ability to collect touch signals on the surface or above the surface of display screen 1605. The touch signal can be input to processor 1601 as a control signal for processing. At this time, display screen 1605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards.

[0288] The camera assembly 1606 is used to collect images or videos. Optionally, the camera assembly 1606 includes a front camera and a rear camera. Usually, the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.

[0289] The audio circuit 1607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them to the processor 1601 for processing, or input them to the radio frequency circuit 1604 to achieve voice communication.

[0290] The power supply 1608 is used to supply power to various components in the terminal 1600. The power supply 1608 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery.

[0291] In some embodiments, the terminal 1600 further includes one or more sensors 1609 , including but not limited to: an acceleration sensor 1610 , a gyroscope sensor 1611 , a pressure sensor 1612 , an optical sensor 1613 , and a proximity sensor 1614 .

[0292] The acceleration sensor 1610 can detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the terminal 1600 .

[0293] The gyro sensor 1611 can detect the body direction and rotation angle of the terminal 1600 . The gyro sensor 1611 can cooperate with the acceleration sensor 1610 to collect the user's 3D actions on the terminal 1600 .

[0294] The pressure sensor 1612 may be provided at the side frame of the terminal 1600 and / or the lower layer of the display screen 1605. When the pressure sensor 1612 is provided at the side frame of the terminal 1600, it may detect the user's holding signal of the terminal 1600, and the processor 1601 may perform left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 1612. When the pressure sensor 1612 is provided at the lower layer of the display screen 1605, the processor 1601 may control the operability controls on the UI interface according to the user's pressure operation on the display screen 1605.

[0295] The optical sensor 1613 is used to collect the ambient light intensity. In one embodiment, the processor 1601 can control the display brightness of the display screen 1605 according to the ambient light intensity collected by the optical sensor 1613.

[0296] The proximity sensor 1614 is used to collect the distance between the user and the front of the terminal 1600 .

[0297] Those skilled in the art will understand that Fig.16 The structure shown in the figure does not constitute a limitation on the terminal 1600, and the terminal 1600 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0298] The above-mentioned computer device can also be implemented as a server. The structure of the server is introduced below:

[0299] Fig.17It is a structural diagram of a server provided in an embodiment of the present application. The server 1700 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1701 and one or more memories 1702, wherein the one or more memories 1702 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 1701 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server 1700 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 1700 may also include other components for implementing device functions, which will not be described in detail here.

[0300] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one computer program is stored, and the computer program is loaded and executed by a processor to implement the video segment recognition method in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0301] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned video segment recognition method is implemented.

[0302] In some embodiments, the computer program involved in the embodiments of the present application may be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain system.

[0303] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0304] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for identifying video clips, characterized in that: The method comprises: Determine, based on video frame features of the first video and video frame features of at least one second video, a plurality of video frame pairs, the video frame pairs comprising a first video frame and a second video frame whose similarity meets a similarity condition, the first video frame belonging to the first video, and the second video frame belonging to the at least one second video; Divide video frame pairs with the same appearance time difference into an initial video frame group, wherein the appearance time difference refers to the difference between the appearance times of two video frames in the video frame pair in the video; sorting the multiple initial video frame groups according to a target order to obtain multiple candidate video frame groups; When a matching time difference between any two adjacent candidate video frame groups in the plurality of candidate video frame groups meets a matching time difference condition, merging the two adjacent candidate video frame groups into a target video frame group, wherein the matching time difference refers to a difference between corresponding appearance time differences of the two adjacent candidate video frame groups; For any target video frame group among the plurality of target video frame groups, according to the appearance time of the first video frame of the video frame pair in the target video frame group in the first video, fusing the first video frame of the video frame pair in the target video frame group into a candidate video segment; Determine at least one target candidate video segment based on at least one candidate video segment, wherein the number of occurrences of the target candidate video segment in the at least one candidate video segment meets a number condition; When the appearance time of any of the target candidate video segments in the first video is within the target time range, the target candidate video segment is determined as the target video segment in the first video, and the target video segment is a header or an end.

2. The method according to claim 1, characterized in that The two adjacent candidate video frame groups include a first candidate video frame group and a second candidate video frame group, and the merging of the two adjacent candidate video frame groups into a target video frame group includes: When the matching time difference between the appearance time difference corresponding to the first candidate video frame group and the appearance time difference corresponding to the second candidate video frame group is less than or equal to the matching difference threshold, the video frame pairs in the first candidate video frame group are added to the second candidate video frame group to obtain the target video frame group.

3. The method according to claim 2, characterized in that The step of adding the video frame pairs in the first candidate video frame group to the second candidate video frame group to obtain the target video frame group comprises: adding the video frame pairs in the first candidate video frame group to the second candidate video frame group; Based on the appearance time difference corresponding to the second candidate video frame group, a reference second video frame is used to replace the target second video frame to obtain the target video frame group, the target second video frame is a second video frame newly added to the second candidate video frame group, the reference second video frame is a second video frame in the second video whose appearance time difference with the target first video frame is the appearance time difference corresponding to the second candidate video frame group, and the target first video frame is the first video frame in the video frame pair to which the target second video frame belongs.

4. The method according to claim 1, characterized in that: The step of fusing the first video frame of the video frame pair in the target video frame group into a candidate video segment according to the appearance time of the first video frame of the video frame pair in the target video frame group in the first video comprises: Comparing the appearance time of the first video frames of any two adjacent video frame pairs in the target video frame group in the first video; If a difference between the appearance times of the first video frames of the two adjacent video frame pairs in the first video meets an appearance time condition, adding the two adjacent video frame pairs to a temporary frame list; When the difference between the appearance times of the first video frames of the two adjacent video frame pairs in the first video does not meet the appearance time condition, fusing the video frame pairs in the temporary frame list into a reference video segment; The at least one candidate video segment is determined based on a plurality of reference video segments.

5. The method according to claim 4, characterized in that The multiple reference video segments include a first overlapping video segment and / or a second overlapping video segment, the first overlapping video segment refers to a reference video segment belonging to a first reference video segment among the multiple reference video segments, and the second overlapping video segment refers to a reference video segment partially overlapping with a second reference video segment among the multiple reference video segments, and the determining of the at least one candidate video segment based on the multiple reference video segments includes at least one of the following: In a case where the multiple reference video segments include the first overlapping video segment, deleting the first overlapping video segment to obtain the at least one candidate video segment; In a case where the multiple reference video segments include the second overlapping video segment, an overlapping portion between the second overlapping video segment and the second reference video segment is deleted to obtain the at least one candidate video segment.

6. The method according to claim 5, characterized in that In the case where the plurality of reference video segments include the second overlapping video segment, after deleting the overlapping portion between the second overlapping video segment and the second reference video segment, the method further includes: comparing the duration of a third type of reference video segment with the target duration, wherein the third type of reference video segment refers to the second overlapping video segment with the overlapping portion deleted; When the duration of the third-category reference video segment is greater than or equal to the target duration, retaining the third-category reference video segment; When the duration of the third-category reference video segment is less than the target duration, the third-category reference video segment is deleted.

7. The method according to claim 1, characterized in that The determining, based on the at least one candidate video segment, at least one target candidate video segment comprises: Based on the at least one candidate video segment, determining at least one reference candidate video segment; Determining the number of occurrences of each of the reference candidate video segments in the at least one reference candidate video segment; The reference candidate video segment whose occurrence times meet the times condition is determined as the target candidate video segment.

8. The method according to claim 7, characterized in that The at least one candidate video segment includes a third overlapping video segment and / or a fourth overlapping video segment, the third overlapping video segment refers to a candidate video segment belonging to a first candidate video segment among the at least one candidate video segment, the fourth overlapping video segment refers to a candidate video segment partially overlapping with a second candidate video segment among the at least one candidate video segment, and determining at least one reference candidate video segment based on the at least one candidate video segment includes at least one of the following: In a case where the at least one candidate video segment includes the third overlapping video segment, deleting the third overlapping video segment to obtain the at least one reference candidate video segment; In a case where the at least one candidate video segment includes the fourth overlapping video segment, and the degree of overlap between the fourth overlapping video segment and the second candidate video segment meets the overlap condition, determining the number of occurrences of the fourth overlapping video segment; and determining the at least one reference candidate video segment based on the number of occurrences of the fourth overlapping video segment; When the at least one candidate video segment includes the fourth overlapping video segment, and the degree of overlap between the fourth overlapping video segment and the second candidate video segment does not meet the overlap condition, deleting the fourth overlapping video segment to obtain the at least one reference candidate video segment; In the case that the at least one candidate video segment includes the fourth overlapping video segment and the duration of the fourth overlapping video segment is shorter than that of the second candidate video segment, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

9. The method according to claim 8, characterized in that The determining of the at least one reference candidate video segment based on the number of occurrences of the fourth overlapping video segment comprises any one of the following: When the number of occurrences of the fourth overlapping video segment is greater than or equal to the first occurrence number threshold, fusing the fourth overlapping video segment with the second candidate video segment to obtain the at least one reference candidate video segment; When the number of occurrences of the fourth overlapping video segment is less than the first occurrence threshold, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

10. The method according to claim 1, characterized in that The method further comprises: Performing feature extraction on a plurality of target video frames of a target video to be identified to obtain video frame features of the plurality of target video frames; At least one target video segment of the target video is determined based on the video frame features of the multiple target video frames, the video frame features of the first video frame, and the video frame features of the at least one second video.

11. A video clip recognition device, characterized in that: The device comprises: a video frame pair determination module, configured to determine a plurality of video frame pairs based on video frame features of a first video and video frame features of at least one second video, wherein the video frame pairs include a first video frame and a second video frame whose similarity meets a similarity condition, the first video frame belongs to the first video, and the second video frame belongs to the at least one second video; A fusion module, used for dividing video frame pairs with the same appearance time difference into an initial video frame group, wherein the appearance time difference refers to the difference between the appearance times of two video frames in the video frame pair in the video; The fusion module is further used to sort the multiple initial video frame groups according to the target order to obtain multiple candidate video frame groups; when the matching time difference between any two adjacent candidate video frame groups in the multiple candidate video frame groups meets the matching time difference condition, the two adjacent candidate video frame groups are merged into one target video frame group, and the matching time difference refers to the difference between the corresponding appearance time differences of the two adjacent candidate video frame groups; The fusion module is further configured to fuse, for any target video frame group among the plurality of target video frame groups, the first video frame of the video frame pair in the target video frame group into a candidate video segment according to the appearance time of the first video frame of the video frame pair in the target video frame group in the first video; A target video segment determination module, configured to determine at least one target candidate video segment based on at least one candidate video segment, wherein the number of occurrences of the target candidate video segment in the at least one candidate video segment meets a number condition; The target video segment determination module is also used to determine the target candidate video segment as the target video segment in the first video when the appearance time of any target candidate video segment in the first video is within the target time range, and the target video segment is the header or the tail.

12. The device according to claim 11, characterized in that The two adjacent candidate video frame groups include a first candidate video frame group and a second candidate video frame group, and the fusion module is used to add the video frame pairs in the first candidate video frame group to the second candidate video frame group to obtain the target video frame group when the matching time difference between the appearance time difference corresponding to the first candidate video frame group and the appearance time difference corresponding to the second candidate video frame group is less than or equal to a matching difference threshold.

13. The device according to claim 12, characterized in that The fusion module is used to add the video frame pairs in the first candidate video frame group to the second candidate video frame group; based on the appearance time difference corresponding to the second candidate video frame group, use the reference second video frame to replace the target second video frame to obtain the target video frame group, the target second video frame is the second video frame newly added to the second candidate video frame group, the reference second video frame is the second video frame in the second video whose appearance time difference with the target first video frame is the appearance time difference corresponding to the second candidate video frame group, and the target first video frame is the first video frame in the video frame pair to which the target second video frame belongs.

14. The device according to claim 11, characterized in that The fusion module is used to compare the appearance time of the first video frames of any two adjacent video frame pairs in the target video frame group in the first video; if the difference between the appearance time of the first video frames of the two adjacent video frame pairs in the first video meets the appearance time condition, the two adjacent video frame pairs are added to the temporary frame list; When the difference between the appearance times of the first video frames of the two adjacent video frame pairs in the first video does not meet the appearance time condition, the video frame pairs in the temporary frame list are merged into a reference video segment; and based on multiple reference video segments, the at least one candidate video segment is determined.

15. The device according to claim 14, characterized in that The multiple reference video segments include a first overlapping video segment and / or a second overlapping video segment, the first overlapping video segment refers to a reference video segment belonging to a first reference video segment among the multiple reference video segments, and the second overlapping video segment refers to a reference video segment partially overlapping with a second reference video segment among the multiple reference video segments, and the fusion module is used to perform at least one of the following: In a case where the multiple reference video segments include the first overlapping video segment, deleting the first overlapping video segment to obtain the at least one candidate video segment; In a case where the multiple reference video segments include the second overlapping video segment, an overlapping portion between the second overlapping video segment and the second reference video segment is deleted to obtain the at least one candidate video segment.

16. The device according to claim 15, characterized in that The fusion module is also used to compare the duration of the third category reference video segment with the target duration, where the third category reference video segment refers to the second overlapping video segment with the overlapping part deleted; when the duration of the third category reference video segment is greater than or equal to the target duration, retain the third category reference video segment; when the duration of the third category reference video segment is less than the target duration, delete the third category reference video segment.

17. The device according to claim 11, characterized in that The target video segment determination module is configured to determine at least one reference candidate video segment based on the at least one candidate video segment; Determining the number of occurrences of each of the reference candidate video segments in the at least one reference candidate video segment; The reference candidate video segment whose occurrence times meet the times condition is determined as the target candidate video segment.

18. The device according to claim 17, characterized in that The at least one candidate video segment includes a third overlapping video segment and / or a fourth overlapping video segment, wherein the third overlapping video segment refers to a candidate video segment belonging to a first candidate video segment among the at least one candidate video segment, and the fourth overlapping video segment refers to a candidate video segment partially overlapping with a second candidate video segment among the at least one candidate video segment, and the target video segment determination module is used to perform at least one of the following: In a case where the at least one candidate video segment includes the third overlapping video segment, deleting the third overlapping video segment to obtain the at least one reference candidate video segment; In a case where the at least one candidate video segment includes the fourth overlapping video segment, and the degree of overlap between the fourth overlapping video segment and the second candidate video segment meets the overlap condition, determining the number of occurrences of the fourth overlapping video segment; and determining the at least one reference candidate video segment based on the number of occurrences of the fourth overlapping video segment; When the at least one candidate video segment includes the fourth overlapping video segment, and the degree of overlap between the fourth overlapping video segment and the second candidate video segment does not meet the overlap condition, deleting the fourth overlapping video segment to obtain the at least one reference candidate video segment; In the case that the at least one candidate video segment includes the fourth overlapping video segment and the duration of the fourth overlapping video segment is shorter than that of the second candidate video segment, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

19. The device according to claim 18, characterized in that The target video segment determination module is configured to perform any of the following: When the number of occurrences of the fourth overlapping video segment is greater than or equal to the first occurrence number threshold, fusing the fourth overlapping video segment with the second candidate video segment to obtain the at least one reference candidate video segment; When the number of occurrences of the fourth overlapping video segment is less than the first occurrence threshold, the fourth overlapping video segment is deleted to obtain the at least one reference candidate video segment.

20. The device according to claim 11, characterized in that The device also includes: A feature extraction module, used for extracting features from a plurality of target video frames of a target video to be identified, and obtaining video frame features of the plurality of target video frames; The target video segment determination module is further used to determine at least one target video segment of the target video based on the video frame features of the multiple target video frames, the video frame features of the first video frame, and the video frame features of the at least one second video.

21. A computer device, characterized in that: The computer device includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, and the computer program is loaded and executed by the one or more processors to implement the video clip recognition method according to any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the computer program is loaded and executed by a processor to implement the video segment recognition method according to any one of claims 1 to 10.

23. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for identifying a video segment according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Video positioning method and device thereof, electronic equipment and storage medium

    CN111479130A

  • Video copy detection method and device, storage medium and electronic device

    CN113051984A

  • Video head and tail identification method and device, electronic equipment and readable storage medium

    CN113420182A

  • Method and device for determining homologous video clips and electronic equipment

    CN113836351A

  • Automatic detection of repeating video sequences

    GB201201423D0