RJM
RJM

Reputation: 43

Using OpenCV to detect two near-similar videos

I have a directory of clips, some of which are very similar. By this I mean that they may share 30 seconds of the same footage, but may differ at the start/end of the video.

Specifically, they're clips from streams on twitch.tv. As such, if 2 people were to capture some "action", and one person clips the action 5 seconds before the other, I'd need to detect those two clips as duplicates.

Currently I've made a program to compare the MD5 hashes of the frames in both videos, however it doesn't find any duplicates for me. I don't think it's the program that's wrong, because I manually checked the MD5's of the duplicate frames and they were different. Is what I'm trying to do possible before I keep trying to fix it?

Upvotes: 1

Views: 1888

Answers (1)

AKX
AKX

Reputation: 169052

MD5 hashes of frames aren't going to work, since the videos are compressed, and compression inevitably causes differences in the frame.

You might want some sort of image hash instead, like phash for instance.

Upvotes: 3

Related Questions