rdp/ffmpeg-windows-build-helpers

Non-Free compiled libx265 terrible PSNR/VMAF when cropped compared to free/normal/Gyan release builds

mhdevop opened this issue · 9 comments

Hi, contrary to the title, this is an amazing software package and I understand the basic concepts behind it but in no way the expert on this topic. I bow to anyone's good graces to lend a helping hand on this. I historically have got a FFMPEG release build here (V6.0): https://www.gyan.dev/ffmpeg/builds/ and encoded an MKV BluRay rip (disc I physically own on my bookshelf) to achieve scores of: PSNR ~45+; SSIM 96+; and VMAF 96+ using "slow" and "CRF 22" with libx265. It also gets me to 2.3 GB file size. Credit for nice GUI goes to this fellow https://github.com/fifonik/FFMetrics . I recently tried using this helper package to compile my own FFMPEG so I could take advantage of FDK AAC.

What I discovered is that for some reason I can't explain, if I use the self-compiled FFMPEG with https://github.com/rdp/ffmpeg-windows-build-helper using the exact same everything (slow, CRF22, same stock footage, same computer, etc.) the "metric quality" is terrible by a significant margin. PSNR ~32; SSIM ~96; VMAF ~79. The file size is also much bigger at 3.8 GB which is ironic considering it's way worse quality.

I've compared the Gyan full static build of "options" to my own compiled "options" and there's several differences but I'm not knowledgeable enough to determine if I should be including those in the build or not. I cannot fathom what's so different in compiling FFMPEG using this package vs the Gyan free package so any kind of guidance, logs, or suggestions you can give would be great! Again, this is great software and hopefully I'm just doing something silly (nor not doing something).

My FFMPEG Compiled Build:

ffmpeg version 6.0-ffmpeg-windows-build-helpers Copyright (c) 2000-2023 the FFmpeg developers built with gcc 10.2.0 (GCC) configuration: --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=ffmpeg-windows-build-helpers --enable-version3 --disable-debug --disable-w32threads --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/mhdevop/ffmpegcompile/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --enable-libcaca --enable-gray --enable-libtesseract --enable-fontconfig --enable-gmp --enable-libass --enable-libbluray --enable-libbs2b --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libwebp --enable-libzimg --enable-libzvbi --enable-libmysofa --enable-libopenjpeg --enable-libopenh264 --enable-libvmaf --enable-libsrt --enable-libxml2 --enable-opengl --enable-libdav1d --enable-cuda-llvm --enable-gnutls --enable-libsvtav1 --enable-libvpx --enable-libaom --enable-nvenc --enable-nvdec --extra-libs=-lharfbuzz --extra-libs=-lm --extra-libs=-lshlwapi --extra-libs=-lmpg123 --extra-libs=-lpthread --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCACA_STATIC --enable-amf --enable-libmfx --enable-gpl --enable-frei0r --enable-librubberband --enable-libvidstab --enable-libx264 --enable-libx265 --enable-avisynth --enable-libaribb24 --enable-libxvid --enable-libdavs2 --enable-libxavs2 --enable-libxavs --extra-cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-shared --prefix=/home/mhdevop/ffmpegcompile/ffmpeg-windows-build-helpers/ffmpeg-6.0 --enable-nonfree --enable-libfdk-aac --enable-decklink libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100

Gyan Build:

ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100

My Rig: Windows PC 10 running Ubuntu 22 WSL; i7-6700K; 32 GB RAM

Raw sample FFMPEG Encode command:

ffmpeg.exe -i "D:\Video\StarWars-TheRiseOfSkywalker\Star Wars- The Rise of Skywalker_t00.mkv" -metadata title="Star Wars: The Rise of Skywalker" -max_muxing_queue_size 2048 -filter_complex "[0:0]crop=1920:804:0:138[v]" -map "[v]" -c:v libx265 -pix_fmt yuv420p10le -x265-params "aq-mode=2:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:hdr10_opt=0:hdr10=0:chromaloc=0" -crf:v 22 -preset:v slow -map_metadata -1 -map_chapters 0 -map 0:1 -metadata:s:1 title="Surround 7.1" -metadata:s:1 handler="Surround 7.1" -metadata:s:1 language=eng -c:1 libfdk_aac -b:1 512k -cutoff 20000 -afterburner 1 -map 0:3 -metadata:s:2 title="Stereo" -metadata:s:2 handler="Stereo" -metadata:s:2 language=eng -c:2 libfdk_aac -b:2 128k -cutoff 20000 -afterburner 1 -map 0:4 -c:3 copy -disposition:3 0 -metadata:s:3 language='eng' -default_mode infer_no_subs -tag:v hvc1 "L:\AV1Tests\Star Wars- The Rise of Skywalker_ffmpegcomp-skywalker-slow-22-fdk.mkv"

Ubuntu WSL Command I'm running generating only a x64 build for Windows (I manually downloaded the 6.0 release of FFMPEG source code folder thinking the latest build was squirrely):

./cross_compile_ffmpeg.sh --disable-nonfree=n --prefer-stable=y --build-lsw=n --ffmpeg-source-dir=/home/mhdevop/ffmpegcompile/ffmpeg-windows-build-helpers/ffmpeg-6.0

(Extra credit if someone can throw in an explanation of what the "*_g.exe" builds are?)
ConsoleOutputDuringBuild.txt

rdp commented

I guess first question is how does gyan compile libx265?

I guess first question is how does gyan compile libx265?

I wish I could even begin to tell you that but that's far above my understanding. That's just the public place to download the precompiled binaries direct off the FFMEG website. Any suggestions or things I could try?

@GyanD may help.

GyanD commented

Rerun with both builds after adding -t 10 -report as output options. Share reports.

Rerun with both builds after adding -t 10 -report as output options. Share reports.

Here you are:

GYAN-ffmpeg-20230412-073738.log
customcompiled-ffmpeg-20230412-073249.log

Just realized the previous log was from a different project compiled and not this (same issue oddly enough) one so re-posting:

compiledffmpeg-20230412-084426.log

GyanD commented

Looks like the video encode is the same

Output file #0 (L:\AV1Tests\Star Wars- The Rise of Skywalker_ffmpegcomp-skywalker-slow-22-time10-fdk2.mkv):
  Output stream #0:0 (video): 240 frames encoded; 240 packets muxed (227000 bytes); 

vs.

Output file #0 (L:\AV1Tests\Star Wars- The Rise of Skywalker_ffmpeggyan-skywalker-slow-22-time100-fdk.mkv):
  Output stream #0:0 (video): 240 frames encoded; 240 packets muxed (227000 bytes); 

I suggest you recheck the metrics run.

Looks like the video encode is the same

Output file #0 (L:\AV1Tests\Star Wars- The Rise of Skywalker_ffmpegcomp-skywalker-slow-22-time10-fdk2.mkv):
  Output stream #0:0 (video): 240 frames encoded; 240 packets muxed (227000 bytes); 

vs.

Output file #0 (L:\AV1Tests\Star Wars- The Rise of Skywalker_ffmpeggyan-skywalker-slow-22-time100-fdk.mkv):
  Output stream #0:0 (video): 240 frames encoded; 240 packets muxed (227000 bytes); 

I suggest you recheck the metrics run.

Apology from me to all of you: I did re-check the metrics at your behest and even did it "from scratch" using no cropping and it does confirm matching expectations (great metrics). Hopefully this is something as simple as an encoding option or explanation.

UPDATE: If I self-compile FFMPEG with "free" options (e.g. no FDK-aac) it has the desired effect and works like Gyan and any other normal free FFMPEG build a person can download! In other words, something changes for encoding when enabling non-free plugins. (changes some HEVC library despite specifying it in the encode command? Changes some kind of FFMPEG filter code? ) Also, my eyes aren't great but I don't think there is any noticeable difference between the terrible VMAF score and the source so it's as if VMAF and PSNR break when using non-free. Can someone else please confirm this behavior?

So to re-focus this issue due to my failure of explaining:

The metrics make no sense if I:

  1. Take original source BluRay video and only "crop" (assuming I did that correctly) the video and use UTVIDEO (lossless) to quickly make a source compare sample:
    ffmpeg.exe -i "D:\Video\StarWars-TheRiseOfSkywalker\Star Wars- The Rise of Skywalker_t00.mkv" -t 180 -metadata title="Star Wars: The Rise of Skywalker" -max_muxing_queue_size 1024 -filter_complex "[0:0]crop=1920:804:0:138[v]" -map "[v]" -c utvideo "L:\AV1Tests\Star Wars- The Rise of Skywalker_cropped-t180.mkv"

  2. Use the lossless cropped footage just created as the "source" metrics compare and then use my above already explained HEVC encoded as the "degraded" compare.

  3. Here's the kicker, I drop in an encode that used Gyan's FFMPEG using same settings (including crop) and that same metric comes back as expected. In other words, something in how each video is encoded using my own compiled code doesn't like the "source" being UTVIDEO perhaps? Maybe some kind of cropping/filtering isn't matching? (Just hypothesizing)

Here's a screenshot showing the same "dimensions" of the footage are the same and encoded using same commands. It's also strange that one of the three metrics does almost line up. (my "compiled" FFMPEG encoding a video and Gyan's FFMPEG encoding same):
image

Media Info on Both Files:

`General
Unique ID : 180578130146285152139601464772945389734 (0x87DA15335D74814F985AB21F579E28A6)
Complete name : L:\AV1Tests\Star Wars- The Rise of Skywalker_ffmpegcomp-skywalker-slow-22-time180-fdk.mkv
Format : Matroska
Format version : Version 4
File size : 55.1 MiB
Duration : 3 min 0 s
Overall bit rate : 2 567 kb/s
Movie name : Star Wars: The Rise of Skywalker
Writing application : Lavf60.4.101
Writing library : Lavf60.4.101
ErrorDetectionType : Per level 1

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 3 min 0 s
Width : 1 920 pixels
Height : 804 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 0)
Bit depth : 10 bits
Writing library : x265 3.5+1-ce882936d:[Windows][GCC 10.2.0][64 bit] 10bit
Encoding settings : 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=1920x804 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=4 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=25 / lookahead-slices=4 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / 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 / limit-modes / me=3 / subme=3 / 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=4 / selective-sao=4 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=22.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=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=1 / chromaloc-top=0 / chromaloc-bottom=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
Default : Yes
Forced : No
Color range : Limited

Audio #1
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : A_AAC-2
Duration : 3 min 0 s
Channel(s) : 8 channels
Channel layout : C L R Ls Rs Lb Rb LFE
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Title : Surround 7.1
Writing library : Lavc60.9.100 libfdk_aac
Language : English
Default : Yes
Forced : No
HANDLER : Surround 7.1

Audio #2
ID : 3
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : A_AAC-2
Duration : 3 min 0 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Title : Stereo
Writing library : Lavc60.9.100 libfdk_aac
Language : English
Default : No
Forced : No
HANDLER : Stereo

Text
ID : 4
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 2 min 43 s
Language : 'eng'
Default : No
Forced : No

Menu
00:00:00.000 : 00:00:00.000
00:00:09.092 : 00:00:09.092
00:01:41.017 : 00:01:41.017`


`General
Unique ID : 190118361324809938533101813347033916545 (0x8F0776E9D23A218CB5C83D9801CDA481)
Complete name : L:\AV1Tests\Star Wars- The Rise of Skywalker_ffmpeg-sllow-22-new.mkv
Format : Matroska
Format version : Version 4
File size : 55.0 MiB
Duration : 3 min 0 s
Overall bit rate : 2 562 kb/s
Movie name : Star Wars: The Rise of Skywalker
Writing application : Lavf60.3.100
Writing library : Lavf60.3.100
ErrorDetectionType : Per level 1

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 3 min 0 s
Width : 1 920 pixels
Height : 804 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 0)
Bit depth : 10 bits
Writing library : x265 3.5+96-9c9ab68fc:[Windows][GCC 12.2.0][64 bit] 10bit
Encoding settings : 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=1920x804 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=4 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-eob / no-eos / no-hrd / info / hash=0 / temporal-layers=0 / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=25 / lookahead-slices=4 / scenecut=40 / no-hist-scenecut / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / 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 / limit-modes / me=3 / subme=3 / 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=4 / selective-sao=4 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=22.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=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=1 / chromaloc-top=0 / chromaloc-bottom=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 / 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 / no-mcstf / no-sbrc
Default : Yes
Forced : No
Color range : Limited

Audio #1
ID : 2
ID in the original source medium : 4352 (0x1100)
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : A_AAC-2
Duration : 3 min 0 s
Bit rate : 4 997 kb/s
Channel(s) : 8 channels
Channel layout : C L R Ls Rs Lw Rw LFE
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 4.95 GiB
Title : Surround 7.1
Writing library : Lavc60.3.100 aac
Language : English
Default : Yes
Forced : No
HANDLER : Surround 7.1
Original source medium : Blu-ray

Audio #2
ID : 3
ID in the original source medium : 4353 (0x1101)
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : A_AAC-2
Duration : 3 min 0 s
Bit rate : 320 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 325 MiB
Title : Stereo
Writing library : Lavc60.3.100 aac
Language : English
Default : No
Forced : No
HANDLER : Stereo
Original source medium : Blu-ray

Text
ID : 4
ID in the original source medium : 4608 (0x1200)
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 2 min 43 s
Bit rate : 37.4 kb/s
Frame rate : 23.113 FPS
Count of elements : 3790
Stream size : 35.2 MiB (64%)
Language : 'eng'
Default : No
Forced : No
Original source medium : Blu-ray

Menu
00:00:00.000 : Chapter 01
00:00:09.092 : Chapter 02
00:01:41.017 : Chapter 03

`

Hi @GyanD and if you had any final comments here let me know otherwise I'll get this closed out in a few days? (found quite a few of your StackOverflow posts related to FFMPEG of course)

Short story = After knocking my head on the wall for days I figured it out! Simple removing this section of the encoding command fixes it:

-x265-params "aq-mode=2:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:hdr10_opt=0:hdr10=0:chromaloc=0"

Long story = scouring the internet and every crevice I found yet another amazing tool from the community:
https://github.com/pixop/video-compare
I compared the encoded videos side by side "live" and could not tell any difference to the naked eye. This got me thinking how that could possibly be? Then it hit me, the keyframes might not be lining up! Quick ffprobe revealed the 2 encoded videos did indeed have different keyframes despite using the same encoding commands. I have no why the x265 "parameters" would cause the keyframes to generate differently but that ended up being the answer. (Probably not worth submitting a bug report to x265 project)