Skip to content

feat(vaapi): per-codec quality preset, default to best on AMD#1515

Open
ryancatlin wants to merge 1 commit into
ClassicOldSong:masterfrom
ryancatlin:feat/vaapi-quality-preset
Open

feat(vaapi): per-codec quality preset, default to best on AMD#1515
ryancatlin wants to merge 1 commit into
ClassicOldSong:masterfrom
ryancatlin:feat/vaapi-quality-preset

Conversation

@ryancatlin

Copy link
Copy Markdown
Contributor

What

Adds vaapi_h264_quality, vaapi_hevc_quality, vaapi_av1_quality config
options mapping to ffmpeg's VAAPI -quality knob (the encoder speed/quality
preset, where higher = faster):

  • -1 = driver default (unchanged behaviour)
  • 0 = best quality; higher integers = progressively faster

Why

On AMD VCN the slowest preset is comfortably within the per-frame budget even at
4K, so the driver's "balanced" default is unnecessarily lossy for game streaming
on capable hardware. When the user has not set a value and the VAAPI vendor
is AMD, default to 0 (best). Other vendors (Intel iHD, etc.) keep their driver
default to avoid surprising behaviour changes.

Notes

  • Fully opt-out: set any value explicitly to override, including back to -1.
  • Backend only — happy to follow up with config-UI and docs entries if wanted.

Mesa AMD VAAPI's ffmpeg -quality knob picks the encoder speed/quality
preset, where higher = faster. On VCN3+ the slowest preset is well
within the per-frame budget even at 4K60, so previously leaving this
unset gave a "balanced" default that was unnecessarily lossy for game
streaming on capable hardware.

- New options: vaapi_h264_quality, vaapi_hevc_quality, vaapi_av1_quality
  (-1 = driver default; 0 = best on AMD; higher integers progressively
  faster/lower quality).
- When user has not overridden the value AND VAAPI vendor is AMD, default
  to 0 (best quality) automatically. Other vendors (Intel iHD, etc.) keep
  their driver default to avoid surprising behavior changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant