X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/71374e317e21caa32624f4529034896db103cbdb..5251deb253a8da7a1e17a9e35a357968aa8c99ee:/bin/rename-video.sh diff --git a/bin/rename-video.sh b/bin/rename-video.sh index 017179d..637bdfe 100755 --- a/bin/rename-video.sh +++ b/bin/rename-video.sh @@ -4,16 +4,15 @@ get_videoinfo() { 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