]> git.plutz.net Git - serve0/commitdiff
mplayer command line compatibility with older versions
authorpaul <paul@plutz.net>
Sun, 30 Aug 2015 15:24:41 +0000 (15:24 +0000)
committerpaul <paul@plutz.net>
Sun, 30 Aug 2015 15:24:41 +0000 (15:24 +0000)
svn path=/trunk/; revision=87

helpers/genmeta.sh
helpers/genthumb.sh

index f028d774b5fe7acaad22efab1a905d77c389adb1..ceeebe307bdcf8abbc78ae8f58d1dc1cc5fbf843 100755 (executable)
@@ -14,7 +14,7 @@ echo '' |mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0
            s:ID_VIDEO_HEIGHT=(.*):\1:p;
            s:ID_VIDEO_WIDTH=(.*):\1:p;' \
 | tr '\n' ' ' \
-| read length height width
+| read length height width 2>/dev/null
 
 cat <<EOF >"$meta"
 ${length:-0}   ${width:-0}     ${height:-0}    ${video##*/}
index 9eec8f358f0dab8c85ad44f8ba9d24a63e61df54..d74d250e56c4ab159907df01633ec167e3ddbc08 100755 (executable)
@@ -10,7 +10,7 @@ if [ -e "$video" -a \! -e "$thumb" ]; then
              s:^.*ID_VIDEO_HEIGHT=(.*)$:\1:p;
              s:^.*ID_VIDEO_WIDTH=(.*)$:\1:p;' \
   | tr '\n' ' ' \
-  | read length height width
+  | read length height width 2>/dev/null
   
   [ "$(($height * 1000 / $width))" -gt "750" ] && width="$((75 * $width / $height))" \
                                            || width=100
@@ -20,7 +20,7 @@ if [ -e "$video" -a \! -e "$thumb" ]; then
   tmp="$(mktemp -d)"
   for cnt in 1 2 3 4; do
     echo '' |mplayer -input nodefault-bindings -nosound -vo jpeg:outdir="$tmp" -frames 1 \
-             --benchmark -vf framestep=I,scale="$width":-2 -ss "$(($cnt*$chunk))" "$video"
+             -benchmark -vf framestep=I,scale="$width":-2 -ss "$(($cnt*$chunk))" "$video" >/dev/null 2>/dev/null
     mv "$tmp/00000001.jpg" "${tmp}/_${cnt}.jpg"
   done
   montage "${tmp}"/_[1234].jpg -tile 2x2+0+0 -geometry 100x75+3+3 -background '#000000' "${thumb}"