X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=helpers%2Fgenmeta.sh;h=c41c49155895a3f42550033084288594af6e1b0b;hb=b6d914a4ee1b64a318b17207b92d791af5c8d658;hp=805bde13784287a2f2ff7e92ce3af525283fb354;hpb=a239b304b2c9c58b9efc1990033fae701785c023;p=serve0 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