HexaCone/mkloop.sh

56 lines
928 B
Bash
Raw Normal View History

2024-12-16 03:53:42 +11:00
#!/bin/bash
source fonctions.sh
set -e ; set -u
2024-12-21 00:24:45 +11:00
TYPE="mp4"
2024-12-23 01:05:36 +11:00
NBFRAMES=360
2024-12-16 03:53:42 +11:00
case $TYPE in
2024-12-17 00:18:21 +11:00
"gif89a") DIMS="-W640 -H480" ;;
2024-12-21 00:24:45 +11:00
"mp4") DIMS="-W1024 -H768" ;;
2024-12-16 03:53:42 +11:00
esac
2024-12-21 00:24:45 +11:00
POVOPT="+q9 +a0.02 -d ${DIMS} -WT8"
2024-12-16 03:53:42 +11:00
echo $POVOPT ; echo ; sleep 2
TMPIMG=/dev/shm/tmpimg.png
2024-12-23 01:05:36 +11:00
for frame in $(seq 0 $((NBFRAMES-1)))
2024-12-16 03:53:42 +11:00
do
img=$(printf "frames/%05d.png" $frame)
debut=$(date +%s)
2024-12-21 00:24:45 +11:00
set +e
2024-12-16 03:53:42 +11:00
povray ${POVOPT} +K${frame} -iscene.pov -o${TMPIMG}
2024-12-21 00:24:45 +11:00
err=$?
if [ $err != 0 ] ; then
echo "fail $frame" >> WS/log
2024-12-23 01:05:36 +11:00
sleep 4
2024-12-21 00:24:45 +11:00
continue
fi
set -e
2024-12-16 03:53:42 +11:00
txt=$(printf "#%03d" $frame)
echo $frame $img $txt
convert ${TMPIMG} \
2024-12-23 01:05:36 +11:00
-pointsize 24 \
2024-12-18 02:47:24 +11:00
-fill orange \
2024-12-16 03:53:42 +11:00
-gravity south \
-annotate +0+0 "$txt" \
${img}
fin=$(date +%s)
echo
2024-12-21 00:24:45 +11:00
echo $frame $(( fin - debut )) | tee -a WS/${TYPE}.timing
echo
2024-12-16 03:53:42 +11:00
done
echo
case $TYPE in
"gif89a") convert -delay 8 -dither none \
2024-12-23 01:05:36 +11:00
-colors 102 frames/* foo.gif ;;
2024-12-21 00:24:45 +11:00
"mp4") ff_encodage ;;
2024-12-16 03:53:42 +11:00
esac
ls -lh foo.gif