screen_recorder: add encoder setting with CPU fallback - #49
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.
|
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).