Log in

View Full Version : 1 HQ setting for ALL types of video. (also good for removing grain)(& audio settings)


H2sixty
15th September 2020, 01:21
the idea is lower the quality (raise crf value) to increase blending thus removing static, noise, & artifacts (while attempting to retain as much detail as possible). also with little to no artifacts when blown up to large size). sources with less grain/noise can have more detail by raising quality (lower crf value). these settings gives good blending when needed but not too much (like sao) thus preserving detail for high detail/high res encodes. there is also less random flickering and smoother playback, and color banding almost gone.

placebo is sometimes placebo, depends on the individual setting, some are the same as very slow setting, those are not not placebo. i toned down anything that went into the placebo range as it is only a waste of time, after extensive testing to ensure which preset placebo settings were really placebo.

there are many new settings/options/flags are not yet been considered for adding to the Presets, but may still be "best" setting, i have chosen some of these in the custom settings listed here.

i believe in one setting for all videos, or zones. however tweaking individual scenes/zones is time consuming and amazon/vudo/netflix isn't paying me to spend all day on a video. until video technology improves, some tweaking will always help, but eventually, in the future, an app will do it all for you. until then, use these settings :)...

---
12bits profile for slightly better pic, worth it.
-
frame rate=same as source.
-
resolution=same as source.
-
Preset=very slow (technically all settings are overwritten, but new settings may come out)
-
profile=auto
-
level=auto
-
tune=none
---
these settings conforms to the hevc standard/specification, (thus the setting no-allow-non-conformance).
-
handbrake settings--\/

log-level=3::constrained-intra::interlace=0::gop-lookahead=0::min-keyint=0::keyint=345::ipratio=1.4::pbratio=1.3::psy-rd=0.35::psy-rdoq=14.65::deblock=0,-3::qcomp=0.54::rdoq-level=1::rdpenalty=0::no-tskip::no-splitrd-skip::no-allow-non-conformance::ref=5::weightp::weightb::scenecut-window=1000::scenecut-aware-qp::strong-intra-smoothing::rect::amp::no-cutree::hist-scenecut::hist-threshold=0.01::slices=1::frame-threads=1::no-wpp::pmode::no-pme::open-gop::bframes=8::b-adapt=2::b-pyramid::b-intra::rc-lookahead=46::lookahead-slices=0::opt-qp-pps::opt-cu-delta-qp::ctu=64::min-cu-size=8::qg-size=32::max-tu-size=32::tu-inter-depth=4::tu-intra-depth=4::limit-tu=3::nr-intra=0::nr-inter=0::no-intra-refresh::limit-refs=0::opt-ref-list-length-pps::no-limit-modes::me=3::subme=4::merange=58::max-merge=5::no-temporal-mvp::temporal-layers::analyze-src-pics::no-sao::qpstep=4::qpmax=69::qpmin=0::rd=6::rskip=2::no-early-skip::no-fast-intra::no-hme::no-frame-dup::no-fades::no-rc-grain::signhide::radl=0::info::copy-pic=1::level-idc=0::high-tier=1::rd-refine::no-dynamic-refine::selective-sao=0::sao-non-deblock::hevc-aq::no-aq-motion::aq-mode=3::aq-strength=1.00
-
[EDIT: settings are for x265 3.4 (released 29th May, 2020)]
-

presets 0 1 2 3 4 5 6 7 8 9 mine
-----------------------------------------------------------------------------------------------------
ctu 32 32 64 64 64 64 64 64 64 64 64 gives overall best pic at smaller size
min-cu-size 16 8 8 8 8 8 8 8 8 8 8
bframes 3 3 4 4 4 4 4 8 8 8 8
b-adapt 0 0 0 0 0 2 2 2 2 2 2 trellis of corse
rc-lookahead 5 10 15 15 15 20 25 40 40 60 45
lookahead-slices 8 8 8 8 8 8 4 1 1 1 0 never use higher
scenecut 0 40 40 40 40 40 40 40 40 40 40
ref 1 1 2 2 3 3 4 5 5 5 5
limit-refs 0 0 3 3 3 3 3 1 0 0 0 limit-refs for lower quality...
me 0 1 1 1 1 1 3 3 3 3 3 be a star
merange 57 57 57 57 57 57 57 57 57 92 58 because hex's are bad
subme 0 1 1 2 2 2 3 4 4 5 4
rect 0 0 0 0 0 0 1 1 1 1 1 best with amp
amp 0 0 0 0 0 0 0 1 1 1 1 needs rect
limit-modes 0 0 0 0 0 0 1 1 0 0 0 no limit here
max-merge 2 2 2 2 2 2 3 4 5 5 5
early-skip 1 1 1 1 0 1 0 0 0 0 0 meh, why? for lower quality guessing...
recursion-skip 1 1 1 1 1 1 1 1 1 0 2
fast-intra 1 1 1 1 1 0 0 0 0 0 0 (1=lowers detail)
b-intra 0 0 0 0 0 0 0 1 1 1 1
sao 0 0 1 1 1 1 1 1 1 1 0 why? (gives nice blended picture for loss of detail)
signhide 0 1 1 1 1 1 1 1 1 1 1
weightp 0 0 1 1 1 1 1 1 1 1 1
weightb 0 0 0 0 0 0 0 1 1 1 1
aq-mode 0 0 2 2 2 2 2 2 2 2 hevc-aq ((hevc-aq+no-cutree=best))
cuTree 1 1 1 1 1 1 1 1 1 1 0 loss of detail with cutree low res search
rdLevel 2 2 2 2 2 3 4 6 6 6 6 --rd on documentation.
rdoq-level 0 0 0 0 0 0 2 2 2 2 1 allows psy-rdoq to be effective
tu-intra 1 1 1 1 1 1 1 3 3 4 4 tiny better. (no speed difference then 3)
tu-inter 1 1 1 1 1 1 1 3 3 4 4 tiny better. (no speed difference then 3)
limit-tu 0 0 0 0 0 0 0 4 0 0 3 for speed... (3 is sometimes better pic then 0)
-----------------------------------------------------------------------------------------------------
presets 0 1 2 3 4 5 6 7 8 9 mine

-
b-frames=8 any higher distorts picture + gives better compression, so use 8. less then 8 gives less compression and lower quility picture
--------------------------------------------------------------------------------------------------
-

========================================
opus audio transparent reproduction--\/

dolby trueHD/dtsHD | dts1553/ac3 640k
1c = 80k | 64k
2c = 160k | 128k
5.1c = 384k | 320k
6.1c = 448k | 384k
7.1c = 512k | 448k
8.1c = 576k | 512k
========================================

-
Video Audio
Q || CRF || Opus 2.0 | Opus 5.1 | Opus 6.1 | Opus 7.1 || Source Quality
-------++-------++----------+----------+----------+-----------++----------------
Q0 || 16 || 160 kbps | 400 kbps | 480 kbps | 560 kbps || T0 Blu movies (reference)
Q0.5 || 16.5 || 152 kbps | 380 kbps | 456 kbps | 532 kbps || T0 Blu movies (reference)
Q1 || 17 || 144 kbps | 360 kbps | 432 kbps | 504 kbps || T1 Gold movies
Q1.25 || 17.5 || 136 kbps | 340 kbps | 408 kbps | 476 kbps ||
Q1.5 || 18 || 128 kbps | 320 kbps | 384 kbps | 448 kbps ||
Q1.75 || 18.5 || 120 kbps | 300 kbps | 360 kbps | 420 kbps ||
Q2 || 19 || 112 kbps | 280 kbps | 336 kbps | 392 kbps || T2 Silver movies | T1 Gold series
Q2.25 || 19.5 || 104 kbps | 260 kbps | 312 kbps | 364 kbps ||
Q2.5 || 20 || 96 kbps | 240 kbps | 288 kbps | 336 kbps ||
Q2.75 || 20.5 || 88 kbps | 220 kbps | 264 kbps | 308 kbps ||
Q3 || 21 || 80 kbps | 200 kbps | 240 kbps | 280 kbps || T3 Bronze movies | T2 Silver series
Q3.25 || 21.5 || 76 kbps | 190 kbps | 228 kbps | 266 kbps ||
Q3.5 || 22 || 72 kbps | 180 kbps | 216 kbps | 252 kbps ||
Q3.75 || 22.5 || 68 kbps | 170 kbps | 204 kbps | 238 kbps ||
Q4 || 23 || 64 kbps | 160 kbps | 192 kbps | 224 kbps || T4 Copper movies | T3 Bronze series
Q4.5 || 23.5 || 60 kbps | 150 kbps | 180 kbps | 210 kbps ||
Q5 || 24 || 56 kbps | 140 kbps | 168 kbps | 196 kbps || T5 Coal movies | T4 Copper series

-
heres what media info spit out--\/

frame-threads=1 / no-wpp / pmode / no-pme / no-psnr / no-ssim / log-level=3 / csv / csv-log-level=0 / input-csp=1 / input-res=480x720 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=5 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / temporal-layers / open-gop / min-keyint=19 / keyint=345 / gop-lookahead=0 / bframes=8 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=46 / lookahead-slices=0 / scenecut=0 / hist-scenecut=1 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / amp / max-tu-size=32 / tu-inter-depth=4 / tu-intra-depth=4 / limit-tu=3 / rdoq-level=1 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / constrained-intra / strong-intra-smoothing / max-merge=5 / limit-refs=0 / no-limit-modes / me=3 / subme=4 / merange=58 / no-temporal-mvp / no-frame-dup / no-hme / weightp / weightb / analyze-src-pics / deblock=0:-3 / no-sao / no-sao-non-deblock / rd=6 / selective-sao=0 / no-early-skip / rskip / rskip-edge-threshold=0.050000 / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=0.35 / psy-rdoq=14.65 / rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=27.2 / qcomp=0.54 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=1.00 / no-cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=6 / transfer=1 / colormatrix=6 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=4095 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / opt-qp-pps / opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.01 / opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / scenecut-aware-qp / scenecut-window=1000 / max-qp-delta=5conformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0

benwaggoner
16th September 2020, 02:05
Did you have a question?

Also, there really isn't ever going to be a single set of parameters that work well across all content types and without a big performance impact.

H2sixty
17th September 2020, 03:25
Did you have a question?

Also, there really isn't ever going to be a single set of parameters that work well across all content types and without a big performance impact.

slower encoding is fine. its the computers that are slow, they will catch up.

Forteen88
18th September 2020, 07:15
This page shows the presets too,
https://x265.readthedocs.io/en/master/presets.html

"psy-rd=0.35::psy-rdoq=14.65"?
I'd rather have high psy-rd value, because it is more accurate than psy-rdoq.
High levels of psy-rdoq can double the bitrate which can have a drastic effect on rate control, forcing higher overall QP, and can cause ringing artifacts. psy-rdoq is less accurate than psy-rd, it is biasing towards energy in general while psy-rd biases towards the energy of the source image.
https://x265.readthedocs.io/en/master/cli.html#psycho-visual-options

benwaggoner
18th September 2020, 19:11
slower encoding is fine. its the computers that are slow, they will catch up.
Encoding speed always matters. No one does a full exhaustive motion search even for H.264 or MPEG-2. There are always quality/speed tradeoffs. Even --preset placebo leaves off features that can yield minor quality improvements with major encoding time increases. For example, --tskip isn't used in placebo, because it has no impact on most content. But on cel animation/anime content, it can cut bitrate by >25%.

We're always going to be figuring out the best balance of features to maximize quality for a given perf. And any types of content will always have different attributes that result in an optimum set of features to be used for quality @ perf.

Encoders do a lot of content adaption implicitly and under the hood.

H2sixty
19th September 2020, 22:56
This page shows the presets too,
https://x265.readthedocs.io/en/master/presets.html

"psy-rd=0.35::psy-rdoq=14.65"?
I'd rather have high psy-rd value, because it is more accurate than psy-rdoq.
High levels of psy-rdoq can double the bitrate which can have a drastic effect on rate control, forcing higher overall QP, and can cause ringing artifacts. psy-rdoq is less accurate than psy-rd, it is biasing towards energy in general while psy-rd biases towards the energy of the source image.

https://x265.readthedocs.io/en/master/cli.html#psycho-visual-options

thanks for the link to the presets, someone may need it.
https://x265.readthedocs.io/en/master/presets.html

however it also says...
--psy-rdoq <float>

Influence rate distortion optimized quantization by favoring higher energy in the reconstructed image. This generally improves perceived visual quality at the cost of lower quality metric scores. It only has effect when --rdoq-level is 1 or 2. High values can be beneficial in preserving high-frequency detail.


psy-rdoq maximum is 50, i set it to 14.65...

i tried the default settings of psy-rd=2.0::psy-rdoq=1.0 (since you didn't provide any, maybe you could?), the picture looks much worse, more flickering, looks less accurate at lower bitrates with added "detail"(noise) where there wasn't any :(

maybe at real high bitrates, 4k grain free video content (or with intentions to preserve/keep the grain), psy-rd=2.0::psy-rdoq=1.0 could maybe be better setting along with no-constrained-intra maybe aqmode=1 instead of hevc-aq for remuxing such content. however most content has unnecessary visual noise and properly removing it can decrease the file size, and improved visuals.

[EDIT: my settings (as posted at top) look better than placebo in high detail test clips, soon to be posted below]



i also forget to mention in my post that i was going for perceived quality, not accuracy. besides, isn't x264 still king of remuxing losslessly? either way, i think there needs some tweaking for remuxing "perfect" sources.
any ideas anyone?

Forteen88
22nd September 2020, 08:23
i tried the default settings of psy-rd=2.0::psy-rdoq=1.0 (since you didn't provide any, maybe you could?), the picture looks much worse, more flickering, looks less accurate at lower bitrates with added "detail"(noise) where there wasn't any :(

maybe at real high bitrates, 4k grain free video content (or with intentions to preserve/keep the grain), psy-rd=2.0::psy-rdoq=1.0 could maybe be better setting along with no-constrained-intra maybe aqmode=1 instead of hevc-aq for remuxing such content. however most content has unnecessary visual noise and properly removing it can decrease the file size, and improved visuals.Yeah, I set quite high bitrate, like CRF 18, with x265 --preset slower, for SDR 1080p. I don't like artifacts.

H2sixty
23rd September 2020, 22:56
i retested the times of placebo against my custom settings posted at beginning of thread with a 5 second clip, and nothing else running.


placebo: 22min 33seconds
custom : 22min 07seconds


i must have been running something in background before, they are almost equal in time.

so the variance in a larger clip may be meaningful, possibly saving you noticeable amounts of time... however placebo was slightly bigger file, and take tiny amount of time more because. (making them closer then test shows...)

H2sixty
23rd September 2020, 23:47
i found some high quality sources and grabbed a png copy of a trailer for sintel at https://media.xiph.org/

i did some encodes at 18crf (before Forteen88 posted about crf 18, weird...)

my custom settings posted did about 1 or 2% better than placebo. however with crf there is the added difficulty of different file sizes so i included the 2 placebo copies for comparison.

my settings did well, beating placebo in a HD 1080p sdr lossless png video!

custom settings posted at top even work great on low quality, designed to remove grain while retaining high detail (an almost impossible task) even pulling detail out of a static mess! and as long as your not a grain lover, this will do excellent HD, as just proved...

[ i should change the title to ALL types of content, except cel animation ;p ]

i am encoding the full trailer now, will take some time for this computer & to match similar sizes. i do not test in 2pass or other modes as my settings are customized around crf and using other modes to specify exact bitrates would throw quantization and other settings off. so i went for "real world" comparisons.



here is what i have--\/

sintel_trailer_2k_0001=============____crf=18____custom____.mkv (https://mega.nz/file/I5dUgAKQ#3efQ9v8KH2F4XvPBz4HdimL0Ki1Kn36Qtbzu6rR6-uQ)

sintel_trailer_2k_0001=============____crf=18____placebo__.mkv (https://mega.nz/file/EtMgwAJb#_SVkaBTpjWp9t7scglfquFyfbDRqTrxgVrVREvju8g0)

sintel_trailer_2k_0001=============____crf=18.2____placebo____.mkv (https://mega.nz/file/1hFSDKQa#JL6cs1GUj9MsDa8cEi62bYU_OhtvuLmQG2Jce7RzmQs)

very slow for comparison--\/
sintel_trailer_2k_0001=============____crf=18____vs__.mkv (https://mega.nz/file/lpUGxAZI#Wvkz4nrHbzTtP_8g8sLKYmxru8nfM8sfcDpjI8rOzjo)

source clip--\/
sintel trailer clip (https://mega.nz/file/IoEWBSYZ#PiptyNiT10SVUY19nuCpXln8VmLjwx4maA_EuX9YCdc)

[EDIT: scroll down few posts for full trailer, these are just few secconds]

H2sixty
23rd September 2020, 23:53
Encoding speed always matters. No one does a full exhaustive motion search even for H.264 or MPEG-2. There are always quality/speed tradeoffs. Even --preset placebo leaves off features that can yield minor quality improvements with major encoding time increases. For example, --tskip isn't used in placebo, because it has no impact on most content. But on cel animation/anime content, it can cut bitrate by >25%.

We're always going to be figuring out the best balance of features to maximize quality for a given perf. And any types of content will always have different attributes that result in an optimum set of features to be used for quality @ perf.

Encoders do a lot of content adaption implicitly and under the hood.

encoding speed does matter, i retested all the settings for speed optimizations without loosing any quality. tough but i had to, otherwise some settings would have been higher then needed, giving that placebo effect & taking unnecessarily long to encode. [EDIT: if i remember correctly it was around 50%+ longer to encode for same quality. that was way before i posted settings at start of thread]

the order of choice was always

#1)quality
#2)size
#3)speed

i just meant that some settings are higher than needed for some content, yet the trade off is not having to tweak and be an expert at settings for every video, (ease of use + possible speed loss + no loss of quality).

[EDIT: tests show no speed lost!]


**however cel animation could use some changes i suggest --tskip (thanks benwaggoner), & --ipratio=1.08 --pbratio=1.00 --deblock=1,1 as per the animation tuned, settings.

the animation setting also suggests --aq-strength 0.4 & --bframes Increase by 2, but --aq-strength has no effect with the more automatic aq mode of --hevc-aq & --bframes more than 8 just add better compression but loss of quality so i do not suggest changing that.

any other cel animation tweaks or settings anyone?

H2sixty
25th September 2020, 09:05
sintel full trailer encodes for comparison--\/

sintel_trailer_2k_1080p24____crf=17.5____placebo____.mkv (https://mega.nz/file/5xdljYQa#rmQK4SyuawlRTJnUqU1QB5IbxRw-DzCOQ36jwaf50a8)

sintel_trailer_2k_1080p24____crf=18.4____custom____.mkv (https://mega.nz/file/lpcVUIqA#ewvsJ8ys-C8JLuRXr3NUOw4tDSop3nB32nIVq-KPYXA)

3.7GB source video (https://media.xiph.org/video/derf/y4m/sintel_trailer_2k_1080p24.y4m)

the placebo encode is about 5% bigger than my custom settings encode, yet i still see more detail in the custom settings encode.

i do wonder how these settings would do on benwaggners encoding challenge, against Sagittaire's 4 pass encode ABR settings... or maybe my settings customized into an ABR friendly customization for a 4 pass encode that also removes grain... sadly no space for png copies of tears of steel. i would like to see 4k comparisons as well.

benwaggoner
25th September 2020, 22:18
sintel full trailer encodes for comparison--\/

sintel_trailer_2k_1080p24____crf=17.5____placebo____.mkv (https://mega.nz/file/5xdljYQa#rmQK4SyuawlRTJnUqU1QB5IbxRw-DzCOQ36jwaf50a8)

sintel_trailer_2k_1080p24____crf=18.4____custom____.mkv (https://mega.nz/file/lpcVUIqA#ewvsJ8ys-C8JLuRXr3NUOw4tDSop3nB32nIVq-KPYXA)

the placebo encode is about 5% bigger than my custom settings encode, yet i still see more detail in the custom settings encode.
What is your final command line?

I do wonder how these settings would do on benwaggners encoding challenge, against Sagittaire's 4 pass encode ABR settings... or maybe my settings customized into an ABR friendly customization for a 4 pass encode that also removes grain... sadly no space for png copies of tears of steel. i would like to see 4k comparisons as well.
Go for it! The more examples, the better.

H2sixty
26th September 2020, 01:19
What is your final command line?

same as posted at start of thread, i only changed crf.
for placebo i erased the advanced box.

benwaggoner
28th September 2020, 17:23
same as posted at start of thread, i only changed crf.
That block shows specifying EVERYTHING, including default parameters. It's easier to parse if you can list or show the actual flags you set on top of the defaults.

for placebo i erased the advanced box.
I'm not sure what that means.

Are you going to take a whack at my Compression Challenge source?

H2sixty
4th October 2020, 00:53
That block shows specifying EVERYTHING, including default parameters. It's easier to parse if you can list or show the actual flags you set on top of the defaults.


here is shortened command list for preset veryslow...


handbrake (advanced settings box)--\/

::constrained-intra::psy-rd=0.35::psy-rdoq=14.65::rdoq-level=1::deblock=0,-3::no-sao::qcomp=0.54::scenecut-aware-qp::scenecut-window=1000::hist-scenecut::min-keyint=0::keyint=345::rc-lookahead=46::merange=58::tu-inter-depth=4::tu-intra-depth=4::limit-tu=3::temporal-layers::no-temporal-mvp::no-cutree::analyze-src-pics::rskip=2::rd-refine::opt-qp-pps::opt-cu-delta-qp::opt-ref-list-length-pps::no-wpp::pmode::frame-threads=1::hevc-aq::aq-mode=3::no-tskip::log-level=3::


x265 commands--\/

--constrained-intra --psy-rd 0.35 --psy-rdoq 14.65 --rdoq-level 1 --deblock 0:-3 --no-sao --qcomp 0.54 --scenecut-aware-qp --scenecut-window=1000 --hist-scenecut --min-keyint 0 --keyint 345 --rc-lookahead 46 --merange 58 --tu-inter-depth 4 --tu-intra-depth 4 --limit-tu 3 --temporal-layers --no-temporal-mvp --no-cutree --analyze-src-pics --rskip 2 --rd-refine --opt-qp-pps --opt-cu-delta-qp --opt-ref-list-length-pps --no-wpp --pmode --frame-threads 1 --hevc-aq --aq-mode 3 --no-tskip --log-level 3 --preset veryslow --output-depth 12


with my custom settings, switching to placebo only changes subme=4 to subme=7, & tskip is enabled, (i only like tskip for cel animation)... i went with subme=4 over 5 or 7 because it tends to look better more often then subme=7, especially in flatter areas like the lady's face in the video... however the subme=7 encode is smaller in file size, slightly, from 18002 KB to 17933 KB for the sintel clips below (52 seconds at crf 18.4)...

below is an encode with my custom settings & another encode with with my custom settings + subme=7


sintel_trailer_2k_1080p24____crf=18.4____custom__(subme=4).mkv (https://mega.nz/file/tk80zBZY#ewvsJ8ys-C8JLuRXr3NUOw4tDSop3nB32nIVq-KPYXA) (preset=veryslow)

sintel_trailer_2k_1080p24____crf=18.4____custom_+_subme=7.mkv (https://mega.nz/file/N5kiBZCb#WguTVv6NP0XUwTR5WuIDYlFlnEWpOTVsNdir1H9_TYU) (preset=placebo)



i added aq-mode=3 because aq-mode keeps coming out to a 2 in mediainfo :/ shouldn't it be 0 since hevc-aq takes place of aq-mode=x? is this a handbrake only bug?
---
does rd-refine not work with hevc-aq?
if i specify aq-mode=0 (with hevc-aq) i get an error saying rd-refine requires adaptive quant...
---
i listed tskip, but technically veryslow already has tskip disabled, and as you know ;) placebo has it enabled, i quote you below.
For example, --tskip isn't used in placebo, because it has no impact on most content.
(he means veryslow...)

H2sixty
5th October 2020, 01:15
quote from Any advice on --tune grain ? (https://forum.doom9.org/showthread.php?p=1851718#post1851718) thread
Grain is always the hardest thing for encoders, since it really is random, spatially and temporally. Throwing some --nr-inter in can help smooth out some of the motion of grain, making it both less annoying and saving some bits.

The whole issue of creative intent with grain is quite complex. Battlestar Galactica was presumably mastered with relatively small CRT professional reference monitors. Grain just isn't as apparent on those as on a big LCD panel; CRT itself is a bit of a low-pass filter :sly:. That was the issue with a lot of the first wave of Blu-ray discs; they got approved on $30K professional HD CRT monitors, which didn't show all kinds of imperfections (particularly grain and low-luma blocking) that were glaring on a typical consumer 1080p panel of the era. There was a massive rush in Hollywood authoring studios to get consumer monitors into the rooms so that mastering and QA could be done on a professional AND consumer monitor at the same time.

Same with movies. Things more than 10-15 years old were absolutely approved in projection on a perf screen, which also obscures a lot of fine detail. So the director signed of on something that showed a lot less grain than can be projected by a modern 4K projector on a non-perf screen.

I'm all for preserving creative intent, but spending TONS of bits saving grain that the creatives never approved doesn't seem appropriate. Figuring out how much grain they would have picked is pretty speculative unless the original creatives have done a recent remaster.

Big picture, some well done degrain can actually make the picture MORE like it is meant to be, as well as simplifying encoding a bunch. But knowing how much is "right" is a complex question that will never yield a clear specific answer.


some good points, well made... i stopped using filters such as nlmeans degrain and nr-inter/nr-intra=x since i finished putting together the custom settings i posted...

with my settings, choosing the right crf value for proper grain removal takes a lot of tests but the file will be optimal, small and degrained. well, maybe keep a hair pinch of noise somewhere... its a constant struggle between noise reduction and keeping detail. if done right, i just consider the lost detail, detail that wasn't there. its like they didn't finish processing the video... kinda like a old blocky video that looks like they forgot to deblock, or maybe it would have took too long... and a re-encode with deblocking makes all the blocks go away, as if the video was meant to look that way and was only half processed.

H2sixty
5th October 2020, 07:07
for placebo i erased the advanced box.

I'm not sure what that means.


in handbrake, advanced settings is where you write additional settings/commands, i left empty/erased as to not alter the placebo settings...
---
what is ffmpeg command to pipe a mkv/mp4 file into x265 in realtime as a yuv?
x265 only likes yuv ;)

excellentswordfight
5th October 2020, 09:43
what is ffmpeg command to pipe a mkv/mp4 file into x265 in realtime as a yuv?
x265 only likes yuv ;)
"ffmpeg.exe" -i "input" -f yuv4mpegpipe -strict -1 - | "x265.exe"

In some scenarios you will need to change the format before piping (-pix_fmt)

H2sixty
6th October 2020, 10:15
thank you excellentswordfight.

i started a thread to consolidate the information where others could more easily find it.

ffmpeg command to pipe a mkv/mp4 file into x265 in realtime as a yuv (https://forum.doom9.org/showthread.php?t=181895)

benwaggoner
6th October 2020, 20:08
quote from Any advice on --tune grain ? (https://forum.doom9.org/showthread.php?p=1851718#post1851718) thread
The bigger picture is that x265 deals with grain by default much better than 4-5 years ago, so only heavily grainy content needs --tune grain. It's nice to have --tune grain when needed, but it's a bitrate hog. Using tune grain when it's not needed can increase the bitrate required to hit a particular quality level a LOT .

Grainy content should also use at least --rd 4, to get chroma motion estimation. Otherwise the heavy grain in luma can decorrelate to actual motion, giving a lag between when chroma changes and when it's reflected in the screen. So you can see someone's face tone stay in the same part of the screen while their face moves somewhere else. And so you kind a peachy looking lawn and a gray face. I find this abhorrently distracting.

some good points, well made... i stopped using filters such as nlmeans degrain and nr-inter/nr-intra=x since i finished putting together the custom settings i posted...
I find a little --nr-inter, like 50 or 100, rarely does much harm and can offer a little efficiency boost and a little reduction in the "swirling" of grain.

with my settings, choosing the right crf value for proper grain removal takes a lot of tests but the file will be optimal, small and degrained.
CRF really isn't meant to be used as a grain removal tool! Higher QPs make for bigger deadzones, so the reduction in grain certainly happens. But the high QPs mean that signal is also getting smoothed out. For a an old grainy title where the actual underlying visual content is pretty soft (like an 80's-90's Super 35 movie), the higher QP might not cause much of an issue since there isn't a lot of detail, and the various deblocking features of HEVC can keep false detail from being introduced. But there will also be content where real detail gets lost, and artifacts will start to become visible before grain becomes invisible.

I'd think --nr-inter and a lower value of --nr-intra plus a lower CRF probably would give better results the majority of the time.

well, maybe keep a hair pinch of noise somewhere... its a constant struggle between noise reduction and keeping detail. if done right, i just consider the lost detail, detail that wasn't there. its like they didn't finish processing the video... kinda like a old blocky video that looks like they forgot to deblock, or maybe it would have took too long... and a re-encode with deblocking makes all the blocks go away, as if the video was meant to look that way and was only half processed.
That is the challenge. One of the horrors of TV's with "Vivid Mode" is that they try to do noise reduction and sharpness enhancement at the same time, which can come out all kinds of weird and awful.

I've seen some content with synthetic noise where the frames are maybe 98% noise and 2% signal. For example, someone was trying to emulate a Super8 look at 4K, but were grading on a 1080p Pulsar monitor. The grain was being rendered with a grain size appropriate to 1080p, so each pixel was quite randomized. But scaled down to 1080p, a lot of that averaged out so the operator kept yanking up the noise intensity to where the 8 least significant bits were essentially random, so it looked grainy on 1080p.

With x265 circa 2016, I literally was unable to make those shots look anything short of unwatchable, even at 40 Mbps --preset-placebo, lots of --nr, preprocessing, anything. The original --tune grain came out of some of those experiments, but even it couldn't save that pathological edge case.

Fortunately HDR grading is all done at native resolution these days, so we don't see the same kind of weird one-off nightmares we suffered from in the early days of the format.

H2sixty
7th October 2020, 08:40
circa 2016
a link? i can not find what this is.

H2sixty
7th October 2020, 09:01
CRF really isn't meant to be used as a grain removal tool!

there will also be content where real detail gets lost, and artifacts will start to become visible before grain becomes invisible.
i had issues with artifacts & detail retention at first, luckly it didn't stay an issue, toughest issue i had though...

also, as i stated before---\/

i stopped using filters such as nlmeans degrain and nr-inter/nr-intra=x since i finished putting together the custom settings i posted...


(the presets have heavy color banding on higher crf settings, there was no way to use crf to blend with presets)

degraining helped when i started this project, even helped retain detail, but, eventually, at some point, as my settings evolved, it just made loss of detail... i tried some more noise reduction tests and i see loss of detail and accuracy. maybe with the default presets it works better.

i'm all for improvements, however i already tested everything heavily except ip pb ratio settings, i didn't break it down to every possibility... any ip pb ratio ideas? or are the defaults 1.4 1.3 best? does anyone change them?

the animation setting adjusts them, but that adds blending without reducing file size, and in attempt to counter this by lowering crf allows more grain/noise, and well, its meant for cel animation...



i know how to properly use everything. i just found i didn't need to adjust so much for different content.
because without using zones, a single video can have fast motion, slow motion, blended skys or detailed trees or peoples faces close up, fine hairs, to an ocean of fluid water, to little tiny twinkling stars in the dark night sky, all in one video. so one setting for one video was the first goal, then it became a "1 for all" setting.

now with cel animation being an exception i can agree on.
cel animation mixed with detailed backgrounds would be the hardest, adding tskip should help the cel animation flat colors look as one color, etc. maybe deblock of 0,0 (witch i find to be next best to 0,-3...) -1,-1 messes with blending of some grainy content, while 0,0 could bring out better picture, even sometimes more detail. -1,-1 deblock is over rated, but my 3rd choice... (1,1 for cel animation as mentioned before)



[these settings are the result of thousands of encodes, and months of work]

even so, i still would love to improve the "1 setting for all" custom settings.

i just figured why ask questions when i can encode and see for myself, and did a lot of it. just small clips of a few seconds.

as an idea for anyone reading, you can take multiple test clips from same video and combine using MKVToolNix or some other program... good way to mix scenes up, like fast & slow, a scene were good blending is needed, detail, or that impossible dark scene. however choosing a crf value with a small encode doesn't seem to work well. maybe 1 or 2 minutes should be enough for long videos. find a crf good for all scenes, and encode. the way it should be, easy :)

Boulder
7th October 2020, 10:31
Do you do tests by frame-to-frame comparison or viewing from your normal viewing distance? What comes to hevc-aq, I only found it to blur the image a helluva lot. Aq-mode 1 has still been the best all-round choice compared to the automatic variance methods.

It's basically impossible to remove grain or noise without removing a lot of the details as well. Motion compensated methods do help there a bit but they are still not going to do wonders. That's why I myself only do slight motion compensated denoising.

H2sixty
11th October 2020, 10:42
Do you do tests by frame-to-frame comparison or viewing from your normal viewing distance


zoomed in, 1.5x, 2x, 2.5x + frame by frame and/or in motion, play back speed 30% 70% and normal speed. even blind testing as to avoid a bias decision i may have...
comparing multiple parts of a frame multiple times since some times its a close compare. if neither look better, the more accurate encode/setting is chosen... i started with the obvious choice, frame by frame, or still frames... but eventually realized still frames do not show quality in motion... also sometimes is a good idea to make multiple encodes with same settings, as they are most likely not identical visually.


What comes to hevc-aq, I only found it to blur the image a helluva lot. aq-mode 1 has still been the best all-round choice compared to the automatic variance methods.

its a real synergy between most settings if not all. one affects the other, change one setting and all the previous tests are now irrelevant, because you now have a new "baseline"...

placebo with or without aq-mode=1 is far inferior to my custom settings. so i focused on my custom settings with & without aq-mode=1. aq-mode 1 is giving distortion on low quality and high quality sources. also where aq-mode 1 seems to have more detail, it was detail not in the source of sintel, hevc-aq was more accurate, had more detail & accuracy in numerous places. aq-mode=1 did sharpen the picture more than the source, however was blurry in areas that hevc-aq was not...


It's basically impossible to remove grain or noise without removing a lot of the details as well. Motion compensated methods do help there a bit but they are still not going to do wonders. That's why I myself only do slight motion compensated denoising.

i agree. thus i really like using one slider (crf) scale to go from blurry denoising to high detail. as incorrect as it sounds it works because the more blur, the smaller the file... and the more detail, the bigger the file... makes sense to save space if not saving detail. the custom settings acts as a motion compensated denoising.

i bet the blending could be better, but i didn't want to loose any quality and still be able to scale up to high bitrates for a "one for all" baseline setting.
-
i would like more complex encodes like tears of steel for comparison.
-
in the pix look under the persons left eye, aq-mode 1, has all this distortion, that's not detail.
or to the left of hand under face, looks like aqmode1 has a lot of detail, but its not in source. and their left arm, on the sleeve, less detail in aq-mode 1, more detail in custom settings...

pix--\/
cap_sintel_trailer_2k_1080p24____source____00.00.06_01.jpg (https://mega.nz/file/Up8VVaBT#Dfjn7wIswZbWpnlIl1CckC8fxHEGoGNHl0Jizw6uRK8)
cap_sintel_trailer_2k_1080p24____crf=19.2____custom_____00.00.06_01.jpg (https://mega.nz/file/F9lxVCBb#wJh30ChMVPm5WbVWEuPDFNhdHKyRB5WXoYgHRkokcIU)
cap_sintel_trailer_2k_1080p24____crf=19.8____custom_+_aq-mode=1.aq-strength=1.00_____00.00.06_01.jpg (https://mega.nz/file/tt9XmYLL#iWUa-d098Ore8kw_lk-21om4gfpjvoJnhjRi90hvHuI)

videos--\/
sintel_trailer_2k_1080p24____crf=18.4____placebo.mkv (https://mega.nz/file/VstVWY7B#HmsHW_0szXG3RH6LiWt9hDlY3YmrL5gp5hO8iqVrqQA)
sintel_trailer_2k_1080p24____crf=19.0____placebo_+_aq-mode=1.aq-strength=1.00.mkv (https://mega.nz/file/po03naqB#PdzEqkEMjrmvS5yKSXkJfgUxMjBE6THMenTAPClz-9w)

sintel_trailer_2k_1080p24____crf=19.2____custom.mkv (https://mega.nz/file/o1k3AIJI#Bh9SR29iIIZI5aur3SjdW9QzlpDN4aFe3vs3TU6dplA)
sintel_trailer_2k_1080p24____crf=19.8____custom_+_aq-mode=1.aq-strength=1.00.mkv (https://mega.nz/file/Zt8lUChI#Eu_U81IyLcC24uGnEWjrtc_DNSN7uKhdRFsLPAf3H2g)

Sintel trailer (1253 frames 16:9 letterbox) y4m 3.8GB (https://media.xiph.org/video/derf/y4m/sintel_trailer_2k_1080p24.y4m)
https://media.xiph.org/
-
-
-
-
-
-
more pix--\/
(higher detail scene)

cap_sintel_trailer_2k_1080p24_source_00.00.19_04.jpg (https://mega.nz/file/4okDTQYB#oQOANSQebFnXiQx-nUObUu3y-vjvc_xaHky9WKb08N4)
cap_sintel_trailer_2k_1080p24____crf=19.2____custom_00.00.19_01.jpg (https://mega.nz/file/1otXGY4L#_N5QJJeBiRHX06R1DRyTYFc3APoVQviCg-CupsxgZqM)
cap_sintel_trailer_2k_1080p24____crf=19.8____custom_+_aq-mode=1.aq-strength=1.00_00.00.19_01.jpg (https://mega.nz/file/4llzya7A#7ox-tz1YMeuADNaHK56Og0rEWoo3gX5YjoEDvZqi69s)

aqmode1 in these pix just above, shows lack of detail & accuracy all over...

Boulder
11th October 2020, 18:53
Have you made the same tests with real life footage? CGI is a very different beast, and hevc-aq could well work better with that. A regular grainy/noisy movie is not as easy to deal with.. I did test your psychovisual settings + hevc-aq with a snip from Star Trek: Enterprise S02E01, and while they removed quite a lot of noise, they also caused the remaining noise "jump out" of the background every now and then. That was quite a lot more distracting than some floating noise.
Season 3 of that series is a total disaster quality-wise, it's like looking the video through a dirty screen because DNR has not been applied carefully. That is something I would like to be able to improve, but I don't think any encoder settings can do that.

H2sixty
11th October 2020, 22:37
i can not find what you are talking about. what are the 2 command lines/settings you are comparing? can you share star trek? or i will have to get a snipit of live action from tears of steel, or is there something else i can encode with grain that is better, so i can share with the world a compairison... benwaggner mentioned something few posts back, but i can not find it...
With x265 circa 2016, I literally was unable to make those shots look anything short of unwatchable, even at 40 Mbps --preset-placebo, lots of --nr, preprocessing, anything.
is it free for share? i need live action with & without grain. ideas? links?

quietvoid
11th October 2020, 23:59
i can not find what you are talking about. what are the 2 command lines/settings you are comparing? can you share star trek? or i will have to get a snipit of live action from tears of steel, or is there something else i can encode with grain that is better, so i can share with the world a compairison... benwaggner mentioned something few posts back, but i can not find it...

is it free for share? i need live action with & without grain. ideas? links?

https://forum.doom9.org/showthread.php?t=175776

Boulder
12th October 2020, 05:29
For example these clips from Hot Fuzz are good for testing a rather good quality source.
https://drive.google.com/file/d/19cIzFGAocSHYlBNJdZJ08OaQbfBIHUjm/view?usp=sharing
https://drive.google.com/file/d/1_we1SvgsoY9DQKsVjYSUtKGGcQ-kds6I/view?usp=sharing

For a more noisy one, this is a bit nasty to get to look good without a floating noise effect or banding.
https://drive.google.com/file/d/1N53NoN5Ay1c6ned9Lk3uANDgKyuyFqgZ/view?usp=sharing

H2sixty
12th October 2020, 06:55
For example these clips from Hot Fuzz are good for testing a rather good quality source.
https://drive.google.com/file/d/19cIzFGAocSHYlBNJdZJ08OaQbfBIHUjm/view?usp=sharing
https://drive.google.com/file/d/1_we1SvgsoY9DQKsVjYSUtKGGcQ-kds6I/view?usp=sharing

For a more noisy one, this is a bit nasty to get to look good without a floating noise effect or banding.
https://drive.google.com/file/d/1N53NoN5Ay1c6ned9Lk3uANDgKyuyFqgZ/view?usp=sharing

something more free to distribute please.

creative commons, etc...

Boulder
12th October 2020, 12:37
something more free to distribute please.

creative commons, etc...

Unfortunately I have none of those available. Perhaps there are some found over the internet, but they tend to be mostly CGI. I've always considered short samples as being under the fair use policy so never bothered worrying about copyright issues.

benwaggoner
12th October 2020, 17:05
a link? i can not find what this is.
I doubt there is any way to get access to those old encodes anymore. But it would be pretty easy to synthesize by just putting a really high strength small grain noise filter on top of some low contrast 4K video.

I think using --hme might be particularly helpful with that kind of content, as the noise will get largely averaged out by the downscaling so the 960x540 layer will be able to pick up vectors for the actual motion.

benwaggoner
12th October 2020, 17:14
https://forum.doom9.org/showthread.php?t=175776
Thanks! Although there is some grain in Tears of Steel.

Grain is a great way to mask less-than-perfect compositing, and the combination of 2K VFX with 4K source. Grain adds a psychovisual sense of sharpness that can be well beyond the actual real detail of the underlying content.

Netflix's Sol Levante (http://download.opencontent.netflix.com/?prefix=SolLevante/) is a short CGI HDR 4K anime available under the Creative Commons "Attribution-NonCommercial-NoDerivatives 4.0 International" license. It doesn't have any plot or dialog or anything, but is a fun clip to test with.

H2sixty
13th October 2020, 04:42
I did test your psychovisual settings + hevc-aq with a snip from Star Trek: Enterprise S02E01, and while they removed quite a lot of noise, they also caused the remaining noise "jump out" of the background every now and then. That was quite a lot more distracting than some floating noise.

i think i see what you are talking about, i'll throw up some encodes in a few days and spew out the details ;)




Season 3 of that series is a total disaster quality-wise, it's like looking the video through a dirty screen because DNR has not been applied carefully. That is something I would like to be able to improve, but I don't think any encoder settings can do that.

maybe you could share a small 30-60 second clip of this

Boulder
13th October 2020, 05:36
maybe you could share a small 30-60 second clip of this

You can use these to test:
https://drive.google.com/file/d/1f_-sl4cLQHeXjdy-eLYbsJxqiEsDk5hx/view?usp=sharing
https://drive.google.com/file/d/1G8wtXxXKVT3rmvXOXqmS5pUQ9UFbOf0D/view?usp=sharing

The problem is less obvious in the original, but gets enhanced in the encode. It's just too strong denoising which makes the grain so much less random that it starts to resemble a static dirty screen in some parts of the frame. The fact that it gets worse after even very slight denoising makes it even harder to handle well. One way to battle it is to add noise before the encode to hide the artifacts, but it will start requiring quite a lot more bitrate.

qebe
11th January 2025, 19:35
rc-lookahead=46

Why did you use such an odd value as rc-lookahead=46 ?

RanmaCanada
13th January 2025, 00:06
Why did you use such an odd value as rc-lookahead=46 ?

why are you necroing an almost 5 year old post? haha

Z2697
13th January 2025, 05:01
Because there's no real quality assessment been done.
Just a bunch of very questionable claims.

qebe
13th January 2025, 06:49
why are you necroing an almost 5 year old post? haha

I found this thread by happenstance.
I am curious where this one bizarre setting was acquired.
Since I've never heard of or seen H2sixty anywhere but here, I took a shot in the preverbal dark.

Could have gone the quieter PM route but thought intersphere might have some answer if anybody was even paying attention. :eek:

qebe
13th January 2025, 07:01
Because there's no real quality assessment been done.
Just a bunch of very questionable claims.

You're being nice but I have a personal interest in this setting.
It's mine, ﴾͡๏̯͡๏﴿
It can be found in the thousands of encodes I've uploaded. :rolleyes:

It's not a real setting per se but rather a identifying tag in all my work.

Wasn't really expecting a reply