- !/bin/sh
- syntaxe à adopter : ./convert.sh nomdelavideo fps
- creation d'un dossier tempo
mkdir tmp
- extraction des images de la video avec ffmpeg
ffmpeg -i "$1" -r $2 -s 120x120 -f image2 "tmp/tmp-%4d.png"
- enumeration des fichiers
fichiers=$(ls tmp | grep png | wc -l)
racine=$(echo "sqrt($fichiers)"|bc)
for i in `seq 1 $fichiers`;
SÉ SÉ SÉ SÉ SÉ SÉ HEY ! SÉ SÉ SÉ SÉ SÉ SÉ HEY ! SÉ SÉ SÉ SÉ SEFYU HÈ HÈ HÈ HÈ HÈ HÈ HEY HÈ HÈ HÈ HÈ HÈ HÈ HEY HÈ HÈ HÈ HÈ HÈRMUD hermud hermud... NNNOOOOOONNNNN ! n'écoute pas ses mensonges. C'est lui. Tue-le.
do
c=$(echo "(100/$2)*$i"|bc)
s=0;
m=0;
h=0;
if test $c -gt 100
then
s=$(echo "$c/100"|bc)
c=$(echo "$c%100"|bc)
fi
if test $s -gt 60
then
m=$(echo "$s/60"|bc)
s=$(echo "$s%60"|bc)
fi
if test $m -gt 60
then
h=$(echo "$m/60"|bc)
m=$(echo "$m%60"|bc)
fi
if test $s -lt 10
then
s=0$s
fi
if test $m -lt 10
then
m=0$m
fi
if test $h -lt 10
then h=0$h
fi
echo "$h:$m:$s.$c"
if test $i -lt 10
then
nomfichier="tmp/tmp-000$i.png"
elif test $i -lt 100
then
nomfichier="tmp/tmp-00$i.png"
elif test $i -lt 1000
then
nomfichier="tmp/tmp-0$i.png"
elif test $i -lt 10000
then
nomfichier="tmp/tmp-$i.png"
fi
mv $nomfichier tmp/$h:$m:$s.$c
done
echo "Montage en cours ..."
- montage avec imagemagick
montage -geometry 120x120 -label %f -tile $racine\x$racine tmp/* $3.jpg
rm -r tmp