summary refs log tree commit diff
path: root/bin/mpvdiff
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2020-12-03 13:06:25 +0100
committerRobert Günzler <r@gnzler.io>2020-12-07 19:28:05 +0100
commita81561f16b2a3d533e09a4e92a8f71efcf11ddbf (patch)
treee6207baf41829ef24e89fab050b3e2dd48b6c169 /bin/mpvdiff
parent0eebaefb774e215fa1be915c0062d6bab4cdfb8c (diff)
Add bin/mpvdiff; allows diff'ing 2 or 4 vidoes/images
Diffstat (limited to 'bin/mpvdiff')
-rwxr-xr-xbin/mpvdiff24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/mpvdiff b/bin/mpvdiff
new file mode 100755
index 0000000..a218709
--- /dev/null
+++ b/bin/mpvdiff
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+[ -n "$DEBUG" ] && set -x
+
+args="--title=mpvdiff --hwdec=v4l2m2m-copy"
+
+if [ "$1" = "-h" ]; then
+	printf "usage: %s [-2|-4] VIDEO..." "$(basename "$0")"
+	exit 2
+
+elif [ "$1" = "-4" ]; then
+	shift
+	mpv "$1" \
+		--external-file="$2" \
+		--external-file="$3" \
+		--external-file="$4" \
+		--lavfi-complex='[vid1][vid2]scale2ref[1][2];[1][2]hstack[t1] ; [vid3][vid4]scale2ref[3][4];[3][4]hstack[t2] ; [t1][t2]scale2ref[5][6];[5][6]vstack[vo]' \
+		"$args"
+else
+	mpv "$1" \
+		--external-file="$2" \
+		--lavfi-complex='[vid1][vid2]scale2ref[1][2];[1][2]hstack[vo]' \
+		"$args"
+fi