Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th September 2020, 01:21   #1  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
1 HQ setting for ALL types of video. (also good for removing grain)(& audio settings)

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)]
-
Code:
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
--------------------------------------------------------------------------------------------------
-
Code:
========================================
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  
========================================
-
Code:
          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

Last edited by H2sixty; 4th October 2020 at 08:05. Reason: missing info for handbrake options,tune,profile,level.
H2sixty is offline   Reply With Quote
Old 16th September 2020, 02:05   #2  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,392
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 17th September 2020, 03:25   #3  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
Quote:
Originally Posted by benwaggoner View Post
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.
H2sixty is offline   Reply With Quote
Old 18th September 2020, 07:15   #4  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 512
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.
Quote:
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/maste...visual-options

Last edited by Forteen88; 18th September 2020 at 07:37.
Forteen88 is offline   Reply With Quote
Old 18th September 2020, 19:11   #5  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,392
Quote:
Originally Posted by H2sixty View Post
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 19th September 2020, 22:56   #6  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
Quote:
Originally Posted by Forteen88 View Post
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.
Quote:
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/maste...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...
Quote:
--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?

Last edited by H2sixty; 7th October 2020 at 05:07. Reason: truefulness
H2sixty is offline   Reply With Quote
Old 22nd September 2020, 08:23   #7  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 512
Quote:
Originally Posted by H2sixty View Post
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.
Forteen88 is offline   Reply With Quote
Old 23rd September 2020, 22:56   #8  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
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...)
Attached Images
  

Last edited by H2sixty; 27th September 2020 at 07:56.
H2sixty is offline   Reply With Quote
Old 23rd September 2020, 23:47   #9  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
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

sintel_trailer_2k_0001=============____crf=18____placebo__.mkv

sintel_trailer_2k_0001=============____crf=18.2____placebo____.mkv

very slow for comparison--\/
sintel_trailer_2k_0001=============____crf=18____vs__.mkv

source clip--\/
sintel trailer clip

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

Last edited by H2sixty; 3rd October 2020 at 15:40.
H2sixty is offline   Reply With Quote
Old 23rd September 2020, 23:53   #10  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
Quote:
Originally Posted by benwaggoner View Post
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?

Last edited by H2sixty; 25th September 2020 at 00:10. Reason: added information in [EDIT:]
H2sixty is offline   Reply With Quote
Old 25th September 2020, 09:05   #11  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
sintel full trailer encodes for comparison--\/

sintel_trailer_2k_1080p24____crf=17.5____placebo____.mkv

sintel_trailer_2k_1080p24____crf=18.4____custom____.mkv

3.7GB source video

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.

Last edited by H2sixty; 27th September 2020 at 07:47.
H2sixty is offline   Reply With Quote
Old 25th September 2020, 22:18   #12  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,392
Quote:
Originally Posted by H2sixty View Post
sintel full trailer encodes for comparison--\/

sintel_trailer_2k_1080p24____crf=17.5____placebo____.mkv

sintel_trailer_2k_1080p24____crf=18.4____custom____.mkv

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?

Quote:
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 26th September 2020, 01:19   #13  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
Quote:
Originally Posted by benwaggoner View Post
What is your final command line?
same as posted at start of thread, i only changed crf.
for placebo i erased the advanced box.

Last edited by H2sixty; 27th September 2020 at 08:00.
H2sixty is offline   Reply With Quote
Old 28th September 2020, 17:23   #14  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,392
Quote:
Originally Posted by H2sixty View Post
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.

Quote:
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?
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 4th October 2020, 00:53   #15  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
Quote:
Originally Posted by benwaggoner View Post
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 (preset=veryslow)

sintel_trailer_2k_1080p24____crf=18.4____custom_+_subme=7.mkv (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.
Quote:
Originally Posted by benwaggoner View Post
For example, --tskip isn't used in placebo, because it has no impact on most content.
(he means veryslow...)

Last edited by H2sixty; 5th October 2020 at 07:57. Reason: edited x265 commands, ffmpeg is slightly different.
H2sixty is offline   Reply With Quote
Old 5th October 2020, 01:15   #16  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
quote from Any advice on --tune grain ? thread
Quote:
Originally Posted by benwaggoner View Post
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 . 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.

Last edited by H2sixty; 5th October 2020 at 08:00.
H2sixty is offline   Reply With Quote
Old 5th October 2020, 07:07   #17  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
Quote:
Originally Posted by benwaggoner View Post
Quote:
Originally Posted by H2sixty View Post
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
H2sixty is offline   Reply With Quote
Old 5th October 2020, 09:43   #18  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 153
Quote:
Originally Posted by H2sixty View Post
what is ffmpeg command to pipe a mkv/mp4 file into x265 in realtime as a yuv?
x265 only likes yuv
Code:
"ffmpeg.exe" -i "input" -f yuv4mpegpipe -strict -1 - | "x265.exe"
In some scenarios you will need to change the format before piping (-pix_fmt)
excellentswordfight is offline   Reply With Quote
Old 6th October 2020, 10:15   #19  |  Link
H2sixty
Not a Registered User
 
H2sixty's Avatar
 
Join Date: Aug 2020
Location: earth
Posts: 24
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
H2sixty is offline   Reply With Quote
Old 6th October 2020, 20:08   #20  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,392
Quote:
Originally Posted by H2sixty View Post
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.

Quote:
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.

Quote:
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.

Quote:
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply

Tags
audio, handbrake, hevc, opus, x265

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.