#!/bin/bash

source ./fonctions.sh

set -e

make adhoc

SRCDIR="capture"
DSTDIR="p8"
TGATMP="/dev/shm/panasonic.tga"

RGB="log.rgb"
> $RGB
rm $DSTDIR/*.png

IDXDST=0

#		-----------------------------------------


#	texte=$(basename $src)
#		-font Courier-Bold		\
#		-pointsize 20			\
#		-fill gray10			\
#		-annotate +33+28 $texte		\
#		-fill gray90			\
#		-annotate +30+25 $texte		\


#		-----------------------------------------

for src in $SRCDIR/*.fimg
do
	dst=$( printf "%s/%05d.png" $DSTDIR $IDXDST )
	# echo "dst =" $dst
	./adhoc $src $TGATMP >> $RGB
	# echo "ret adhoc " $?

	convert $TGATMP				\
		$dst

	IDXDST=$(( IDXDST + 1 ))
	echo ": $src   "
done

./encode.sh  foo.mp4
