local -a mediainfo
IFS=,
mediainfo=( $(mediainfo --Output='Video;%Width%,%Height%,%ScanType%,%Format%,%Codec%' "$1") )
- mediainfo=( $(ffprobe -select_streams v -show_entries stream=codec_name,width,height -of compact "$1" 2> /dev/null) )
+ #TODO ffprobe returns better parseable output but doesn't give info on scan_type (use it for audio only?)
+# IFS='|'
+# mediainfo=( $(ffprobe -select_streams v -show_entries stream=codec_name,width,height -of compact=nk=1 -i file:"$1" 2> /dev/null) )
local width=${mediainfo[0]}
local height=${mediainfo[1]}
local scan=${mediainfo[2]}
local format=${mediainfo[3]}
local codecid=${mediainfo[4]}
- echo ${mediainfo[@]}
- return
-
# same tests xbmc does:
# https://github.com/xbmc/xbmc/blob/master/xbmc/utils/StreamDetails.cpp#L514
if (( $width <= 720 && $height <= 480 )); then