#!/bin/bash

source config.sh

DDIR="frames/essai"
DSTOPT="/dev/shm/essai-altitude.png"

for i in $(seq 0 $NBIMG)
do

	dst=$(printf "%s/%05d.png" $DDIR $i)
	tag=$(printf "%04d:0x%08x from epoch." $i $(date +'%s'))
	echo $dst " / " $tag

	povray -iscene +K$i ${POVOPT} -o${DSTOPT} 2> /dev/null

	convert   $DSTOPT					\
			-font		Courier-Bold		\
			-pointsize	28			\
			-fill		Orange			\
			-annotate +15+25 "${tag}"		\
			$dst

	sleep 25

done

echo "Encoding now..." ; echo

exec ./encode.sh "$DDIR" altitudes.mp4

