ffmpeg provides this function. All you have to do is run as
ffmpeg -i <inputfilename> -s 640x480 -b 512k -vcodec mpeg1video -acodec copy <outputfilename>
For newer versions of ffmpeg you need to change -b to -b:v :
ffmpeg -i <inputfilename> -s 640x480 -b:v 512k -vcodec mpeg1video -acodec copy <outputfilename>
to convert the input video file to video with a size of 640 x 480 and a bitrate of 512 kilobits per second using the MPEG 1 video codec and simply copying the original audio stream. Of course, you can connect any values you need and play with the size and bit rate to achieve the desired quality / size. There is also a ton of other options described in the documentation.
Run ffmpeg -formats or ffmpeg -codecs for a list of all available formats and codecs. If you do not need to configure a specific codec for final output, you can achieve higher compression ratios with minimal loss of quality using a modern codec such as H.264.
Jason B Dec 20 '10 at 16:02 2010-12-20 16:02
source share