screen_recorder: add encoder setting with CPU fallback - #49
Open
deeplakes wants to merge 1 commit into
Open
Conversation
GPUs with no hardware video encoder at all (Asahi/Apple Silicon, some VMs) fail vaInitialize during the encoder probe and the recording aborts with no output file. Adds an "encoder" setting (gpu/cpu, default gpu) so users on such hardware can force software encoding, and always passes -fallback-cpu-encoding yes so a hardware encoder that fails at runtime degrades gracefully instead of aborting the recording for anyone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
encodersetting (gpu/cpu, defaultgpu) to the Screen Recorderplugin, and always passes
-fallback-cpu-encoding yestogpu-screen-recorderfor both recording and the replay buffer.
Motivation
On GPUs with no hardware video encoder at all (Asahi/Apple Silicon GPUs, some
VMs),
gpu-screen-recorder's VAAPI probe fails outright:The recording aborts with no output file, and the plugin currently exposes no
way to force software encoding.
gpu-screen-recorderalready supports thisvia
-encoder cpu/-fallback-cpu-encoding yes; the plugin just never wiredit up.
-fallback-cpu-encoding yesis added unconditionally: if a hardwareencoder fails at runtime for any reason, the recording degrades to software
encoding instead of aborting. This is a no-op improvement for everyone with
working hardware encoding.
encoder = cpuadditionally skips the hardware probe entirely, forhardware where it always fails anyway.
Default stays
gpuso existing behavior is unchanged for users with aworking hardware encoder.
Type of Change
Testing
noctalia plugins lint screen_recorder— 0 errors, 0 warningspython3 .github/workflows/validate-plugins.py --root .— validated 12 plugin manifest(s)running Asahi Linux + niri + Noctalia. Before the fix, starting a recording
produced the
vaInitialize failederror above and no output file. Aftersetting
encoder = cpu, a portal-mode recording completed successfully to~/Videos/Recordings.Manual Coverage
Checklist
translations/en.json, or this PR adds no new user-facing strings.Additional Notes
Bumped
plugin.tomlversion from1.2.2to1.3.0(new backward-compatible setting).