mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-10-01 11:18:12 +03:00
## Link to GitHub Issue, if one exists fixes #442 ## Description of change New NVIDIA driver update (591.44) dropped support for older NVENC API. Specifically, * TDJ uses `NV_ENC_PRESET_HQ_GUID` but this is no longer supported; must be swapped with new encoder presets * `NvEncGetEncodePresetConfig` does not take new encoder presets, the -Ex version must be used All of this happens because bm2dx.dll takes code from an older NVENC sample. To address this, * Install additional hooks for NVENC API * Hijack calls to `NvEncGetEncodePresetConfig` and instead swap with `NvEncGetEncodePresetConfigEx` (only if the initial call fails, which is how we detect old vs new driver), replacing `NV_ENC_PRESET_HQ_GUID` with `NV_ENC_PRESET_P4_GUID` and `NV_ENC_TUNING_INFO_HIGH_QUALITY` (functionally equivalent according to NVIDIA docs - https://docs.nvidia.com/video-technologies/video-codec-sdk/11.1/nvenc-preset-migration-guide/index.html) * When calling `nvEncInitializeEncoder`, hijack and swap in the preset GUID again. ## Testing Tested on 591.44 driver on a RTX 4070. The resulting videos were compared as well, and they are practically identical from encoder perspective.