Mencoder is a command-line video encoding program; it is known as 'Mplayer's Movie Encoder' and comes with the Mplayer package. It can use a huge range of codecs to encode video and it can perform various rotate, scale and crop functions on video.
An extremely detailed overview of
Mencoder's capabilities can be found by entering in the terminal
man mencoder or by visiting the Ubuntu manpages.
News on the Mplayer project can be found at the official site. At that site are two very useful chapters explaining both the basic and more advanced capabilities of the program.