#!/bin/bash source fonctions.sh set -e ; set -u TYPE="mp4" NBFRAMES=180 case $TYPE in "gif89a") DIMS="-W640 -H480" ;; "mp4") DIMS="-W1024 -H768" ;; esac POVOPT="+q9 +a0.02 -d ${DIMS} -WT8" 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) set +e povray ${POVOPT} +K${frame} -iscene.pov -o${TMPIMG} err=$? if [ $err != 0 ] ; then echo "fail $frame" >> WS/log continue fi set -e txt=$(printf "#%03d" $frame) echo $frame $img $txt convert ${TMPIMG} \ -pointsize 20 \ -fill orange \ -gravity south \ -annotate +0+0 "$txt" \ ${img} fin=$(date +%s) echo echo $frame $(( fin - debut )) | tee -a WS/${TYPE}.timing echo done echo case $TYPE in "gif89a") convert -delay 8 -dither none \ -colors 109 frames/* foo.gif ;; "mp4") ff_encodage ;; esac ls -lh foo.gif