Nearest x265 preset2023-04-19–2023-07-20
Given encoding settings from MediaInfo, this page will figure out the nearest x265 presetx265 has ten predefined presets of encoder parameters: ultrafast, superfast, veryfast, faster, fast, medium (default), slow, slower, veryslow, and placebo. to replicate those settings. One can input the entire MediaInfo output or just the "Encoding settings" line.
Nearest preset is ultrafast, with 0 additional parameters.
There are a few caveats to this that would not fit in sidenotes.
Firstly, not all parameters are recognized yet. x265 has
a lot of optionsRough estimate:
document.querySelectorAll('.option').length === 225, and while implementing the presets themselves
was simple enoughThe parameters affected by each preset are available in
here. I have made an effort to add the ones I saw the most often across the
encodes I tested, cross-referencing the documentation along the way, but still I
ended up with 137 or so options out of the 225 or so available. This is why one
can take an encode that they know the original settings for (maybe they did the
encode themselves), input it into this page, and get more flags back than they
expected. The intended value here is more in the preset estimation rather than
perfectly replicating the original x265 command.
Secondly, some parameters are intentionally omitted in the above output for brevity's sake. These fall within four categories:
The parameter is not documented as a command line option. Examples include
The parameter has no effect on the encoded result. Example:
Some of the x265 documentation is incorrect or outdated when it comes to the defaults of some parameters, and I have accounted for that here. Here are some of the discrepancies between the documentation and the source code:
There are also some undocumented changes surrounding presets:
- ultrafast, superfast:
aq-strengthset to 0.
- slow, slower, veryslow, placebo:
psy-rdoqset to 1,
x264 version? The parsing and diffing logic could be reused, but the thought of having to input another hundred settings does not sound fun.
After presets are applied there are optional tunings; we should be able to find the nearest preset and tuning.