[FFmpeg-user] x264 preset (speed) question

Moritz Barsnick barsnick at gmx.net
Mon Nov 21 09:54:18 EET 2016


On Mon, Nov 21, 2016 at 08:32:00 +0100, Toerless Eckert wrote:
> http://slhck.info/articles/crf
> Aka: CRF means encoding happens at constant "Quality", aka: contant
> amount of "lossy" compression - just adjusted by the amount of movement.

Yes, but that "constant" means with one encoding, and not "among all
variants".

While you are (I believe) correct that using different presents while
keeping the same crf is supposed to achieve approximately the same
quality, it isn't guaranteed to do so.

What the presets basically do (it may be a bit more complicated) is to
use different methods and algorithms. So e.g. surrendering some
particular method of achieving smaller files may also save time. Here
someone went to the trouble of listing them per preset (probably "as
valid at time of writing):
http://dev.beandog.org/x264_preset_reference.html
Some of these can also influence quality.

> The ffmpeg output shows that the encoder generates more P,B frames
> the slower the preset gets. That accounts for the speed - aka :
> more searching.

As mentioned: Not that alone.

> I remember that a few years back when i tried to figure out the
> best encoding with Handbrake, the total bits improved a lot more
> with slower presets ...

Handbrake tends to have different presets (IIRC). And another thing is
that you can also use presets with constant bitrate mode, thereby
swapping quality for speed. Here are some measurements:
http://www.videoquality.pl/preset-settings-x264-quality-compression-speed-test/

BTW, I can confirm that, in certain experiments of mine, size didn't
always increase/decrease with each preset step. It can certainly depend
on your input material and how each of the algorithms applies. For all
I know, perhaps it also depends on which instructions the algorithms
use, and which of them are accelerated on my CPU. Anyway, I did the
same experiments as you in order to find my personal encoding "sweet
spots" - which are likely invalid for other material, but I feel better
now. ;-)

Moritz


More information about the ffmpeg-user mailing list