3 # Use: $index $thumb $file_pattern
5 if [ \! -e "$thumb" ] && { printf %s "$file" |grep -qE "$file_pattern"; }; then
8 | mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0 "$file" 2>&- \
10 s:ID_LENGTH=(.*)(\..*)$:\1:p;
11 s:ID_VIDEO_HEIGHT=(.*):\1:p;
12 s:ID_VIDEO_WIDTH=(.*):\1:p;' \
17 [ "$((h * 1000 / w))" -gt "750" ] \
18 && w="$((75 * w / h))" || w=100
19 chunk="$((${l:-10} / 5))"
22 for cnt in 1 2 3 4; do
24 | mplayer -input nodefault-bindings -nosound -benchmark \
25 -noconfig all -really-quiet \
26 -frames 1 -ss "$((cnt * chunk))" \
27 -vf "framestep=I,scale=${w}:-2" \
28 -vo "jpeg:quality=100:outdir=${tmp}" \
30 mv "${tmp}/00000001.jpg" "${tmp}/_${cnt}.jpg"
33 | mplayer -input nodefault-bindings -nosound -benchmark \
34 -noconfig all -really-quiet \
35 -vf scale=159:-2,tile=2:2:4:0:2 \
36 -vo "jpeg:quality=96:outdir=${tmp}"\
37 "mf://$tmp/_*.jpg" 2>&-
39 mv "${tmp}/00000001.jpg" "$thumb"
42 elif [ \! -e "$thumb" ]; then