|Version 2 (modified by cbsrobot, 4 years ago) (diff)|
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" and should only be used to copy the quants from the input to the output of the same format (f.ex. mpeg2 -> mpeg2). The option name was poorly/quickly chosen, which created a 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.