I have a Sony AVCHD camera that records to MTS video files. I want to be able to change the resolution of the video file from 1440x1080 to 640x480 and make the video file smaller, but retain as much of the quality as possible.

Using the latest FFMPEG/x264 version I've tried the following 2-pass procedure:

ffmpeg -y -i <MTS> -pass 1 -an -vcodec libx264 -vpre slow_firstpass -b 1000k -bt 2000k -s 640x480 -threads 0 -g 25 -f mp4 /dev/null
ffmpeg -y -i <MTS> -pass 2 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -b 1000k -bt 2000k -s 640x480 -threads 0 -g 25 -f mp4 <MP4>

The result is a file size that's 70% smaller but the video playback seems a bit blurry, or not as sharp as the original video.

Is there anything I can do to maximise the quality while keeping the file as small as possible?


You can adjust the quality with CRF
1 is best quality, 23 is default

ffmpeg -i in.mts -crf 10 -s vga out.mp4


| improve this answer | |
  • In fact, 0 is best (lossless) quality, but it wouldn't be a good idea for anyone to use that :V ... 18 is 'visually lossless', 10 is probably waaay overkill, and you're missing a -preset (without which ffnpeg will throw up an error) -preset veryfast gives the best bang for computational buck in my experience. – evilsoup Dec 18 '12 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.