开发者

How to compare two .mp4 files?

开发者 https://www.devze.com 2023-04-01 19:28 出处:网络
I would like to compare two mp4 files, does s开发者_开发问答omebody has an idea? Maybe by interposing the video spectrum?

I would like to compare two mp4 files, does s开发者_开发问答omebody has an idea? Maybe by interposing the video spectrum?

Thanks.


I had an idea for this a while back. I never implemented it, but it went something like this:

  • Get a good video library to do the heavy lifting for you, I like Aforge.NET
  • Use the library to walk through the video and extract bitmap frames, get a few hundred
  • Fix the resolution to a single aspect ratio
  • Reduce the images to something low-res like 16x16 or 64x64, using a nearest neighbor approach. This will blur the image such that two similar images will reduce to the same
  • Gather a chunk of these images by relative video timestamp and hash them to further reduce the data
  • Compare said hashes

Again, I never implemented this, so I don't know if it works, but the thing it has going for it is that video is very complex. While comparing any given frame to another won't work, based on different formats, resolutions, etc., the odds of a series of reduced hashes being the same from two different videos seems very low. Thus, few false positives. Also it seems like it could also tell you if one span of video was contained in another.

If I get around to making something like this I'll circle back here and post about it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号