#!/bin/bash

SDIR="capture"
DDIR="$HOME/KON/Povray/Inside/frames/grab"
TMPF="/dev/shm/tmp_hf_grab.fimg"
idx=0

for src in $(ls -t1 $SDIR/*.fimg | tail -2000)
do
	dst=$(printf "%s/%05d.pgm" $DDIR $idx)
	echo $src "    " $dst
	idx=$(( idx + 1 ))

	fimgfx -v shift0 $src $TMPF
	fimg2pnm -g $TMPF $dst

	sleep 1
done
