2024-12-16 03:53:42 +11:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source fonctions.sh
|
|
|
|
|
|
|
|
set -e ; set -u
|
|
|
|
|
|
|
|
TYPE="gif89a"
|
|
|
|
NBFRAMES=180
|
|
|
|
|
|
|
|
case $TYPE in
|
2024-12-17 00:18:21 +11:00
|
|
|
"gif89a") DIMS="-W640 -H480" ;;
|
2024-12-16 03:53:42 +11:00
|
|
|
"mp4") DIMS="-W1280 -H1024" ;;
|
|
|
|
esac
|
2024-12-17 00:18:21 +11:00
|
|
|
POVOPT="+q9 +a -d ${DIMS} -WT6"
|
2024-12-16 03:53:42 +11:00
|
|
|
echo $POVOPT ; echo ; sleep 2
|
|
|
|
|
|
|
|
TMPIMG=/dev/shm/tmpimg.png
|
|
|
|
|
|
|
|
for frame in $(seq 0 $((NBFRAMES-1)))
|
|
|
|
do
|
|
|
|
img=$(printf "frames/%05d.png" $frame)
|
|
|
|
|
|
|
|
debut=$(date +%s)
|
|
|
|
povray ${POVOPT} +K${frame} -iscene.pov -o${TMPIMG}
|
|
|
|
|
|
|
|
txt=$(printf "#%03d" $frame)
|
|
|
|
echo $frame $img $txt
|
|
|
|
convert ${TMPIMG} \
|
|
|
|
-pointsize 14 \
|
2024-12-17 00:18:21 +11:00
|
|
|
-fill green \
|
2024-12-16 03:53:42 +11:00
|
|
|
-gravity south \
|
|
|
|
-annotate +0+0 "$txt" \
|
|
|
|
${img}
|
|
|
|
fin=$(date +%s)
|
|
|
|
echo
|
|
|
|
echo $frame $(( fin - debut )) | tee -a WS/timing
|
|
|
|
echo ; echo
|
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
case $TYPE in
|
|
|
|
"gif89a") convert -delay 8 -dither none \
|
|
|
|
-colors 102 frames/* foo.gif ;;
|
|
|
|
esac
|
|
|
|
ls -lh foo.gif
|
|
|
|
|