bin/dif: refine ffprobe

This commit is contained in:
xeruf 2022-05-11 13:18:27 +02:00
parent 8e0b868c4a
commit 93f9a5687d
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh
# interactive diff with pagination and nice coloring
if file --mime "$1" "$2" | grep --quiet audio
then $(test $(tput cols) -gt 120 && echo "diff --color=always --side-by-side" || echo "diff-color") --label="$1" --label="$2" <(ffprobe -hide_banner "$1" 2>&1 | tail +2) <(ffprobe -hide_banner "$2" 2>&1 | tail +2 )
then ff() { ffprobe -loglevel warning -print_format default=noprint_wrappers=1 -show_format -pretty "$@"; }
$(test $(tput cols) -gt 120 && echo "diff --color=always --side-by-side" || echo "diff-color") --label="$1" --label="$2" <(ff "$1") <(ff "$2")
else diff-color "$@"
fi | less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen