I wonder why do you use 'scanf' for file name retrieval? It seeks for end of word stacking at the whitespace. 'gets' function is prefferable here, in my opinion, therefore.
Also, it would be nice to provide the usage with such a useful launching example:
ls *.jpg | ./jpegtoavi -f 25 800 600 > mjpeg.avi
It packs all the current dir jpegs into an avi.