Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

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

source

share|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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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