blob: df0fa6bdea8e642ece76ecdfb5241edb813de275 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 | #!/bin/sh
# Compare MD5 hashes of audio streams from multiple files using ffmpeg
if [ "$#" -lt 2 ]; then
    echo "Usage: $0 <file1> <file2> [file3 ...]"
    exit 1
fi
get_md5() {
    ffmpeg -v error -i "$1" -map 0:a:0 -f md5 - 2>/dev/null | cut -d= -f2
}
echo "Comparing audio hashes:"
echo
first_file=$1
first_hash=$(get_md5 "$first_file")
echo "$first_file : $first_hash"
shift
for file in "$@"; do
    hash=$(get_md5 "$file")
    echo "$file : $hash"
    if [ "$hash" = "$first_hash" ]; then
        echo "✅ Matches $first_file"
    else
        echo "❌ Differs from $first_file"
    fi
    echo
done
 |