Converting container or transcode movies to iPhone from command line (os x)
You can use ffprobe (which comes with ffmpeg) to give you info about your movie files from the command line.

You may require some shell-fu to convert the output of ffprobe into something you can use though. I've done this in the past; basically I pipe the output of ffprobe to sed or awk to grab the bits of info I need, then use this to drive the parameters of ffmpeg.