Yes, some encoders allow changing parameters (like target quality or bitrate, or psychovisual tuning options (x264's aq
and psy-rd
options).
x264
, the stand-alone command-line frontend for the library, has a --zones
parameter to give more bitrate to some parts of the video. So you could for example reduce the quality for the credits.
The actual x264 library supports changing many parameters on the fly, but I don't know if ffmpeg has a way to specify option changes for ranges of the video. You could get nearly the same result by segmenting your video, and encoding the different segments with different options, then combining them.
Generally nobody actually does this, because it's a HUGE amount of work, and it's really hard to know which settings are going to help just by looking at a scene. Usually if you want more quality, you just spend more CPU time on the encode, and that improves everything across the board. (--preset veryslow
). I could imagine getting some benefit out of tweaking AQ settings, though, maybe to address banding in one scene, but changing it for other scenes where that wasn't an issue.
Still, bits are essentially never precious enough for it to be worth paying a human to save them, instead of just electricity and CPU time. This is more of a hobby thing / thought experiment to see what different codec settings do, IMO. Maybe when we need to stream video to / from a mars colony, bits will be that precious...