aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/chkmd5m
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-10-12 16:57:43 +0300
committerawy <awy@awy.one>2025-10-12 16:57:43 +0300
commit57f4c61d689fc389d75007796d5ac1a13e791e55 (patch)
tree439e1e61389db568db9c1aea33587fc38a5742f1 /.local/bin/chkmd5m
parentdb5eb3d18c944187a211b20f4be46fe6c0dbfbaa (diff)
downloadhyprdots-57f4c61d689fc389d75007796d5ac1a13e791e55.tar.gz
chkmd5m
Diffstat (limited to '.local/bin/chkmd5m')
-rwxr-xr-x.local/bin/chkmd5m31
1 files changed, 31 insertions, 0 deletions
diff --git a/.local/bin/chkmd5m b/.local/bin/chkmd5m
new file mode 100755
index 0000000..df0fa6b
--- /dev/null
+++ b/.local/bin/chkmd5m
@@ -0,0 +1,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