Search

CN-121980280-A - Video matching method, device, electronic equipment, storage medium and system

CN121980280ACN 121980280 ACN121980280 ACN 121980280ACN-121980280-A

Abstract

The invention provides a video matching method, a video matching device, electronic equipment, a storage medium and a video matching system, and relates to the technical field of computers. The video matching method comprises the steps of extracting first video frames from first videos by means of a preset sampling algorithm, extracting second video frames from second videos by means of a preset sampling algorithm, determining hash values of the first video frames and hash values of the second video frames, and determining whether contents of the first videos and the second videos are consistent or not according to the hash values of the first video frames and the hash values of the second video frames. The invention can accurately and efficiently execute the matching task of mass video files.

Inventors

  • LIU XUECHENG
  • XIE SHAOXUAN
  • YAO GUOCAI
  • NI ZIQIANG

Assignees

  • 北京智源人工智能研究院

Dates

Publication Date
20260505
Application Date
20251224

Claims (10)

  1. 1. A video matching method, comprising: Extracting a first video frame from the first video by using a preset sampling algorithm; extracting a second video frame from a second video by using the preset sampling algorithm, wherein the first video and the second video correspond to different coding parameters; determining hash values of the first video frames and hash values of the second video frames; And determining whether the contents of the first video and the second video are consistent according to the hash value of each first video frame and the hash value of each second video frame.
  2. 2. The video matching method according to claim 1, wherein the determining whether the contents of the first video and the second video are identical according to the hash value of each first video frame and the hash value of each second video frame comprises: Obtaining a first hash vector according to the hash value of each first video frame; Obtaining a second hash vector according to the hash value of each second video frame; And determining whether the contents of the first video and the second video are consistent according to the first hash vector and the second hash vector.
  3. 3. The video matching method according to claim 2, wherein the determining whether the contents of the first video and the second video are identical according to the first hash vector and the second hash vector comprises: determining a similarity of the first hash vector and the second hash vector; And determining whether the contents of the first video and the second video are consistent according to the similarity.
  4. 4. The video matching method according to claim 3, wherein said determining the similarity of the first hash vector and the second hash vector comprises: calculating a difference between the first hash vector and the second hash vector; The determining whether the content of the first video is consistent with the content of the second video according to the similarity comprises the following steps: And if the difference value is smaller than a preset threshold value, determining that the content of the first video is consistent with that of the second video.
  5. 5. The method according to any one of claims 1 to 4, wherein extracting the first video frame from the first video using a preset sampling algorithm comprises: Sampling the first video frame from the first video successively according to the number of interval frames; the extracting the second video frame from the second video by using the preset sampling algorithm includes: the second video frames are sampled successively from the second video in accordance with the number of interval frames.
  6. 6. The video matching method of claim 5, further comprising: Extracting one video from the first video set as a first video; Determining a number of video frames contained in the first video; And screening at least one second video from the second video set according to the number of video frames contained in the first video.
  7. 7. A video matching apparatus, comprising: The first sampling module is used for extracting a first video frame from the first video by using a preset sampling algorithm; the second sampling module is used for extracting a second video frame from a second video by utilizing the preset sampling algorithm, wherein the first video and the second video correspond to different coding parameters; the first determining module is used for determining hash values of the first video frames and hash values of the second video frames; And the second determining module is used for determining whether the contents of the first video and the second video are consistent according to the hash value of each first video frame and the hash value of each second video frame.
  8. 8. An electronic device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements the video matching method of any of claims 1 to 6 when the computer program is executed by the processor.
  9. 9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the video matching method according to any of claims 1 to 6.
  10. 10. A video matching system, the system comprising a server and a plurality of clients; The server determines matching videos in two video sets to be matched by using a preset hash algorithm; removing the video which is determined to be matched from the two video sets to be matched to obtain a first video set and a second video set; sending the first video set and the second video set to the client to cause the client to perform the method of claim 6 for the first video set and the second video set to continue screening matching videos from the first video set and the second video set.

Description

Video matching method, device, electronic equipment, storage medium and system Technical Field The present invention relates to the field of computer technologies, and in particular, to a video matching method, apparatus, electronic device, storage medium, and system. Background With the rapid development of internet technology, the volume of video data has shown an explosive growth. The trend provides serious challenges for video management, retrieval and copyright protection, namely on one hand, the traditional manual auditing mode is difficult to deal with massive data due to low efficiency, so that the auditing period of the content is long and the cost is high, and on the other hand, the existing automatic technology has obvious defects, such as that although the matching method based on file hash can quickly identify the completely same video, the matching method is not suitable for the content bundles with similar vision but different files generated by coding parameter differences (such as different resolutions and code rates) or slight editing (such as adding watermarks and editing fragments). Therefore, how to accurately and efficiently execute the matching task of a large number of video files is a technical problem to be solved. Disclosure of Invention The invention provides a video matching method, a device, electronic equipment, a storage medium and a system, which are used for solving the defects in the prior art and accurately and efficiently executing matching tasks of a large number of video files. The invention provides a video matching method, which comprises the following steps. The method comprises the steps of extracting first video frames from first videos by means of a preset sampling algorithm, extracting second video frames from second videos by means of the preset sampling algorithm, determining hash values of the first video frames and hash values of the second video frames, and determining whether contents of the first videos and the second videos are consistent according to the hash values of the first video frames and the hash values of the second video frames, wherein the first videos and the second videos correspond to different coding parameters. The video matching method provided by the invention is characterized in that whether the content of the first video is consistent with the content of the second video is determined according to the hash value of each first video frame and the hash value of each second video frame, and the video matching method comprises the steps of obtaining a first hash vector according to the hash value of each first video frame, obtaining a second hash vector according to the hash value of each second video frame, and determining whether the content of the first video is consistent with the content of the second video according to the first hash vector and the second hash vector. According to the video matching method provided by the invention, the determining whether the contents of the first video and the second video are consistent according to the first hash vector and the second hash vector comprises the following steps: determining a similarity of the first hash vector and the second hash vector; and determining whether the contents of the first video and the second video are consistent according to the similarity. According to the video matching method, the similarity of the first hash vector and the second hash vector is determined, the method comprises the steps of calculating the difference value between the first hash vector and the second hash vector, and determining whether the content of the first video is consistent with the content of the second video according to the similarity, wherein the method comprises the step of determining that the content of the first video is consistent with the content of the second video if the difference value is smaller than a preset threshold value. According to the video matching method provided by the invention, the first video frame is extracted from the first video by using a preset sampling algorithm, and the method comprises the following steps: The method comprises the steps of sampling the first video frames from the first video successively according to the interval frame number, and extracting the second video frames from the second video by utilizing the preset sampling algorithm, wherein the step of sampling the second video frames from the second video successively according to the interval frame number is carried out. The video matching method further comprises the steps of extracting one video from the first video set to serve as a first video, determining the number of video frames contained in the first video, and screening at least one second video from the second video set according to the number of video frames contained in the first video. The invention also provides a video matching device, which comprises the following modules: The video processing device comprises a first