DJATOM / x265-aMod

DJATOM's mod for x265 encoder
GNU General Public License v2.0
84 stars 10 forks source link

strange tag in encoding settings #14

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi @DJATOM, also @Patman86

This happens with both @DJATOM and @Patman86 latest builds. There is a tag appearing in Mediainfo's "Encoder Settings" of encoded files. It seems there is a syntax problem with it:

scenecut-aware-qp=0conformance-window-offsets

What does this tag mean? scenecut-aware-qp=0 has a meaning, OK. conformance-window-offsets is undocumented 😕 scenecut-aware-qp=0conformance-window-offsets appears so to be a mistake 😕

Here are the parameters used in the encoding process: --crf 18 --output-depth 10

Complete command line: "C:\Program Files\StaxRip\Apps\Encoders\x265\x265.exe" --reader-options library="C:\Program Files\StaxRip\Apps\FrameServer\AviSynth\AviSynth.dll" --crf 18 --output-depth 10 --output "C:\Temp\_StaxRip\TimecodeSample25Fps_Chapts_temp\TimecodeSample25Fps_Chapts basic_out.hevc" "C:\Temp\_StaxRip\TimecodeSample25Fps_Chapts_temp\TimecodeSample25Fps_Chapts basic.avs"

Here is the complete encoding section of Mediainfo (look at last line or line before last):

cpuid=1111039 / frame-threads=3 / numa-pools=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1280x720 / interlace=0 / total-frames=1960 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=25 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=4 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=3 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=18.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.03 / no-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 / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / scenecut-aware-qp=0conformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0 / no-vbv-live-multi-pass

This can be reproduced easily! Please check! Thanks!!

DJATOM commented 3 years ago

Weird tag, idk what for it was introduced.

ghost commented 3 years ago

In the definitions (https://bitbucket.org/multicoreware/x265_git/src/bf91444e034831141e0ce02b1200e51996f8b6c6/source/common/param.cpp#lines-2339) line 2339 (thanks @Patman86 for the link): s += sprintf(s, " scenecut-aware-qp=%d", p->bEnableSceneCutAwareQp); if (p->bEnableSceneCutAwareQp) s += sprintf(s, " fwd-scenecut-window=%d fwd-ref-qp-delta=%f fwd-nonref-qp-delta=%f bwd-scenecut-window=%d bwd-ref-qp-delta=%f bwd-nonref-qp-delta=%f", p->fwdScenecutWindow, p->fwdRefQpDelta, p->fwdNonRefQpDelta, p->bwdScenecutWindow, p->bwdRefQpDelta, p->bwdNonRefQpDelta); s += sprintf(s, "conformance-window-offsets right=%d bottom=%d", p->confWinRightOffset, p->confWinBottomOffset);

it appears scenecut-aware-qp=%d and conformance-window-offsets right=%d bottom=%d are two separate tags, so there is a problems when the result is scenecut-aware-qp=0conformance-window-offsets The problem is that the two tags are "merged" and / right=0 / bottom=0 / appear as separate tags. For all we know this could be a problem with Mediainfo!

Patman86 commented 3 years ago

I think there is a whitespace missing in front of conformance-window-offset.

ghost commented 3 years ago

There is also an issue with / right=0 / bottom=0 / Due to the whitespaces inside the expression they are interpreted by Mediainfo as separate tags. Well, they aren't, they are data for conformance-window-offsets. So, in the code: s += sprintf(s, "conformance-window-offsets right=%d bottom=%d", p->confWinRightOffset, p->confWinBottomOffset);

maybe the whitespaces just before "right" and "bottom" should be replaced by underscores ?

So this line of code should look like: s += sprintf(s, " conformance-window-offsets_right=%d_bottom=%d", p->confWinRightOffset, p->confWinBottomOffset);

DJATOM commented 3 years ago

No? Most apps will fail to parse that :D conformance-window-offset-right=%d conformance-window-offset-bottom=%d looks as a proper way to signal that kind of data 🤔

Patman86 commented 3 years ago

No? Most apps will fail to parse that :D conformance-window-offset-right=%d conformance-window-offset-bottom=%d looks as a proper way to signal that kind of data 🤔

That's the right way 😉

ghost commented 3 years ago

Ah! thanks for the clarification !!!

ghost commented 3 years ago

So I think we can close that! Thanks @DJATOM and @Patman86