I have a bunch of wmv files (~300), named the following way: video1.wmv -> videox.wmv. Some of these video files, are exact duplicates of one another (same format, same bitrate, same length, basically, they were copied and renamed, so the only thing that differs from them is their name). Is there any way to find out if two video files from this group are identical or not, so I would be able to filter out the duplicate ones?

Comparing their size is unfortunately out of the question, because I manually went through some of them, and because each of them is around the same length(even the non duplicate ones), some have identical sizes, but they are not identical per se.

If there is a possibility, I would prefer a method which could be implemented as a PHP script, but any other method of comparing them would be welcome.



closed as off-topic by Evil, David Richerby, Raphael Nov 8 '16 at 17:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about computer science, within the scope defined in the help center." – Evil, David Richerby, Raphael
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Welcome to CS.SE! Coding questions and requests for software products are off-topic here; see our help center. This site is for algorithms, concepts, and the science. $\endgroup$ – D.W. Nov 3 '16 at 4:33
  • $\begingroup$ I agree. This question would probably have been a good fit on Super User. $\endgroup$ – Raphael Nov 8 '16 at 17:03

A general algorithm is to compute the SHA256 hash of each file, then sort the hashes and look for duplicates. After sorting any duplicates that may exist will be consecutive. For all practical purposes, you can assume that two files will be identical if and only if their SHA256 hash is the same.

If you're asking how to do this from the command line or looking for a product recommendation, take a look at this:


Not the answer you're looking for? Browse other questions tagged or ask your own question.