From: paul Date: Fri, 7 Aug 2015 16:47:41 +0000 (+0000) Subject: cleaned up meta gnerator X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=b6d914a4ee1b64a318b17207b92d791af5c8d658;p=serve0 cleaned up meta gnerator svn path=/trunk/; revision=79 --- diff --git a/helpers/genmeta.sh b/helpers/genmeta.sh index 805bde1..c41c491 100755 --- a/helpers/genmeta.sh +++ b/helpers/genmeta.sh @@ -8,12 +8,15 @@ if [ -r "$meta" ]; then description="$(sed -n '3,$p' "$meta")" fi -eval $(mplayer -noconsolecontrols -input file=/dev/null -slave -really-quiet -identify -frames 0 -ao null -vo null "$video" |sed -rn 's:ID_VIDEO_WIDTH=(.*):width=\1:p;s:ID_VIDEO_HEIGHT=(.*):height=\1:p;s:ID_LENGTH=(.*)(\..*)$:length=\1:p;') - -[ -z "$tags" ] && tags='|' +mplayer -really-quiet -identify -frames 0 -nosound -vo null "$video" \ +| sed -rn 's:ID_VIDEO_WIDTH=(.*):\1:p; + s:ID_VIDEO_HEIGHT=(.*):\1:p; + s:ID_LENGTH=(.*)(\..*)$:\1:p;' \ +| tr '\n' ' ' \ +| read width height length cat <"$meta" -$length $width $height $(basename "$video") -$tags -$description +${length:-0} ${width:-0} ${height:-0} ${video##*/} +${tags:-|} +${description} EOF