четверг, 5 января 2012 г.

screenlister.sh


screenlister.sh 3x10 thumbs

#!/bin/sh
picdir="$HOME/Pictures/";
cd uploader;
for video in `ls .`;
do
vlc --start-time 300 --snapshot-path ${picdir}${video}_screenshot.png --snapshot-format png ${video};
convert ${picdir}${video}_screenshot.png ${picdir}${video}_screenshot.jpg;
rm ${picdir}${video}_screenshot.png;
count=1;
percent=1;
while [ "$count" -lt 31 ];
do
ffmpegthumbnailer -i${video} -o${picdir}${video}_tmp_${count}.jpg -s250 -t${percent}%;
percent=$((percent+3));
count=$((count+1));
done;
count=1;
countrows=0;
while [ "$countrows" -lt 10 ];
do
countcells=0;
triofiles="";
while [ "$countcells" -lt 3 ];
do
triofiles="$triofiles ${picdir}${video}_tmp_${count}.jpg";
count=$((count+1));
countcells=$((countcells+1));
done
convert $triofiles +append ${picdir}${video}_tmp_trio_${countrows}.jpg;
rm $triofiles;
countrows=$((countrows+1));
done
convert ${picdir}*trio* -append ${picdir}${video}_screenlist.jpg;
rm ${picdir}*trio*;
done