Reasonability of advanced codec settings

470 views
Skip to first unread message

Kagami Hiiragi

unread,
Sep 18, 2016, 4:48:28 PM9/18/16
to codec...@webmproject.org
Hi.

I would like to know, are there any major advantages of using advanced libvpx
options in terms of compressions for the common video content?

For example given these libvpx-vp9 options (from "vpxenc --help"):

>--sharpness=<arg> Loop filter sharpness (0..7)
>--static-thresh=<arg> Motion detection threshold
>--arnr-strength=<arg> AltRef filter strength (0..6)
>--arnr-type=<arg> AltRef type
>--max-intra-rate=<arg> Max I-frame bitrate (pct)
>--max-inter-rate=<arg> Max P-frame bitrate (pct)
>--gf-cbr-boost=<arg> Boost for Golden Frame in CBR mode (pct)
>--alt-ref-aq=<arg> Special adaptive quantization for the alternate
reference frames.
>--frame-boost=<arg> Enable frame periodic boost (0: off (default), 1: on)
>--noise-sensitivity=<arg> Noise sensitivity (frames to blur)
smpte240, bt2020, reserved, sRGB
>--min-gf-interval=<arg> min gf/arf frame interval (default 0, indicating
in-built behavior)
>--max-gf-interval=<arg> max gf/arf frame interval (default 0, indicating
in-built behavior)

Is it worth to play with them in order to achieve maximum compression for some
video? There are also a lot more options in vpxenc.

For example I can (roughly) understand rationality of settings here:

>ffmpeg -i <source> -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 1 -speed 0 \
> -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 \
> -g 9999 -aq-mode 0 -c:a libopus -b:a 64k -f webm out.webm

(best quality template from http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide)

"-speed 0" is the slowest and highest quality preset for good mode.
"-tile-columns 0" disables horizontal splitting of video frame which may improve
INTRA/INTER. You can't do parallel encoding in that case so that's why "-threads 1".
"-frame-parallel 0" disables extra bits for frame-parallel decoding which is not
used by some decoders.
"-auto-alt-ref 1" and "-lag-in-frames 25" allows encoder to use maximum amount
of AltRef frames which might reduce bitrate.
"-g 9999" allows encoder to very rarely put I-frames so you spend less bitrate.
"-aq-mode 0" disables adaptive quantization which is not yet producation-ready
and may result in bitrate overspend.

Basically all of these options are win-win in terms of resulting size/quality
ratio if we don't mind about encoding time and some non-obligatory features
(which I usually don't).

Are there some more options like these? I.e. options which you may almost always
recommend to enable in order to achieve better size/quality? Or the options I
mentioned at the beginning are very content-specific and don't give noticeable
advantage for common video?

Thanks.

phantom....@gmail.com

unread,
Dec 4, 2016, 10:12:52 PM12/4/16
to Codec Developers
If video input is noisy then   -arnr_max_frames=7 -arnr_strength=2 is usefull.


from ffmpeg help:
  -arnr_max_frames   <int>        E..V.... altref noise reduction max frame count (from 0 to 15) (default 0)
  -arnr_strength     <int>        E..V.... altref noise reduction filter strength (from 0 to 6) (default 3)
Reply all
Reply to author
Forward
0 new messages