See
http://www.transcoding.org/cgi-bin/transcode …
Transcode is a suite of command line utilities for transcoding video and audio codecs, and for converting beween different container formats. Transcode can decode and encode many audio and video formats, e.g.
A variety of video and audio pre and post-processing filters are available, including (but not limited to):
Transcode can import DVDs on-the-fly, or record from Video4Linux (including V4L2 video capturing) devices.