so, after working with this for a while, i figured out a couple bugs and forgot a citation. here is the revised code:
#!/bin/bash
# ogv to avi to pngs via imagemagick to swf
# denjell's batchprocess from recordMyDesktop to ONYX flash 9.0 swf# denjell -> loun...@gmail.com
# Call this with multiple arguments
# for example : ls *.{ogv,OGV} | xargs ogv2avi # thanks to http://gallery.menalto.com/node/14244 for the clue on binding the library
export LD_LIBRARY_PATH="/usr/local/lib"
N=$#;
echo "Converting $N files !"
for ((i=0; i<=(N-1); i++))
do
echo "converting" $1
filename=${1%.*}
mencoder "$1" -ovc xvid -oac mp3lame -xvidencopts pass=1 -o $filename.avi
#change to pngs cuz pngs are better than jpgs
#this is likely to crash if you don't have enough space on your harddrive
#you could mod the "320x240" if you have a super high performance video card and gigs to spare
ffmpeg -i $filename.avi -an -s 320x240 -y %d.png
#this is where i usually add my watermark or do other post-processing to the images with imagemagick
#just save different versions depending on what you want to do - and delete the doublehashmarks ;)
for PNG in *.png
do
#the loop has to something...echo Not doing anything to $PNG
#THIS FILTER TAKES TIME!!!
## Awesome Filtering $PNG
## convert $PNG -colorspace Gray -channel G \
## -set option:convolve:scale '50%!' -bias 50% \
## \( -clone 0 -morphology Convolve Sobel:0 \) \
## \( -clone 0 -morphology Convolve Sobel:90 \) \
## -delete 0 \
## \( -clone 0,1 -fx '0.5 + atan2(v-0.5,0.5-u)/pi/2' \) \
## \( -clone 0 -fill white -colorize 100% \) \
## \( -clone 0,1 -fx 'hypot(u-0.5,v-0.5)*2' \) \
## -delete 0,1 -separate +channel \
## -set colorspace HSB -combine -colorspace RGB \
## ${PNG//.png}.png
done
#change to swf
#is this optimal? seems to work for me...
ffmpeg -f image2 -i %d.png -r 30 -f avm2 -b 10000k -ab 256k -y $filename.swf
#permamently delete ALL pngs and all avis
#I left these double-hashed so you don't DDOS me juscuz you copied and pasted without reading the comments
##rm -e *.png
##rm -e *.avi
shift 1
done