wiki:

Option '-sameq' does NOT mean 'same quality'


Version 1 (modified by burek, 4 years ago) (diff)

Just a stub. Please update with more accurate statements.

This article is just a stub (and this line is intentionally put here so that somebody would review this article and edit it using more appropriate/correct terminology and would remove this boring line after that).

The purpose of this article is to draw attention to the fact that many users believe that FFmpeg's option named "-sameq" actually means "same quality" (in order to keep the quality of the output video the same as the quality of the input video), which is not true.

This option actually means "same quantizers". The option name was poorly/quickly chosen, which created all the mess afterwards. Even the documentation, in one moment, was stating that: "Note that this is NOT SAME QUALITY. Do not use this option unless you know you need it".

Shortly, don't use the "-sameq" option if you want to "just keep the quality of the input video". What you really want is to understand that not all the video encoders have one universal way to copy the original video's quality. It's similar if you would like to unzip a text file, change the text ("just a little bit") inside a file and zip it again, expecting the file size to remain the same. That's just not how things work.

What you need to do is to use an appropriate FFmpeg option, depending on your input video type, which is suitable to control the output video quality based on the desired criteria. Generally, if you want to target a specific file size, you might use 2-pass encoding. If you are using h.264 video encoder and you want to keep constant image quality throughout entire video, you most probably will end up using "-crf" option, etc. Different cases require different options to be used if you want to achieve the best results. You can check out the tutorials in this wiki to see if there are any articles describing the best practices in video encoding, that might help you with your specific case.

So, once more, "-sameq" option does NOT mean "same quality" and it is not an universal option that will automagically make all your input videos to keep their quality, no matter what you do with them.