5 exec >/dev/null 2>/dev/null
7 mplayer -really-quiet -identify -frames 0 -nosound -vo null "$video" \
8 | sed -rn 's:ID_VIDEO_WIDTH=(.*):\1:p;
9 s:ID_VIDEO_HEIGHT=(.*):\1:p;
10 s:ID_LENGTH=(.*)(\..*)$:\1:p;' \
12 | read width height length
14 [ -z "$length" -o -z "$width" -o -z "$height" ] && exit 0
16 [ "$(($height*1000/$width))" -gt "750" ] && width="$((75*$width/$height))" \
18 [ -z $width ] && width=100
19 chunk="$(($length / 5))"
23 for cnt in 1 2 3 4; do
24 mplayer -nosound -vo jpeg:outdir="$tmp" -frames 1 -benchmark -vf framestep=I,scale="$width":-2 -ss "$(($cnt*$chunk))" "$video" &
25 mpid="$!"; for watch in {1..10}; do
26 ps -p "$mpid" && sleep 1
28 ps -p "$mpid" && kill -9 "$mpid"
29 mv "$tmp/00000001.jpg" "${tmp}/${thumb}-${cnt}.jpg"
31 montage "${tmp}/${thumb}"-[1234].jpg -tile 2x2+0+0 -geometry 100x75+3+3 -background '#000000' "${thumb}"