bin: update ffprobe commands

This commit is contained in:
xeruf 2022-05-12 11:32:39 +02:00
parent 18d0354522
commit bb748f6851
2 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,7 @@ fileinfo() {
for arg for arg
do case "$arg" in (-*) continue;; esac do case "$arg" in (-*) continue;; esac
$elevate file -E "$arg" $elevate file -E "$arg"
# TODO do not grep bitrate but extract properly
#probe="$($elevate ffprobe "$arg" 2>&1)" #probe="$($elevate ffprobe "$arg" 2>&1)"
#echo $probe | grep -v -e '00:00:00.04' -e 'ansi' && #echo $probe | grep -v -e '00:00:00.04' -e 'ansi' &&
$elevate ffprobe -hide_banner "$arg" 2>&1 | grep "bitrate: ....\? " | sed 's/, start:[^,]\+,/,/' || $elevate ffprobe -hide_banner "$arg" 2>&1 | grep "bitrate: ....\? " | sed 's/, start:[^,]\+,/,/' ||

View File

@ -1,10 +1,11 @@
#!/bin/sh #!/bin/sh
# View song metadata using ffprobe # View song metadata using ffprobe
# Accepts filenames from args or stdin (one file per line) # Accepts filenames from args or stdin (one file per line)
# TODO only print header when interactive
if test "$#" -eq 0 if test "$#" -eq 0
then cat then cat
else printf '%s\n' "$@" else printf '%s\n' "$@"
fi | while read f; do fi | while read f; do
highlight "$f" highlight "$f"
find "$f" -type f -exec ffprobe -hide_banner {} 2>&1 \; #| grep -A90 'Metadata:' find "$f" -type f -exec ffprobe -loglevel warning -print_format default=noprint_wrappers=1 -show_format -pretty {} \;
done | less done | less