#!/bin/bash

source config.sh

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

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

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

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

	convert   $DSTOPT					\
			-font		Courier-Bold		\
			-pointsize	32			\
			-fill		"$COLTXT_A"		\
			-gravity	South-East		\
			-annotate +22+21 "${tag}"		\
			$dst

	sleep 3

done

echo "Encoding now..." ; echo

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

