rety ffprobe with stream_tags if format_tags is empty

This commit is contained in:
2021-02-07 00:01:37 +01:00
parent 7fa366d83d
commit 15c5ee571f

View File

@@ -116,7 +116,12 @@ function read_tag_id3 {
function ffprobe_readtag {
local tag="$1"
local file="$2"
ffprobe -loglevel error -show_entries format_tags="$tag" -of default=noprint_wrappers=1:nokey=1 "$file"
local result=
result=$(ffprobe -loglevel error -show_entries format_tags="$tag" -of default=noprint_wrappers=1:nokey=1 "$file")
if [[ -z $result ]]; then
result=$(ffprobe -loglevel error -show_entries stream_tags="$tag" -of default=noprint_wrappers=1:nokey=1 "$file")
fi
echo "$result"
}
function read_tag_fallback {