I've got a script processing a timelapse stills into a movie and I'd like to get zenity to show me the progress of the for loop. I believe the only way to do this is to dump ls listing into an array, then show the progress based on the array. I'm stumbling with converting this for loop into an array. Can anyone throw me a bone?
Code:
#!/bin/sh
imgsize="720x480"
himgsize=resized_to_$imgsize
#create directory if not exist
echo --------- create directory "$himgsize"
if [ ! -d $himgsize ] ;then
mkdir $himgsize
fi
echo --------- processing images
#iterate through selected images, resize, and rename
for file in `ls -C1 --ignore=resized_to_*`
do
name=`echo $file | cut -f1 -d.`
convert +page -type TrueColor -filter sinc -geometry $imgsize $file $himgsize/$file
done
outputfilename=${PWD##*/}
echo --------- ${outputfilename} images processed
echo
echo --------- starting mpg encode
if [ -e ../../${outputfilename}.mpg ] ;
then
DATE=`date +%Y%m%e-%H%M`
outputfilename=${outputfilename}_$DATE
fi
mencoder mf://$himgsize/*.JPG -mf w=720:h=480:fps=12:type=JPG -of mpeg -mpegopts format=mpeg2:tsaf:muxrate=3600 -o ../../${outputfilename}.mpg -oac lavc -lavcopts acodec=mp2:abitrate=224 -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=4096:keyint=15:mbd=2
echo --------- ${outputfilename}.mpg has been created
Thanks
Rich