xf是我家媳妇 发表于 2013-2-18 22:02
俺木葡萄号让偶怎么kan..... - #!/bin/bash
- R=3
- C=3
- PIC_NUM=$[R*C]
- if [ $# -ne 1 ]
- then
- echo "Usage: `basename $0` /path/to/file"
- exit 1
- fi
- if test -f "$1"
- then
- echo $1
- else
- echo "File $1 not found"
- exit 1
- fi
- #DANGER :)
- rm *.jpg &>/dev/null
- LENGTH=`mplayer -identify -nosound -vc dummy -vo null $1|grep ID_LENGTH|sed -r 's/ID_LENGTH=([[:digit:]]*)(\.[[:digit:]]*)?/\1/g'`
- let SSTEP=$LENGTH/$PIC_NUM
- mplayer $1 -volume 0 -ss 5 -vo jpeg:quality=90 -frames $PIC_NUM -sstep $SSTEP
- let M=$LENGTH/60
- echo "Vedio:$LENGTH($M) -sstep:$SSTEP"
- let X=1024/$R
- let Y=768/$C
- echo "montage.jpg: ${R}x${C}/${X}x${Y}..."
- RESIZE=${X}x${Y}
- TILE=${R}x${C}
- montage *.jpg -quality 90 -resize $RESIZE -geometry +3+3 -shadow -tile $TILE montage.jpg
- exit 0
复制代码 需要 mplayer , imagemagick。大致就是这样 |