ffmpeg is a very powerful command-line audio and video converter which can, given the right parameters, do all encoding and transcoding jobs. It can also be used for simpler editing jobs like saving a 5 minute clip from a one hour long video to a file.
ffmpeg uses some code which may be covered by software patents in certain countries. Users of Fedora will want to enable the rpmfusion software repository and install it from there. Users of CentOS and other distributions with an older base system should get a statically compiled ffmpeg from johnvansickle.com/ffmpeg.