Compare FFmpeg Video Signatures for Copyright

This article provides a practical guide on how to compare video fingerprints generated by the FFmpeg signature filter to detect copyright infringement. You will learn how to generate unique signature files for your original videos, compare suspected videos against those signatures, and interpret FFmpeg’s output to automate the detection of unauthorized duplication.

Understanding FFmpeg Video Signatures

The FFmpeg signature filter generates a robust, content-based fingerprint of a video stream. Unlike cryptographic hashes (like MD5 or SHA-256), which change completely if a single pixel or bit is modified, video signatures analyze the visual content. This makes them highly effective for detecting copyright infringement because they can identify matches even if the video has been:


Step 1: Generate a Signature File for the Original Video

To build a database of copyrighted content, you must first generate and save the binary signature of your original video. Run the following command to output a signature file:

ffmpeg -i original_video.mp4 -vf "signature=format=binary:filename=original_signature.bin" -map 0:v -f null -

Step 2: Compare a Suspected Video Against the Signature

To check if a suspected video infringes on your copyrighted original, you can compare the suspected video directly against the previously saved .bin signature file.

Run the following command:

ffmpeg -i suspected_video.mp4 -vf "signature=detect=on:nb_inputs=1:filenames=original_signature.bin" -f null -

Step 3: Compare Two Video Files Directly

If you have both video files on hand and do not want to generate separate signature files first, you can compare them side-by-side in real-time using a complex filtergraph:

ffmpeg -i original_video.mp4 -i suspected_video.mp4 -filter_complex "[0:v][1:v]signature=detect=on" -f null -

FFmpeg will analyze the visual streams of both inputs simultaneously and calculate the similarity.


Step 4: Interpret the Matching Results

When the comparison command runs, FFmpeg outputs the match status to the console (stderr). Look for lines containing Parsed_signature in the console log.

A successful match output will look similar to this:

[Parsed_signature_0 @ 0x55bbf890] Match of src 0 and src 1 at 12.000000s and 12.050000s, duration 45.300000s frames 1132

Key Metrics to Analyze:

If the videos are completely different, the console will not output any “Match of src…” lines, confirming that no copyright infringement was detected based on visual fingerprints.