Video similarity determination method and apparatus, computer device, and storage medium

By using keyframe detection and memory usage calculation of combined images, the problem of long neural network learning time is solved, achieving efficient video similarity determination and meeting the low latency requirements of live video.

CN117218578BActive Publication Date: 2026-05-19CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER
Filing Date
2023-09-06
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, determining video similarity through neural networks requires a significant amount of time for image feature learning, resulting in low efficiency in video similarity determination and failing to meet the low latency requirements of live video streaming.

Method used

By performing keyframe detection on the video to be tested, combining keyframes to form a composite image, and using the memory usage of the composite image to calculate video similarity, the feature learning process of neural networks is avoided, and video similarity is calculated directly through image combination and compression.

Benefits of technology

It improves the efficiency of video similarity determination, meets the low latency requirements of live video, and reduces the time consumed in learning neural network features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117218578B_ABST
    Figure CN117218578B_ABST
Patent Text Reader

Abstract

The application relates to a video similarity determination method and device, computer equipment and a storage medium, and relates to the technical field of video processing. The method comprises the following steps: performing key frame detection on a first to-be-detected video and a second to-be-detected video at a current time to obtain at least one first key frame of the first to-be-detected video at the current time and at least one second key frame of the second to-be-detected video at the current time; performing image combination on each first key frame and each second key frame to obtain a first combined image, a second combined image and a third combined image; and determining the video similarity of the first to-be-detected video and the second to-be-detected video at the current time according to the first combined image, the second combined image and the third combined image. The application can efficiently determine the video similarity of the first to-be-detected video and the second to-be-detected video at the current time, and when the to-be-detected video is a live video, the application can meet the scene requirement of low latency of the live video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video processing technology, and in particular to a method, apparatus, computer device and storage medium for determining video similarity. Background Technology

[0002] With the continuous development of ultra-high-definition video technology, video services are becoming increasingly widespread, with massive amounts of video being transmitted to service providers every moment. By performing similarity detection on videos, tasks such as content recommendation, categorization, content retrieval, and content moderation can be effectively accomplished. These video services can include short video services or live video services.

[0003] In existing technologies, neural networks can learn the image features of each video to be detected, and then determine the video similarity of each video to be detected based on the neural network that has completed feature learning. However, when determining the video similarity of each video to be detected through neural networks, a lot of time is required to learn the image features of the video to be detected, resulting in low efficiency in determining the video similarity of each video to be detected. Summary of the Invention

[0004] Therefore, it is necessary to provide a video similarity determination method, apparatus, computer equipment, and storage medium that can improve the efficiency of determining the video similarity of each video to be detected, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for determining video similarity. The method includes:

[0006] Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0007] The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0008] Based on the first combined image, the second combined image, and the third combined image, determine the video similarity between the first video to be detected and the second video to be detected at the current moment.

[0009] In one embodiment, determining the video similarity between the first and second videos to be detected at the current moment based on the first combined image, the second combined image, and the third combined image includes:

[0010] Image compression is performed on the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image;

[0011] Based on the memory usage of the first compressed image, the second compressed image, and the third compressed image, the video similarity between the first and second videos to be detected at the current moment is determined.

[0012] In one embodiment, determining the video similarity between the first and second videos to be detected at the current moment based on the memory usage of the first compressed image, the second compressed image, and the third compressed image includes:

[0013] Determine the difference between the memory usage of the third compressed image and the minimum memory usage;

[0014] The ratio of the difference in memory usage to the maximum memory usage is used as the video similarity between the first and second videos to be detected at the current moment.

[0015] The minimum memory usage is the smallest value among the memory usage of the first compressed image and the second compressed image; the maximum memory usage is the largest value among the memory usage of the first compressed image and the second compressed image.

[0016] In one embodiment, after determining the video similarity between the first video to be detected and the second video to be detected at the current time, the method further includes:

[0017] The average video similarity between the first and second videos to be detected is determined based on their video similarity at the current moment and their video similarity at historical moments.

[0018] In one embodiment, keyframe detection is performed on a first video to be detected and a second video to be detected at the current moment to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current moment, including:

[0019] The first and second videos to be detected at the current time are parsed into encoded bitstreams to obtain the first bitstream of the first video to be detected at the current time and the second bitstream of the second video to be detected at the current time.

[0020] The first candidate frame with the first keyframe identifier in the first bitstream is used as the first keyframe of the first video to be detected at the current time, and the second candidate frame with the second keyframe identifier in the second bitstream is used as the second keyframe of the second video to be detected at the current time.

[0021] In one embodiment, the first candidate frame with a keyframe identifier in the first bitstream is used as the first keyframe of the first video to be detected at the current moment, including:

[0022] The first candidate frame with the first keyframe identifier in the first bitstream is taken as the first target frame of the first video to be detected at the current moment.

[0023] A preset number of first target frames are randomly selected as the first keyframes of the first video to be detected at the current moment.

[0024] In one embodiment, the method further includes:

[0025] The first keyframe identifier is determined based on the decoding standard corresponding to the first video to be detected;

[0026] The second keyframe identifier is determined based on the decoding standard corresponding to the second video to be detected.

[0027] Secondly, this application also provides a video similarity determination apparatus. The apparatus includes:

[0028] The detection module is used to perform keyframe detection on the first and second videos to be detected at the current time, and to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0029] The combination module is used to combine the images of each first keyframe and each second keyframe to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0030] The first determining module is used to determine the video similarity between the first video to be detected and the second video to be detected at the current moment based on the first combined image, the second combined image and the third combined image.

[0031] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0032] Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0033] The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0034] Based on the first combined image, the second combined image, and the third combined image, determine the video similarity between the first video to be detected and the second video to be detected at the current moment.

[0035] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0036] Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0037] The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0038] Based on the first combined image, the second combined image, and the third combined image, determine the video similarity between the first video to be detected and the second video to be detected at the current moment.

[0039] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0040] Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0041] The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0042] Based on the first combined image, the second combined image, and the third combined image, determine the video similarity between the first video to be detected and the second video to be detected at the current moment.

[0043] The aforementioned video similarity determination method, apparatus, computer equipment, and storage medium determine at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time. Then, based on each first keyframe and each second keyframe, a first combined image, a second combined image, and a third combined image are determined. Based on the first combined image, the second combined image, and the third combined image, the video similarity between the first video to be detected and the second video to be detected at the current time is determined. In the aforementioned process, this application determines the video similarity between the first and second videos to be detected at the current moment using a first combined image, a second combined image, and a third combined image. Furthermore, the first, second, and third combined images are obtained by combining the first keyframe of the first video to be detected and the second keyframe of the second video to be detected. Therefore, this application does not involve learning image features of the videos to be detected using a neural network in determining the video similarity between the first and second videos to be detected at the current moment. This reduces the time required for feature learning on the neural network. Compared to the prior art, which learns image features of each video to be detected through a neural network and then determines the video similarity based on the neural network that has completed feature learning, this application can efficiently determine the video similarity between the first and second videos to be detected at the current moment. Moreover, when the video to be detected is a live video, this application can meet the low-latency requirements of live video scenarios. Attached Figure Description

[0044] Figure 1 This application provides an illustration of the application environment for a video similarity determination method.

[0045] Figure 2 A flowchart illustrating a video similarity determination method provided in this application embodiment;

[0046] Figure 3 A schematic diagram of the first combined image, the second combined image, and the third combined image provided for embodiments of this application;

[0047] Figure 4A flowchart illustrating the steps for determining video similarity provided in this application embodiment;

[0048] Figure 5 A flowchart illustrating the steps for determining the first keyframe and the second keyframe provided in this application embodiment;

[0049] Figure 6 A flowchart of another video similarity determination method provided in the embodiments of this application;

[0050] Figure 7 A flowchart illustrating yet another video similarity determination method provided in this application embodiment;

[0051] Figure 8 This is a structural block diagram of a first video similarity determination device provided in an embodiment of this application;

[0052] Figure 9 This is a structural block diagram of the second video similarity determination device provided in the embodiments of this application;

[0053] Figure 10 A structural block diagram of the third video similarity determination device provided in the embodiments of this application;

[0054] Figure 11 This is a structural block diagram of the fourth video similarity determination device provided in the embodiments of this application;

[0055] Figure 12 This is a structural block diagram of the fifth video similarity determination device provided in the embodiments of this application;

[0056] Figure 13 A structural block diagram of the sixth video similarity determination device provided in the embodiments of this application;

[0057] Figure 14 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application. In the description of this application, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0060] Based on the above, the video similarity determination method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, in one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 1 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data acquired by the video similarity determination method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a video similarity determination method.

[0061] This application discloses a method, apparatus, computer device, and storage medium for determining video similarity. The computer device of this application determines a first combined image, a second combined image, and a third combined image based on the first keyframe and the second keyframe of the first video to be detected and the second video to be detected. Then, based on the first combined image, the second combined image, and the third combined image, the video similarity between the first video to be detected and the second video to be detected at the current time is determined.

[0062] In one embodiment, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating a video similarity determination method provided in an embodiment of this application. A video similarity determination method is provided. Figure 1 The video similarity determination method performed by the computer device in the video may include the following steps:

[0063] Step 201: Perform keyframe detection on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time.

[0064] The number of first keyframes is the same as the number of second keyframes.

[0065] It should be noted that there are many methods for keyframe detection of the first and second videos to be detected at the current moment. For example, keyframes can be extracted from the first and second videos using 3D-CNN (3D Neural Network), convolutional autoencoders, or FFmpeg. In summary, there are many methods for keyframe detection of the first and second videos to be detected at the current moment, which will not be elaborated upon here. The following will provide a detailed explanation of the three methods mentioned above:

[0066] As one implementation, when extracting keyframes of the first and second videos to be detected using 3D-CNN (three-dimensional neural network), 3D-CNN performs preliminary extraction of keyframes of the first and second videos to be detected using a hierarchical clustering algorithm. Subsequently, it combines semantic correlation algorithms to perform histogram comparison on the preliminarily extracted keyframes of the first and second videos to be detected to remove redundant frames, thereby determining at least one first keyframe of the first video to be detected at the current time and at least one second keyframe of the second video to be detected at the current time.

[0067] As another implementation, when extracting keyframes of the first and second videos to be detected using a convolutional autoencoder, the depth features of the first and second videos to be detected can be extracted using a convolutional autoencoder. K-means clustering is then performed on the depth features of the first and second videos to be detected. In each cluster, a sharpness-based selection method is used to obtain the sharpest video frame as the initial keyframe extracted from the first and second videos to be detected. Then, a point density method is used to perform secondary optimization on the initially extracted keyframes to obtain at least one first keyframe of the first video to be detected at the current time and at least one second keyframe of the second video to be detected at the current time.

[0068] As another implementation, when extracting keyframes of the first and second videos to be detected using FFmpeg (Fast Forward MPEG, an open-source computer program), FFmpeg can be used to parse the encoded bitstreams of the first and second videos to be detected at the current moment, obtaining the first bitstream of the first video to be detected and the second bitstream of the second video to be detected at the current moment. The first candidate frame with keyframe identifier in the first bitstream is used as the first keyframe of the first video to be detected at the current moment; the second candidate frame with keyframe identifier in the second bitstream is used as the second keyframe of the second video to be detected at the current moment.

[0069] The keyframe identifier can be the nal_unit_type identifier.

[0070] To further explain, if a preset number of first keyframes and second keyframes is set in advance, after keyframe detection is performed on the first and second videos to be detected at the current moment, all first target frames contained in the first video to be detected and all second target frames contained in the second video to be detected are determined. Then, a preset number of first target frames are randomly selected as the first keyframes of the first video to be detected at the current moment; and a preset number of second target frames are randomly selected as the second keyframes of the second video to be detected at the current moment.

[0071] The first target frame refers to the keyframe contained in the first video to be detected, and the second target frame refers to the keyframe contained in the second video to be detected. The preset number can be set and modified according to the actual situation and the accuracy requirements of video similarity. The range of the preset number is not limited here.

[0072] Step 202: Combine the images of each first keyframe and each second keyframe to obtain a first combined image, a second combined image, and a third combined image.

[0073] The first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0074] The first and second combined images have the same image length and image width, and the first, second, and third combined images are all complete rectangular images.

[0075] It should be noted that when it is necessary to obtain a first combined image, a second combined image, and a third combined image through image combination, each first keyframe and each second keyframe can be saved as an independent image file. Then, the first keyframes saved as image files are randomly arranged to obtain the first combined image; the second keyframes saved as image files are randomly arranged to obtain the second combined image; wherein the first combined image and the second combined image have the same image length and image width. Further, the first keyframes and each second keyframe saved as image files are randomly arranged to obtain the third combined image.

[0076] In one embodiment of this application, a preset number of first keyframes and a preset number of second keyframes can be extracted from a first detection video sliding window, and each first keyframe and each second keyframe can be saved as an independent image file. A first combined image is obtained based on each first keyframe saved as an image file, and a second combined image is obtained based on each second keyframe saved as an image file. Both the first and second combined images are complete rectangular images of size h×b. A third combined image is obtained based on each first and second keyframe saved as an image file. The third combined image is a complete rectangular image of size 2×h×b.

[0077] For example, if it contains four first keyframes and four second keyframes, such as Figure 3 As shown, four first keyframes and four second keyframes are saved as independent image files. The four first keyframes are first keyframe a, first keyframe b, first keyframe c, and first keyframe d, and the four second keyframes are second keyframe a, second keyframe b, second keyframe c, and second keyframe d. Based on the four first keyframes saved as image files, a first combined image A is obtained. Based on the four second keyframes saved as image files, a second combined image B is obtained. Based on each of the first and second keyframes saved as image files, a third combined image AB is obtained.

[0078] Step 203: Determine the video similarity between the first video to be detected and the second video to be detected at the current moment based on the first combined image, the second combined image and the third combined image.

[0079] It should be noted that when it is necessary to determine the video similarity between the first and second videos to be detected at the current moment, the memory usage of the first combined image, the memory usage of the second combined image, and the memory usage of the third combined image can be determined respectively. Then, similarity calculation is performed based on the memory usage of the first combined image, the memory usage of the second combined image, and the memory usage of the third combined image to determine the video similarity between the first and second videos to be detected at the current moment.

[0080] To further explain, since each first keyframe and each second keyframe contains a large amount of data, the first combined image, the second combined image, and the third combined image all contain a large amount of data. This results in an excessively large content footprint for the first combined image, the second combined image, and the third combined image. Therefore, calculating similarity based on the memory footprint of these three combined images requires significant computational resources. Thus, to ensure the efficiency of determining video similarity, image compression is necessary for the first combined image, the second combined image, and the third combined image. This yields a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image. Then, similarity calculations are performed based on the memory footprint of the first compressed image, the second compressed image, and the third compressed image to determine the video similarity between the first and second videos to be detected at the current moment.

[0081] The above-mentioned video similarity determination method determines at least one first keyframe of the first video to be detected at the current time and at least one second keyframe of the second video to be detected at the current time. Then, based on each first keyframe and each second keyframe, a first combined image, a second combined image, and a third combined image are determined. Based on the first combined image, the second combined image, and the third combined image, the video similarity between the first video to be detected and the second video to be detected at the current time is determined. In the aforementioned process, this application determines the video similarity between the first and second videos to be detected at the current moment using a first combined image, a second combined image, and a third combined image. Furthermore, the first, second, and third combined images are obtained by combining the first keyframe of the first video to be detected and the second keyframe of the second video to be detected. Therefore, this application does not involve learning image features of the videos to be detected using a neural network in determining the video similarity between the first and second videos to be detected at the current moment. This reduces the time required for feature learning on the neural network. Compared to the prior art, which learns image features of each video to be detected through a neural network and then determines the video similarity based on the neural network that has completed feature learning, this application can efficiently determine the video similarity between the first and second videos to be detected at the current moment. Moreover, when the video to be detected is a live video, this application can meet the low-latency requirements of live video scenarios.

[0082] When calculating video similarity for live videos using neural networks, the network requires a significant amount of time to learn the image features of the video to be detected. Therefore, it cannot meet the low-latency requirements of live video scenarios. To address this technical problem, the computer device in this embodiment can, as shown in the example... Figure 4 The method shown determines the video similarity between the first and second videos to be detected at the current moment based on the first combined image, the second combined image, and the third combined image. Specifically, it includes the following steps:

[0083] Step 401: Compress the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image.

[0084] It should be noted that by setting a quality factor α in advance and using the JPEG (JPEG algorithm, image compression algorithm) algorithm to compress the first combined image, the second combined image, and the third combined image, the first compressed image corresponding to the first combined image, the second compressed image corresponding to the second combined image, and the third compressed image corresponding to the third combined image can be obtained.

[0085] The quality factor can be set and adjusted according to the actual situation and computing resources. For example, the quality factor α can be 0.5. The range of values ​​for the quality factor is not limited here.

[0086] To further explain, the first combined image, the second combined image, and the third combined image can also be compressed using deep learning image compression algorithms. For example, the first combined image, the second combined image, and the third combined image can be compressed and input into a multilayer perceptron, so that the multilayer perceptron can perform image compression processing on the first combined image, the second combined image, and the third combined image, and obtain the output result of the multilayer perceptron, which is the first compressed image, the second compressed image, and the third compressed image.

[0087] In summary, there are many methods for compressing the first, second, and third combined images, which will not be elaborated here. This application does not limit the compression method for compressing the first, second, and third combined images.

[0088] Step 402: Determine the video similarity between the first video to be detected and the second video to be detected at the current moment based on the memory usage of the first compressed image, the memory usage of the second compressed image, and the memory usage of the third compressed image.

[0089] It should be noted that when determining the video similarity between the first and second videos to be detected at the current moment, the minimum and maximum memory usage values ​​can be determined from the memory usage values ​​of the first and second compressed images. The minimum memory usage value is the smallest value among the memory usage values ​​of the first and second compressed images; the maximum memory usage value is the largest value among the memory usage values ​​of the first and second compressed images. Furthermore, the difference between the memory usage value of the third compressed image and the minimum memory usage value is determined; the ratio of this difference to the maximum memory usage value is used as the video similarity between the first and second videos to be detected at the current moment.

[0090] Based on the above, the video similarity calculation formula (1) can be determined, as shown below:

[0091]

[0092] Where, distance i This refers to the video similarity between the first and second videos to be detected at the current moment, L. ab This refers to the memory usage of the third-compressed image, L. aThis refers to the memory usage of the first compressed image, L. b This refers to the memory usage of the second compressed image, min(L) a L b ) refers to the minimum memory usage, max(L) a L b This refers to the maximum memory usage.

[0093] In one embodiment of this application, when it is necessary to determine the video similarity between the first video to be detected and the second video to be detected at the current time, the memory usage of the first compressed image, the memory usage of the second compressed image, and the memory usage of the third compressed image can be substituted into the video similarity calculation formula (1). The result obtained is the video similarity between the first video to be detected and the second video to be detected at the current time.

[0094] To further clarify, in order to better reflect the video similarity between the first and second videos to be detected, it is also necessary to calculate their average video similarity. Therefore, the average video similarity between the first and second videos to be detected is determined based on their video similarity at the current moment and their video similarity at historical moments.

[0095] The closer the average video similarity is to 1, the higher the similarity between the first and second videos to be detected; the closer the average video similarity is to 0, the lower the similarity between the first and second videos to be detected.

[0096] Based on the above, the formula for calculating the average video similarity (2) can be determined, as shown below:

[0097]

[0098] Where, distance i This refers to the video similarity between the first and second videos to be detected at the current time and at historical times, where distance is the distance. avg This refers to the average video similarity between the first and second videos to be detected, and n refers to the total number of known video similarities between the first and second videos to be detected at the current time and at historical times.

[0099] In one embodiment of this application, when it is necessary to determine the average video similarity between the first video to be detected and the second video to be detected, the average video similarity can be obtained by substituting the video similarity of the first video to be detected and the second video to be detected at the current time and the video similarity at historical time into the average video similarity calculation formula (2).

[0100] To further explain, it can be pre-set that at each interval t1, keyframe detection is performed on the first and second videos to be detected at the current time, and the video similarity between the first and second videos to be detected at that time is determined. Furthermore, at each interval t2, the operation of determining the average video similarity between the first and second videos to be detected based on the video similarity between the first and second videos to be detected at the current time and the video similarity at historical time points is returned. Each average video similarity is recorded in real time, and a smooth curve is used to connect the average video similarities at each time point to obtain a smooth similarity curve. This similarity curve can reflect the real-time correlation between the first and second videos to be detected.

[0101] The aforementioned video similarity determination method, by compressing the first, second, and third combined images, ensures that the computational resources consumed in calculating the video similarity between the first and second videos to be detected at the current moment are reduced, thereby improving the efficiency of determining the video similarity between the first and second videos to be detected at the current moment. Furthermore, it ensures that the video similarity between the first and second videos to be detected at the current moment accurately reflects the correlation between the two videos.

[0102] In one embodiment, when it is necessary to determine at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time, the encoded bitstreams of the first and second videos to be detected at the current time can be parsed, such as... Figure 5 As shown, it may specifically include the following:

[0103] Step 501: Parse the encoded bitstream of the first and second videos to be detected at the current time to obtain the first bitstream of the first video to be detected at the current time and the second bitstream of the second video to be detected at the current time.

[0104] To improve the efficiency of determining video similarity while ensuring accuracy, the first keyframe and the second keyframe of the first video to be detected and the second video to be detected can be extracted. Since the first keyframe contains the data content information of the first video to be detected and the second keyframe contains the data content information of the second video to be detected, the video similarity between the first video to be detected and the second video to be detected at the current moment can be determined based on the first keyframe and the second keyframe.

[0105] Therefore, in order to ensure that the first keyframe of the first video to be detected and the second keyframe of the second video to be detected can be successfully determined, it is necessary to determine the first bitstream of the first video to be detected and the second bitstream of the second video to be detected.

[0106] In one embodiment of this application, when it is necessary to parse the encoded bitstream of the first and second videos to be detected at the current moment, the encoded bitstreams of the first and second videos to be detected can be parsed using tools such as FFmpeg, thereby obtaining the first bitstream of the first video to be detected at the current moment and the second bitstream of the second video to be detected at the current moment.

[0107] Step 502: The first candidate frame with the first keyframe identifier in the first bitstream is taken as the first keyframe of the first video to be detected at the current time, and the second candidate frame with the second keyframe identifier in the second bitstream is taken as the second keyframe of the second video to be detected at the current time.

[0108] Specifically, when it is necessary to determine the first keyframe of the first video to be detected at the current moment, the following steps are included: taking the first candidate frame with the first keyframe identifier in the first bitstream as the first target frame of the first video to be detected at the current moment; randomly selecting a preset number of first target frames as the first keyframe of the first video to be detected at the current moment.

[0109] Here, the first target frame refers to all the key frames contained in the first video to be detected, and the first key frame refers to a preset number of key frames randomly selected from the first target frame.

[0110] Specifically, when it is necessary to determine the second keyframe of the second video to be detected at the current time, the following steps are included: taking the second candidate frame with the second keyframe identifier in the second bitstream as the second target frame of the second video to be detected at the current time; randomly selecting a preset number of second target frames as the second keyframe of the second video to be detected at the current time.

[0111] The second target frame refers to all the key frames contained in the second video to be detected, and the second key frame refers to a preset number of key frames randomly selected from the second target frame.

[0112] It should be noted that the keyframe identifiers are different depending on the decoding standard of the video to be detected. Therefore, when it is necessary to determine the first keyframe identifier of the first video to be detected and the second keyframe identifier of the second video to be detected, the following steps are included: determining the first keyframe identifier according to the decoding standard of the first video to be detected; and determining the second keyframe identifier according to the decoding standard of the second video to be detected.

[0113] For example, if the decoding standard of the first video to be detected is H.264, then the first keyframe identifier nal_unit_type is determined to be 5; if the decoding standard of the second video to be detected is H.265, then the first keyframe identifier nal_unit_type is determined to be 19 or 20.

[0114] The above video similarity determination method determines the first bitstream of the first video to be detected and the second bitstream of the second video to be detected at the current time. Then, based on the first bitstream and the second bitstream, the first keyframe and the second keyframe are determined, ensuring that the video similarity between the first video to be detected and the second video to be detected at the current time can be successfully determined based on the first keyframe and the second keyframe.

[0115] In one embodiment, when it is necessary to determine the video similarity between the first and second videos to be detected at the current moment, such as Figure 6 As shown, it may specifically include the following:

[0116] Step 601: Parse the encoded bitstream of the first and second videos to be detected at the current time to obtain the first bitstream of the first video to be detected at the current time and the second bitstream of the second video to be detected at the current time.

[0117] Step 602: The first candidate frame with the first keyframe identifier in the first bitstream is taken as the first keyframe of the first video to be detected at the current time, and the second candidate frame with the second keyframe identifier in the second bitstream is taken as the second keyframe of the second video to be detected at the current time.

[0118] Step 603: Combine the images of each first keyframe and each second keyframe to obtain a first combined image, a second combined image, and a third combined image.

[0119] Step 604: Compress the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image.

[0120] Step 605: Determine the difference between the memory usage of the third compressed image and the minimum memory usage.

[0121] Step 606: The ratio of the difference in memory usage to the maximum memory usage is used as the video similarity between the first and second videos to be detected at the current moment.

[0122] In one embodiment of this application, such as Figure 7 As shown, the video similarity between the first and second videos to be detected at the current moment can be determined through a video frame extraction module, a video frame reconstruction module, and a similarity detection module. Specifically, the video frame extraction module, video frame reconstruction module, and similarity detection module are all deployed on a media server. The first and second videos to be detected are input to the media server. The video frame extraction module extracts at least one first keyframe and at least one second keyframe from the first and second videos. The video frame reconstruction module combines images based on the first and second keyframes to obtain a first combined image, a second combined image, and a third combined image. The first combined image is obtained by combining the first keyframes, the second combined image is obtained by combining the second keyframes, and the third combined image is obtained by combining the first and second keyframes. The similarity detection module compresses the first, second, and third combined images and determines the video similarity between the first and second videos to be detected at the current moment based on the memory usage of the first compressed image, the second compressed image, and the third compressed image.

[0123] The aforementioned video similarity determination method, apparatus, computer equipment, and storage medium determine at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time. Then, based on each first keyframe and each second keyframe, a first combined image, a second combined image, and a third combined image are determined. Based on the first combined image, the second combined image, and the third combined image, the video similarity between the first video to be detected and the second video to be detected at the current time is determined. In the aforementioned process, this application determines the video similarity between the first and second videos to be detected at the current moment using a first combined image, a second combined image, and a third combined image. Furthermore, the first, second, and third combined images are obtained by combining the first keyframe of the first video to be detected and the second keyframe of the second video to be detected. Therefore, this application does not involve learning image features of the videos to be detected using a neural network in determining the video similarity between the first and second videos to be detected at the current moment. This reduces the time required for feature learning on the neural network. Compared to the prior art, which learns image features of each video to be detected through a neural network and then determines the video similarity based on the neural network that has completed feature learning, this application can efficiently determine the video similarity between the first and second videos to be detected at the current moment. Moreover, when the video to be detected is a live video, this application can meet the low-latency requirements of live video scenarios.

[0124] The above-mentioned video similarity determination method determines at least one first keyframe of the first video to be detected at the current time and at least one second keyframe of the second video to be detected at the current time. Then, based on each first keyframe and each second keyframe, a first combined image, a second combined image, and a third combined image are determined. Based on the first combined image, the second combined image, and the third combined image, the video similarity between the first video to be detected and the second video to be detected at the current time is determined. In the aforementioned process, this application determines the video similarity between the first and second videos to be detected at the current moment using a first combined image, a second combined image, and a third combined image. Furthermore, the first, second, and third combined images are obtained by combining the first keyframe of the first video to be detected and the second keyframe of the second video to be detected. Therefore, this application does not involve learning image features of the videos to be detected using a neural network in determining the video similarity between the first and second videos to be detected at the current moment. This reduces the time required for feature learning on the neural network. Compared to the prior art, which learns image features of each video to be detected through a neural network and then determines the video similarity based on the neural network that has completed feature learning, this application can efficiently determine the video similarity between the first and second videos to be detected at the current moment. Moreover, when the video to be detected is a live video, this application can meet the low-latency requirements of live video scenarios.

[0125] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0126] Based on the same inventive concept, this application also provides a video similarity determination apparatus for implementing the video similarity determination method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more video similarity determination apparatus embodiments provided below can be found in the limitations of the video similarity determination method described above, and will not be repeated here.

[0127] In one embodiment, such as Figure 8As shown, a video similarity determination device is provided, comprising: a detection module 10, a combination module 20, and a first determination module 30, wherein:

[0128] The detection module 10 is used to perform keyframe detection on the first video to be detected and the second video to be detected at the current time, and to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0129] The combination module 20 is used to combine the images of each first keyframe and each second keyframe to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0130] The first determining module 30 is used to determine the video similarity between the first video to be detected and the second video to be detected at the current moment based on the first combined image, the second combined image and the third combined image.

[0131] The aforementioned video similarity determination device determines at least one first keyframe of the first video to be detected at the current time and at least one second keyframe of the second video to be detected at the current time. Then, based on each first keyframe and each second keyframe, it determines a first combined image, a second combined image, and a third combined image. Based on the first combined image, the second combined image, and the third combined image, it determines the video similarity between the first video to be detected and the second video to be detected at the current time. In the aforementioned process, this application determines the video similarity between the first and second videos to be detected at the current moment using a first combined image, a second combined image, and a third combined image. Furthermore, the first, second, and third combined images are obtained by combining the first keyframe of the first video to be detected and the second keyframe of the second video to be detected. Therefore, this application does not involve learning image features of the videos to be detected using a neural network in determining the video similarity between the first and second videos to be detected at the current moment. This reduces the time required for feature learning on the neural network. Compared to the prior art, which learns image features of each video to be detected through a neural network and then determines the video similarity based on the neural network that has completed feature learning, this application can efficiently determine the video similarity between the first and second videos to be detected at the current moment. Moreover, when the video to be detected is a live video, this application can meet the low-latency requirements of live video scenarios.

[0132] In one embodiment, such as Figure 9As shown, a video similarity determination device is provided. The first determination module 30 in this device includes a compression unit 31 and a first determination unit 32, wherein:

[0133] Compression unit 31 is used to compress the first combined image, the second combined image and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image and a third compressed image corresponding to the third combined image.

[0134] The first determining unit 32 is used to determine the video similarity between the first video to be detected and the second video to be detected at the current moment based on the memory usage of the first compressed image, the memory usage of the second compressed image, and the memory usage of the third compressed image.

[0135] In one embodiment, such as Figure 10 As shown, a video similarity determination device is provided. The first determination unit 32 in this device includes: a first determination subunit 321 and a second determination subunit 322, wherein:

[0136] The first determining subunit 321 is used to determine the difference between the memory usage of the third compressed image and the minimum memory usage.

[0137] The second determining subunit 322 is used to take the ratio of the difference in memory usage to the maximum memory usage as the video similarity between the first video to be detected and the second video to be detected at the current time; wherein, the minimum memory usage is the minimum memory usage of the first compressed image and the second compressed image; and the maximum memory usage is the maximum memory usage of the first compressed image and the second compressed image.

[0138] In one embodiment, such as Figure 11 As shown, a video similarity determination device is provided, which further includes: a second determination module 40, wherein:

[0139] The second determining module 40 is used to determine the average video similarity between the first video to be detected and the second video to be detected based on the video similarity between the first video to be detected and the second video to be detected at the current time and the video similarity at historical times.

[0140] In one embodiment, such as Figure 12 As shown, a video similarity determination device is provided. The detection module 10 in this device includes: a parsing unit 11 and a second determination unit 12, wherein:

[0141] The parsing unit 11 is used to parse the encoded bitstream of the first video to be detected and the second video to be detected at the current time, so as to obtain the first bitstream of the first video to be detected and the second bitstream of the second video to be detected at the current time.

[0142] The second determining unit 12 is used to take the first candidate frame with the first keyframe identifier in the first bitstream as the first keyframe of the first video to be detected at the current time, and to take the second candidate frame with the second keyframe identifier in the second bitstream as the second keyframe of the second video to be detected at the current time.

[0143] In one embodiment, such as Figure 13 As shown, a video similarity determination device is provided. The second determination unit 12 in this device includes: a third determination subunit 121 and a fourth determination subunit 122, wherein:

[0144] The third determining subunit 121 is used to take the first candidate frame with the first keyframe identifier in the first bit stream as the first target frame of the first video to be detected at the current time.

[0145] The fourth determining subunit 122 is used to randomly select a preset number of first target frames as the first keyframe of the first video to be detected at the current moment.

[0146] The third determining subunit is specifically used to determine the first keyframe identifier based on the decoding standard corresponding to the first video to be detected; and to determine the second keyframe identifier based on the decoding standard corresponding to the second video to be detected.

[0147] The modules in the aforementioned video similarity determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0148] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 14As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a video similarity determination method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0149] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0150] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0151] Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0152] The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0153] Based on the first combined image, the second combined image, and the third combined image, determine the video similarity between the first video to be detected and the second video to be detected at the current moment.

[0154] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0155] Image compression is performed on the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image;

[0156] Based on the memory usage of the first compressed image, the second compressed image, and the third compressed image, the video similarity between the first and second videos to be detected at the current moment is determined.

[0157] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0158] Determine the difference between the memory usage of the third compressed image and the minimum memory usage;

[0159] The ratio of the difference in memory usage to the maximum memory usage is used as the video similarity between the first and second videos to be detected at the current moment.

[0160] The minimum memory usage is the smallest value among the memory usage of the first compressed image and the second compressed image; the maximum memory usage is the largest value among the memory usage of the first compressed image and the second compressed image.

[0161] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0162] The average video similarity between the first and second videos to be detected is determined based on their video similarity at the current moment and their video similarity at historical moments.

[0163] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0164] The first and second videos to be detected at the current time are parsed into encoded bitstreams to obtain the first bitstream of the first video to be detected at the current time and the second bitstream of the second video to be detected at the current time.

[0165] The first candidate frame with the first keyframe identifier in the first bitstream is used as the first keyframe of the first video to be detected at the current time, and the second candidate frame with the second keyframe identifier in the second bitstream is used as the second keyframe of the second video to be detected at the current time.

[0166] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0167] The first candidate frame with the first keyframe identifier in the first bitstream is taken as the first target frame of the first video to be detected at the current moment.

[0168] A preset number of first target frames are randomly selected as the first keyframes of the first video to be detected at the current moment.

[0169] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0170] The first keyframe identifier is determined based on the decoding standard corresponding to the first video to be detected;

[0171] The second keyframe identifier is determined based on the decoding standard corresponding to the second video to be detected.

[0172] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0173] Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0174] The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0175] Based on the first combined image, the second combined image, and the third combined image, determine the video similarity between the first video to be detected and the second video to be detected at the current moment.

[0176] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0177] Image compression is performed on the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image;

[0178] Based on the memory usage of the first compressed image, the second compressed image, and the third compressed image, the video similarity between the first and second videos to be detected at the current moment is determined.

[0179] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0180] Determine the difference between the memory usage of the third compressed image and the minimum memory usage;

[0181] The ratio of the difference in memory usage to the maximum memory usage is used as the video similarity between the first and second videos to be detected at the current moment.

[0182] The minimum memory usage is the smallest value among the memory usage of the first compressed image and the second compressed image; the maximum memory usage is the largest value among the memory usage of the first compressed image and the second compressed image.

[0183] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0184] The average video similarity between the first and second videos to be detected is determined based on their video similarity at the current moment and their video similarity at historical moments.

[0185] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0186] The first and second videos to be detected at the current time are parsed into encoded bitstreams to obtain the first bitstream of the first video to be detected at the current time and the second bitstream of the second video to be detected at the current time.

[0187] The first candidate frame with the first keyframe identifier in the first bitstream is used as the first keyframe of the first video to be detected at the current time, and the second candidate frame with the second keyframe identifier in the second bitstream is used as the second keyframe of the second video to be detected at the current time.

[0188] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0189] The first candidate frame with the first keyframe identifier in the first bitstream is taken as the first target frame of the first video to be detected at the current moment.

[0190] A preset number of first target frames are randomly selected as the first keyframes of the first video to be detected at the current moment.

[0191] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0192] The first keyframe identifier is determined based on the decoding standard corresponding to the first video to be detected;

[0193] The second keyframe identifier is determined based on the decoding standard corresponding to the second video to be detected.

[0194] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0195] Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of first keyframes is the same as the number of second keyframes.

[0196] The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe.

[0197] Based on the first combined image, the second combined image, and the third combined image, determine the video similarity between the first video to be detected and the second video to be detected at the current moment.

[0198] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0199] Image compression is performed on the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image;

[0200] Based on the memory usage of the first compressed image, the second compressed image, and the third compressed image, the video similarity between the first and second videos to be detected at the current moment is determined.

[0201] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0202] Determine the difference between the memory usage of the third compressed image and the minimum memory usage;

[0203] The ratio of the difference in memory usage to the maximum memory usage is used as the video similarity between the first and second videos to be detected at the current moment.

[0204] The minimum memory usage is the smallest value among the memory usage of the first compressed image and the second compressed image; the maximum memory usage is the largest value among the memory usage of the first compressed image and the second compressed image.

[0205] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0206] The average video similarity between the first and second videos to be detected is determined based on their video similarity at the current moment and their video similarity at historical moments.

[0207] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0208] The first and second videos to be detected at the current time are parsed into encoded bitstreams to obtain the first bitstream of the first video to be detected at the current time and the second bitstream of the second video to be detected at the current time.

[0209] The first candidate frame with the first keyframe identifier in the first bitstream is used as the first keyframe of the first video to be detected at the current time, and the second candidate frame with the second keyframe identifier in the second bitstream is used as the second keyframe of the second video to be detected at the current time.

[0210] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0211] The first candidate frame with the first keyframe identifier in the first bitstream is taken as the first target frame of the first video to be detected at the current moment.

[0212] A preset number of first target frames are randomly selected as the first keyframes of the first video to be detected at the current moment.

[0213] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0214] The first keyframe identifier is determined based on the decoding standard corresponding to the first video to be detected;

[0215] The second keyframe identifier is determined based on the decoding standard corresponding to the second video to be detected.

[0216] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, image processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0217] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0218] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for determining video similarity, characterized in that, The method includes: Keyframe detection is performed on the first and second videos to be detected at the current time to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of the first keyframes is the same as the number of the second keyframes. The images of each first keyframe and each second keyframe are combined to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe. Image compression is performed on the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image; Based on the memory usage of the first compressed image, the second compressed image, and the third compressed image, the video similarity between the first video to be detected and the second video to be detected at the current moment is determined.

2. The method according to claim 1, characterized in that, Determining the video similarity between the first and second videos to be detected at the current moment based on the memory usage of the first compressed image, the second compressed image, and the third compressed image includes: Determine the difference between the memory usage of the third compressed image and the minimum memory usage; The ratio of the difference in memory usage to the maximum memory usage is used as the video similarity between the first video to be detected and the second video to be detected at the current moment. Wherein, the minimum memory usage is the smallest value among the memory usage of the first compressed image and the memory usage of the second compressed image; the maximum memory usage is the largest value among the memory usage of the first compressed image and the memory usage of the second compressed image.

3. The method according to any one of claims 1-2, characterized in that, After determining the video similarity between the first video to be detected and the second video to be detected at the current time, the process further includes: The average video similarity between the first video to be detected and the second video to be detected is determined based on the video similarity between the first video to be detected and the second video to be detected at the current time and the video similarity at historical times.

4. The method according to any one of claims 1-2, characterized in that, The step of performing keyframe detection on the first and second videos to be detected at the current moment, to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current moment, includes: The first and second videos to be detected at the current time are parsed into encoded bitstreams to obtain the first bitstream of the first video to be detected at the current time and the second bitstream of the second video to be detected at the current time. The first candidate frame with the first keyframe identifier in the first bitstream is used as the first keyframe of the first video to be detected at the current time, and the second candidate frame with the second keyframe identifier in the second bitstream is used as the second keyframe of the second video to be detected at the current time.

5. The method according to claim 4, characterized in that, The step of using the first candidate frame with a keyframe identifier in the first bitstream as the first keyframe of the first video to be detected at the current moment includes: The first candidate frame with the first keyframe identifier in the first bitstream is taken as the first target frame of the first video to be detected at the current moment. A preset number of first target frames are randomly selected as the first keyframes of the first video to be detected at the current moment.

6. The method according to claim 4, characterized in that, The method further includes: The first keyframe identifier is determined based on the decoding standard corresponding to the first video to be detected; The second keyframe identifier is determined based on the decoding standard corresponding to the second video to be detected.

7. A video similarity determination device, characterized in that, The device includes: The detection module is used to perform keyframe detection on the first and second videos to be detected at the current time, and to obtain at least one first keyframe of the first video to be detected and at least one second keyframe of the second video to be detected at the current time; the number of the first keyframes is the same as the number of the second keyframes. The combination module is used to combine the images of each first keyframe and each second keyframe to obtain a first combined image, a second combined image and a third combined image; wherein, the first combined image is obtained by combining each first keyframe, the second combined image is obtained by combining each second keyframe, and the third combined image is obtained by combining each first keyframe and each second keyframe. The first determining module is used to compress the first combined image, the second combined image, and the third combined image to obtain a first compressed image corresponding to the first combined image, a second compressed image corresponding to the second combined image, and a third compressed image corresponding to the third combined image; and to determine the video similarity between the first video to be detected and the second video to be detected at the current time based on the memory usage of the first compressed image, the memory usage of the second compressed image, and the memory usage of the third compressed image.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.