Avidemux will do this and much, much more.
It's open source and cross platform
Avidemux is a free open-source
program designed for multi-purpose
video editing and processing.
Downloads, documentation, and other
features can be found at avidemux.org.
It is written in C/C++, using the GTK+
graphics toolkit, and therefore is
truly a platform independent,
universal video processing program. It
is available for almost all
distributions of Linux that are
capable of compiling C/C++, GTK+ and
the SpiderMonkey ECMAScript scripting
engine. A Win32 version of this
program is also available for Windows
users, as well as Mac OS X, FreeBSD,
NetBSD, and OpenBSD ports and
packages. The program can be run in
64bit operating systems that are
non-Windows and non-Macintosh based.
Info on Input Formats and Output Formats