Repository navigation
feat(vulkan): add vk_quality config option - #5783
Conversation
4adf946 to
da0afc2
Compare
Bundle ReportChanges will increase total bundle size by 2.35kB (0.07%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sunshine-esmAssets Changed:
|
Screenshot ComparisonPR #5783 screenshots vs Matrix:
|
|
The tests are very welcome. I'm thinking about making the default "balanced" option. When "auto" is chosen, ffmpeg sets to 0 (which basically equals to "speed" option). In my case (AMD RX 9070 XT) the "prefer quality" option hugely improved video without noticeable increased latency. |
|
I believe we normally try to have the fastest options as defaults. For 1080p it probably doesn't matter much, but when people push to 4k I'm sure it does. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5783 +/- ##
==========================================
- Coverage 39.54% 39.40% -0.15%
==========================================
Files 122 122
Lines 28196 28321 +125
Branches 12319 12353 +34
==========================================
+ Hits 11151 11159 +8
+ Misses 14745 14168 -577
- Partials 2300 2994 +694
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 51 files with indirect coverage changes Continue to review full report in Codecov by Harness.
|
|
I tested all options (speed, balanced, quality) 4K 60 fps HEVC and AV1. Moonlight reports similar host latency in all cases |
|
Confirmed working on a RX 6600. My card reports driver range 0-3, selects 1 for balanced and 3 for quality. It's not a fault with this PR, but Vulkan encoding unfortunately looks quite a bit worse compared to VAAPI on my hardware. Vulkan with quality set to best and the highest quality tuning has obvious macroblock artifacting when dragging a window on the desktop at low bitrate (10Mbps, with VBR or CBR) that never shows on VAAPI even at its lowest quality level at the same bitrate or non-QP rate control method. I don't think we're mishandling or missing any of the important exposed AVOptions for Vulkan, so perhaps ffmpeg or the driver's implementation just isn't as mature as VAAPI on my particular hardware. |
|
@psyke83 thanks for testing, It might heavily depend on the drivers. 9070 XT reports 4 quality levels, 2 (balanced) and 4 (quality) look superior |
|
You might need to adapt the same adjustment for the balanced quality if the Intel vulkan driver has the same limitation. |
bf12bb1 to
2f6c66a
Compare
|
Added fallback if level doesn't exist, simplified config logic, made balanced default |
2f6c66a to
692740e
Compare
|
@neatnoise could you rebase this on master? |
d10c71e to
7d75ef3
Compare
|
Rebased to master |
Add user-configurable quality level for Vulkan Video encoders. The quality parameter trades encoding speed for better visual quality. Features: - Add vk_quality config option (0 = fastest, higher = better quality) - Query driver's maxQualityLevels via Vulkan API at stream start - Automatically clamp user value to driver's supported maximum - Reuse FFmpeg's Vulkan instance for efficient quality query (no overhead) - Cache render node lookup to avoid repeated instance creation (~10-20ms saved) - Log warning when clamping occurs The maximum quality level is driver-dependent: - AMD (RADV): typically 4 - NVIDIA/Intel: varies by driver Usage in sunshine.conf: vk_quality = 2
7d75ef3 to
b74333b
Compare
|























































































Description
Add a
vk_qualityconfig option for Vulkan encoder. Users can choose between speed, balanced, or quality presets.The code queries the driver for supported quality levels using Vulkan Video API and maps presets to actual values:
Reuses FFmpeg's existing Vulkan instance to query capabilities. No overhead when auto is selected.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.