#!/bin/bash

source config.sh

DDIR="frames/cylinder"
DSTOPT="/dev/shm/cylinder-altitude.png"
FIMGTMP="/dev/shm/cylinder-cumul.fimg"

# rm "WS/log.timelapse"

DEBUT=$(date +'%s')

for i in $( seq 0 $((NBIMG - 1)) )
do

	dst=$(printf "%s/%05d.png" $DDIR $i)
	echo $dst

	povray -icylinder +K$i ${POVOPT} -o${DSTOPT} 2> ERR6

	convert ${DSTOPT}					\
			-font		Courier-Bold		\
			-fill		Black			\
			-pointsize	48			\
			-annotate +51+51 "${dst}"		\
			$dst

	sleep 88

done

echo "Encoding now..." ; echo
exec ./encode.sh   "$DDIR"   "cylinder-hf.mp4"

