#!/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