I'm no ffmpeg guru, but this should do the trick.
First of all, you can get the size of input video like this:
ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width in.mp4
With a reasonably recent ffmpeg, you can resize your video with these options:
ffmpeg -i in.mp4 -vf scale=720:480 out.mp4
You can set the width or height ...
If you want to crop and scale in one go, you can make a crop-then-scale filterchain like so:
ffmpeg -i SomeInput.mp4 -vf "crop=in_h*9/16:in_h,scale=-2:400" -t 4 SomeOutput.mp4
The above first crops a video to 16:9 portrait, then scales to 400px high x the appropriate (even number) width.
ffmpeg -formats will list all of them, its sounds like you're looking for (surprisingly enough) -f mp4.
Note that depending on your V4L capture device's format, you may need to specify encoding to an MPEG-4 compatible audio (-codec:a / -acodec) and video codec (-codec:v / -vcodec).
As pointed out in the comments, ffmpeg offers a good one-step solution with a simple "quality" parameter: crf, or "constant rate factor" (read this post explaining crf).
See this post for simple instructions for going from PNG to H.264 using ffmpeg.
# Assuming the frames are called frame0000.png, frame0001.png ...
# set $FPS, $WIDTH, $...
mplayer -nosound "mf://image.jpg" -mf type=jpg -loop 0
mplayer -nosound "mf://image.png" -mf type=png -loop 0
These commands "play" an image repeatedly until mplayer is stopped, say, by hitting escape.
I'm new to ffmpeg but now have a nice little converter going in VB.NET that creates raw movies of various output formats for use in small devices that have SD card access but not enough power to decode complex video.
Because of the way it works when resizing and cropping I had to code it manually and build the parameters. Basically I need to know the ...
I just used this command to convert a stack of .jpg files to an .mp4 file using ffmpeg. The switches should be similar enough.
$ ~/ffmpeg -r 10 -i pics_series2/01-2013110216%02d00-snapshot.jpg -c:v libx264 \
-crf 20 -g 15 -vf crop=200:300,scale=352:288 timelapse.mp4
Let me know if that worked. Also you can download the statically built version of ffmpeg ...