Python method or class to compare two video files?
Question: I'm trying to write a program to compare files and show the duplicates in
python. Anyone know any good functions or methods related to this? I am sorta
lost...


Answer: If you're just looking for exact duplicates, do an [MD5
hash](http://docs.python.org/library/hashlib.html#module-hashlib) on both and
see if they match:

    
    
    import hashlib
    
    file1 = open('file1.avi', 'r').read()
    file2 = open('file2.avi', 'r').read()
    
    if hashlib.sha512(file1).hexdigest() == hashlib.sha512(file2).hexdigest():
      print 'They are the same'
    else:
      print 'They are different'
    

If not, I'd try [OpenCV's Python
Bindings](http://opencv.willowgarage.com/documentation/python/index.html) and
check if they match up frame by frame.

