I've committed some updates to the mencoder-wrapper svn repo (http://code.google.com/p/mencoder-wrapper/). Notable changes:
- Support for AppleTV output, including B-frames (NOTE: This, unfortunately, requires the use of mp4box, which you can get from the gpac project on sourceforge).
- Better (for some definitions of "better") handling of scaling. Uses mplayer to detect the source size and aspect ratio, and explicitly calculates new dimensions to fit in the target's size constraints. Currently, this will use black bars to ensure size multiples, but I'll be adding an option to trade black bars for a bit of aspect ratio distortion (e.g. 480x272 vs. 480x270 w/ 1 pixel top and bottom for an anamorphic DVD on iPhone).
- In order to implement the scaling, added an analyzer concept - currently only using "mplayer -identify" but others could be used.
- Refactored the code a bit to make it easier to unit test.