I'm using the following command to create thumbnails with FFMPEG:
ffmpeg -itsoffset -1 -i video.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 240x180 image.png
And it works fine. However, when the video isn't 4:3 ratio, it will still create a 240x180 image, and the extra space will be painted black. Is there some variation of the command that will prevent this and give me an image proportional to the video's ratio? In other words, I want 240x180 to be the maximum size of the thumbnail, but not the minimum.
Extra points if the command creates a smaller image when the video is smaller than 240x180.