Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

feat(recording): surface automatic software-encoder fallback in the HUD

My-Deniad3a749b7d416
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index 2eb36ec7e..4002de9b7 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -1040,6 +1040,25 @@ function readNativeWindowsWebcamFormat(output: string) {
}
}
+function readNativeWindowsEncoderSelection(output: string) {
+ const lines = output
+ .split(/\r?\n/)
+ .filter((line) => line.includes('"event":"encoder-selection"'));
+ const lastLine = lines.at(-1);
+ if (!lastLine) {
+ return null;
+ }
+
+ try {
+ return JSON.parse(lastLine) as {
+ video?: string;
+ preferSoftwareEncoder?: boolean;
+ };
+ } catch {
+ return null;
+ }
+}
+
function tryParseNativeHelperEvent(line: string) {
try {
const parsed = JSON.parse(line);
@@ -1729,10 +1748,12 @@ export function registerIpcHandlers(
? Math.max(0, captureStartedAtMs - cursorStartTimeMs)
: 0;
const webcamFormat = readNativeWindowsWebcamFormat(nativeWindowsCaptureOutput);
+ const encoderSelection = readNativeWindowsEncoderSelection(nativeWindowsCaptureOutput);
console.info("[native-wgc] capture started", {
captureStartedAtMs,
cursorOffsetMs: nativeWindowsCursorOffsetMs,
webcamFormat,
+ encoderSelection,
});
const source = selectedSource || { name: "Screen" };
@@ -1745,6 +1766,7 @@ export function registerIpcHandlers(
recordingId,
path: outputPath,
helperPath,
+ videoEncoderSelection: encoderSelection?.video ?? null,
};
} catch (error) {
console.error("Failed to start native Windows recording:", error);
diff --git a/electron/native/README.md b/electron/native/README.md
index 2ac0ce96f..0d76b1451 100644
--- a/electron/native/README.md
+++ b/electron/native/README.md
@@ -86,6 +86,8 @@ The current helper implementation supports display/window video capture, system
Encoder selection: by default the helper keeps the existing sink-writer path first. If that path fails while setting up H.264, it retries with the Microsoft software H.264 encoder (`mfh264enc.dll`). The key of this retry is registering that encoder locally in the helper process via `MFTRegisterLocalByCLSID`, which makes a software H.264 encoder available even when the machine's hardware encoders are missing or broken; hardware transforms are disabled for the retry only as a secondary guard so the sink writer prefers the locally registered software encoder, not as the fallback mechanism itself. Set `preferSoftwareEncoder: true` in the helper JSON, or set `OPENSCREEN_WGC_PREFER_SOFTWARE_ENCODER=true` before launching Electron, to force the software path from the first attempt.
+The helper reports the outcome through the `encoder-selection` stdout event (`video` is `default`, `software-preferred`, or `software-fallback`). When the app sees `software-fallback` — the default encoder failed and the helper switched on its own — it shows a small dismissible notice in the recording HUD with a "Don't show again" option, because software encoding can raise CPU usage. An explicit `software-preferred` selection shows no notice, and the event stays available for diagnostics either way.
+
Encoder diagnostic on final sink-writer failure: when the final `MFCreateSinkWriterFromURL` attempt fails, the helper logs the registered H.264 video encoder MFT count (via `MFTEnumEx`), the registered AAC encoder count when audio was requested, and the hex HRESULT. If no H.264 encoder is registered, it additionally emits the four-bullet actionable error (missing Media Feature Pack / GPU driver registration / empty `HKLM:\SOFTWARE\Microsoft\Windows Media Foundation\Transforms` / reboot). If an H.264 encoder IS registered but the sink writer still failed, it logs a hint pointing at invalid output path, missing MP4 mux, or GPU driver incompatibility. There is still no fail-fast pre-flight gate because `MFTEnumEx` and `MFCreateSinkWriterFromURL` can disagree about which H.264 encoders are available in non-interactive / Session 0 contexts.
Smoke-test the helper with:
diff --git a/src/components/launch/LaunchWindow.test.tsx b/src/components/launch/LaunchWindow.test.tsx
index 8f9a508c4..154feef73 100644
--- a/src/components/launch/LaunchWindow.test.tsx
+++ b/src/components/launch/LaunchWindow.test.tsx
@@ -55,6 +55,8 @@ const recorderState = vi.hoisted(() => ({
setSystemAudioEnabled: vi.fn(),
cursorCaptureMode: "editable-overlay",
setCursorCaptureMode: vi.fn(),
+ softwareEncoderFallbackNoticeVisible: false,
+ dismissSoftwareEncoderFallbackNotice: vi.fn(),
},
}));
@@ -145,6 +147,11 @@ vi.mock("@/contexts/I18nContext", () => ({
"We detected English as your system language. Do you want to switch OpenScreen to English?",
"systemLanguagePrompt.keepDefault": "Keep current language",
"systemLanguagePrompt.switch": "Switch to English",
+ "softwareEncoderFallback.title": "Switched to software encoding",
+ "softwareEncoderFallback.description":
+ "The default GPU encoder failed to start, so OpenScreen fell back to software H.264 encoding. Recording should continue as normal, but CPU usage may be higher.",
+ "softwareEncoderFallback.dismiss": "Got it",
+ "softwareEncoderFallback.dontShowAgain": "Don't show again",
};
return translations[key] ?? key;
},
@@ -223,6 +230,8 @@ function emitSourceSelectorClosed() {
function resetLaunchMocks() {
vi.stubGlobal("ResizeObserver", StubResizeObserver);
recorderState.value.toggleRecording.mockClear();
+ recorderState.value.softwareEncoderFallbackNoticeVisible = false;
+ recorderState.value.dismissSoftwareEncoderFallbackNotice.mockClear();
selectedSourceChangedListeners = [];
sourceSelectorClosedListeners = [];
i18nState.value.systemLocaleSuggestion = null;
@@ -450,3 +459,52 @@ describe("LaunchWindow system language prompt", () => {
expect(height).toBeLessThan(viewportHeight + 24);
});
});
+
+describe("LaunchWindow software encoder fallback notice", () => {
+ beforeEach(() => {
+ platformState.value = "darwin";
+ resetLaunchMocks();
+ });
+
+ afterEach(() => {
+ cleanup();
+ vi.unstubAllGlobals();
+ });
+
+ it("stays hidden while the recorder reports no fallback", () => {
+ renderLaunchWindow();
+
+ expect(screen.queryByText("Switched to software encoding")).not.toBeInTheDocument();
+ });
+
+ it("shows the notice when the recorder reports a software fallback", async () => {
+ recorderState.value.softwareEncoderFallbackNoticeVisible = true;
+
+ renderLaunchWindow();
+
+ expect(await screen.findByText("Switched to software encoding")).toBeInTheDocument();
+ expect(screen.getByText(/fell back to software H\.264 encoding/)).toBeInTheDocument();
+ });
+
+ it("dismisses the notice without persisting when Got it is clicked", async () => {
+ recorderState.value.softwareEncoderFallbackNoticeVisible = true;
+
+ renderLaunchWindow();
+
+ fireEvent.click(await screen.findByRole("button", { name: "Got it" }));
+
+ expect(recorderState.value.dismissSoftwareEncoderFallbackNotice).toHaveBeenCalledTimes(1);
+ expect(recorderState.value.dismissSoftwareEncoderFallbackNotice).toHaveBeenCalledWith();
+ });
+
+ it("persists the suppression when Don't show again is clicked", async () => {
+ recorderState.value.softwareEncoderFallbackNoticeVisible = true;
+
+ renderLaunchWindow();
+
+ fireEvent.click(await screen.findByRole("button", { name: "Don't show again" }));
+
+ expect(recorderState.value.dismissSoftwareEncoderFallbackNotice).toHaveBeenCalledTimes(1);
+ expect(recorderState.value.dismissSoftwareEncoderFallbackNotice).toHaveBeenCalledWith(true);
+ });
+});
diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsx
index b8cf24f22..70acc7ff0 100644
--- a/src/components/launch/LaunchWindow.tsx
+++ b/src/components/launch/LaunchWindow.tsx
@@ -136,6 +136,8 @@ export function LaunchWindow() {
setWebcamDeviceName,
cursorCaptureMode,
setCursorCaptureMode,
+ softwareEncoderFallbackNoticeVisible,
+ dismissSoftwareEncoderFallbackNotice,
} = useScreenRecorder();
const showMicControls = microphoneEnabled && !recording;
@@ -159,6 +161,7 @@ export function LaunchWindow() {
const hudBarRef = useRef<HTMLDivElement | null>(null);
const deviceSelectorRef = useRef<HTMLDivElement | null>(null);
const systemLocalePromptRef = useRef<HTMLDivElement | null>(null);
+ const softwareFallbackNoticeRef = useRef<HTMLDivElement | null>(null);
// Measured bar height, anchors the popups above the tall vertical tray so they don't overlap it.
const [hudBarHeight, setHudBarHeight] = useState(0);
const [languageMenuStyle, setLanguageMenuStyle] = useState<{
@@ -372,6 +375,17 @@ export function LaunchWindow() {
halfWidth = Math.max(halfWidth, centerX - rect.left, rect.right - centerX);
}
+ // The software-encoder fallback notice shares the prompt's fixed top-8 slot and needs
+ // the same treatment so its buttons stay clickable.
+ if (softwareFallbackNoticeRef.current) {
+ const rect = softwareFallbackNoticeRef.current.getBoundingClientRect();
+ const noticeHeight = rect.height || softwareFallbackNoticeRef.current.scrollHeight;
+ if (noticeHeight > 0) {
+ topFromBottom = Math.max(topFromBottom, rect.top + noticeHeight);
+ }
+ halfWidth = Math.max(halfWidth, centerX - rect.left, rect.right - centerX);
+ }
+
setHudBarHeight((prev) => {
const next = Math.round(barEl.scrollHeight);
return Math.abs(prev - next) > 1 ? next : prev;
@@ -396,6 +410,7 @@ export function LaunchWindow() {
if (deviceSelectorRef.current) observer.observe(deviceSelectorRef.current);
// Backfill refs set before the observer existed (e.g. the prompt or language menu).
if (systemLocalePromptRef.current) observer.observe(systemLocalePromptRef.current);
+ if (softwareFallbackNoticeRef.current) observer.observe(softwareFallbackNoticeRef.current);
if (languageMenuPanelRef.current) observer.observe(languageMenuPanelRef.current);
measureHudSize();
return () => {
@@ -430,6 +445,10 @@ export function LaunchWindow() {
(el: HTMLDivElement | null) => observeHudElement(el, systemLocalePromptRef),
[observeHudElement],
);
+ const setSoftwareFallbackNoticeEl = useCallback(
+ (el: HTMLDivElement | null) => observeHudElement(el, softwareFallbackNoticeRef),
+ [observeHudElement],
+ );
const hudIgnoreMouseEventsRef = useRef<boolean | undefined>(undefined);
const setHudMouseEventsEnabled = useCallback(
@@ -688,6 +707,40 @@ export function LaunchWindow() {
</div>
)}
+ {softwareEncoderFallbackNoticeVisible && (
+ <div
+ ref={setSoftwareFallbackNoticeEl}
+ data-hud-interactive="true"
+ className={`fixed top-8 left-1/2 z-30 w-[calc(100vw-1rem)] max-w-[520px] -translate-x-1/2 rounded-xl border border-white/15 bg-[rgba(20,20,28,0.95)] p-3 shadow-2xl backdrop-blur-xl text-white animate-in fade-in-0 zoom-in-95 duration-200 ${styles.electronNoDrag}`}
+ >
+ <div className="text-[13px] font-semibold text-white">
+ {t("softwareEncoderFallback.title")}
+ </div>
+ <div className="mt-1 text-[11px] leading-relaxed text-white/75">
+ {t("softwareEncoderFallback.description")}
+ </div>
+ <div className="mt-3 flex items-center justify-end gap-2">
+ <Button
+ type="button"
+ variant="ghost"
+ size="sm"
+ onClick={() => dismissSoftwareEncoderFallbackNotice(true)}
+ className="h-7 text-xs text-white/80 hover:bg-white/10 hover:text-white"
+ >
+ {t("softwareEncoderFallback.dontShowAgain")}
+ </Button>
+ <Button
+ type="button"
+ size="sm"
+ onClick={() => dismissSoftwareEncoderFallbackNotice()}
+ className="h-7 text-xs bg-white text-[#10121b] hover:bg-white/90"
+ >
+ {t("softwareEncoderFallback.dismiss")}
+ </Button>
+ </div>
+ </div>
+ )}
+
{/* Device selectors, fixed above HUD bar, viewport-relative, never clipped */}
{(showMicControls || showWebcamControls) && (
<div
diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.ts
index 8f266c4e7..656509763 100644
--- a/src/hooks/useScreenRecorder.ts
+++ b/src/hooks/useScreenRecorder.ts
@@ -13,7 +13,7 @@ import {
} from "@/lib/nativeWindowsRecording";
import type { CursorCaptureMode, RecordedVideoAssetInput } from "@/lib/recordingSession";
import { requestCameraAccess } from "@/lib/requestCameraAccess";
-import { loadUserPreferences } from "@/lib/userPreferences";
+import { loadUserPreferences, saveUserPreferences } from "@/lib/userPreferences";
import { createRecorderHandle, type RecorderHandle } from "./recorderHandle";
const TARGET_FRAME_RATE = 60;
@@ -74,6 +74,8 @@ type UseScreenRecorderReturn = {
setWebcamEnabled: (enabled: boolean) => Promise<boolean>;
cursorCaptureMode: CursorCaptureMode;
setCursorCaptureMode: (mode: CursorCaptureMode) => void;
+ softwareEncoderFallbackNoticeVisible: boolean;
+ dismissSoftwareEncoderFallbackNotice: (dontShowAgain?: boolean) => void;
};
type NativeWindowsRecordingHandle = {
@@ -103,6 +105,8 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
const [systemAudioEnabled, setSystemAudioEnabled] = useState(false);
const [webcamEnabled, setWebcamEnabledState] = useState(false);
const [cursorCaptureMode, setCursorCaptureMode] = useState<CursorCaptureMode>("editable-overlay");
+ const [softwareEncoderFallbackNoticeVisible, setSoftwareEncoderFallbackNoticeVisible] =
+ useState(false);
const screenRecorder = useRef<RecorderHandle | null>(null);
const webcamRecorder = useRef<RecorderHandle | null>(null);
const nativeWindowsRecording = useRef<NativeWindowsRecordingHandle | null>(null);
@@ -891,6 +895,13 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
throw new Error(result.error ?? "Native Windows capture failed.");
}
+ // Tell the user when the helper silently switched away from the default
+ // GPU encoder; an explicit software-preferred selection needs no notice.
+ setSoftwareEncoderFallbackNoticeVisible(
+ result.videoEncoderSelection === "software-fallback" &&
+ !loadUserPreferences().hideSoftwareEncoderFallbackNotice,
+ );
+
recordingId.current = result.recordingId;
nativeWindowsRecording.current = {
recordingId: result.recordingId,
@@ -1682,6 +1693,13 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
}
};
+ const dismissSoftwareEncoderFallbackNotice = (dontShowAgain = false) => {
+ if (dontShowAgain) {
+ saveUserPreferences({ hideSoftwareEncoderFallbackNotice: true });
+ }
+ setSoftwareEncoderFallbackNoticeVisible(false);
+ };
+
return {
recording,
paused,
@@ -1708,5 +1726,7 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
setWebcamEnabled,
cursorCaptureMode,
setCursorCaptureMode,
+ softwareEncoderFallbackNoticeVisible,
+ dismissSoftwareEncoderFallbackNotice,
};
}
diff --git a/src/i18n/locales/ar/launch.json b/src/i18n/locales/ar/launch.json
index e3a855e65..5dde6a8f9 100644
--- a/src/i18n/locales/ar/launch.json
+++ b/src/i18n/locales/ar/launch.json
@@ -57,5 +57,11 @@
"cursor": {
"useEditableCursor": "استخدام مؤشر قابل للتحرير",
"useSystemCursor": "استخدام مؤشر النظام"
+ },
+ "softwareEncoderFallback": {
+ "title": "تم التبديل إلى الترميز البرمجي",
+ "description": "تعذّر تشغيل مرمّز GPU الافتراضي، لذا تحوّل OpenScreen إلى ترميز H.264 البرمجي. سيستمر التسجيل كالمعتاد، لكن استخدام المعالج قد يكون أعلى.",
+ "dismiss": "حسنًا",
+ "dontShowAgain": "عدم الإظهار مرة أخرى"
}
}
diff --git a/src/i18n/locales/en/launch.json b/src/i18n/locales/en/launch.json
index 0066a3fc9..87929ef90 100644
--- a/src/i18n/locales/en/launch.json
+++ b/src/i18n/locales/en/launch.json
@@ -61,5 +61,11 @@
"description": "We detected {{language}} as your system language. Do you want to switch OpenScreen to {{language}}?",
"switch": "Switch to {{language}}",
"keepDefault": "Keep current language"
+ },
+ "softwareEncoderFallback": {
+ "title": "Switched to software encoding",
+ "description": "The default GPU encoder failed to start, so OpenScreen fell back to software H.264 encoding. Recording should continue as normal, but CPU usage may be higher.",
+ "dismiss": "Got it",
+ "dontShowAgain": "Don't show again"
}
}
diff --git a/src/i18n/locales/es/launch.json b/src/i18n/locales/es/launch.json
index 90ef56865..6b903087c 100644
--- a/src/i18n/locales/es/launch.json
+++ b/src/i18n/locales/es/launch.json
@@ -57,5 +57,11 @@
"description": "Detectamos {{language}} como idioma de tu sistema. ¿Quieres cambiar OpenScreen a {{language}}?",
"switch": "Cambiar a {{language}}",
"keepDefault": "Mantener idioma actual"
+ },
+ "softwareEncoderFallback": {
+ "title": "Se cambió a codificación por software",
+ "description": "El codificador GPU predeterminado no pudo iniciarse, por lo que OpenScreen pasó a la codificación H.264 por software. La grabación debería continuar con normalidad, pero el uso de CPU puede ser mayor.",
+ "dismiss": "Entendido",
+ "dontShowAgain": "No volver a mostrar"
}
}
diff --git a/src/i18n/locales/fr/launch.json b/src/i18n/locales/fr/launch.json
index 8c0b59e59..0d6a820b3 100644
--- a/src/i18n/locales/fr/launch.json
+++ b/src/i18n/locales/fr/launch.json
@@ -57,5 +57,11 @@
"description": "Nous avons détecté {{language}} comme langue système. Voulez-vous passer OpenScreen en {{language}} ?",
"switch": "Passer en {{language}}",
"keepDefault": "Conserver la langue actuelle"
+ },
+ "softwareEncoderFallback": {
+ "title": "Passage à l'encodage logiciel",
+ "description": "L'encodeur GPU par défaut n'a pas pu démarrer, OpenScreen est donc passé à l'encodage H.264 logiciel. L'enregistrement devrait continuer normalement, mais l'utilisation du processeur peut être plus élevée.",
+ "dismiss": "Compris",
+ "dontShowAgain": "Ne plus afficher"
}
}
diff --git a/src/i18n/locales/it/launch.json b/src/i18n/locales/it/launch.json
index b46adbd86..8e7f013bf 100644
--- a/src/i18n/locales/it/launch.json
+++ b/src/i18n/locales/it/launch.json
@@ -57,5 +57,11 @@
"description": "Abbiamo rilevato {{language}} come lingua del sistema. Vuoi passare OpenScreen a {{language}}?",
"switch": "Passa a {{language}}",
"keepDefault": "Mantieni la lingua corrente"
+ },
+ "softwareEncoderFallback": {
+ "title": "Passaggio alla codifica software",
+ "description": "L'encoder GPU predefinito non si è avviato, quindi OpenScreen è passato alla codifica H.264 software. La registrazione dovrebbe continuare normalmente, ma l'uso della CPU potrebbe essere più alto.",
+ "dismiss": "Ho capito",
+ "dontShowAgain": "Non mostrare più"
}
}
diff --git a/src/i18n/locales/ja-JP/launch.json b/src/i18n/locales/ja-JP/launch.json
index a9291b02b..676cd272c 100644
--- a/src/i18n/locales/ja-JP/launch.json
+++ b/src/i18n/locales/ja-JP/launch.json
@@ -57,5 +57,11 @@
"description": "システム言語として{{language}}が検出されました。OpenScreenを{{language}}に切り替えますか?",
"switch": "{{language}}に切り替え",
"keepDefault": "現在の言語を保持"
+ },
+ "softwareEncoderFallback": {
+ "title": "ソフトウェアエンコードに切り替えました",
+ "description": "既定のGPUエンコーダーを開始できなかったため、OpenScreenはソフトウェアH.264エンコードに切り替えました。録画はそのまま続行されますが、CPU使用率が高くなる場合があります。",
+ "dismiss": "OK",
+ "dontShowAgain": "今後表示しない"
}
}
diff --git a/src/i18n/locales/ko-KR/launch.json b/src/i18n/locales/ko-KR/launch.json
index 3c20f2236..645a1a10f 100644
--- a/src/i18n/locales/ko-KR/launch.json
+++ b/src/i18n/locales/ko-KR/launch.json
@@ -57,5 +57,11 @@
"description": "시스템 언어가 {{language}}(으)로 감지되었습니다. OpenScreen을 {{language}}(으)로 전환하시겠습니까?",
"switch": "{{language}}(으)로 전환",
"keepDefault": "현재 언어 유지"
+ },
+ "softwareEncoderFallback": {
+ "title": "소프트웨어 인코딩으로 전환됨",
+ "description": "기본 GPU 인코더를 시작할 수 없어 OpenScreen이 소프트웨어 H.264 인코딩으로 전환했습니다. 녹화는 정상적으로 계속되지만 CPU 사용량이 높아질 수 있습니다.",
+ "dismiss": "확인",
+ "dontShowAgain": "다시 표시하지 않음"
}
}
diff --git a/src/i18n/locales/pt-BR/launch.json b/src/i18n/locales/pt-BR/launch.json
index 79d44fc61..1df01ff79 100644
--- a/src/i18n/locales/pt-BR/launch.json
+++ b/src/i18n/locales/pt-BR/launch.json
@@ -55,5 +55,11 @@
"description": "Detectamos {{language}} como o idioma do seu sistema. Deseja mudar o OpenScreen para {{language}}?",
"switch": "Mudar para {{language}}",
"keepDefault": "Manter idioma atual"
+ },
+ "softwareEncoderFallback": {
+ "title": "Mudou para codificação por software",
+ "description": "O codificador de GPU padrão não pôde ser iniciado, então o OpenScreen passou a usar a codificação H.264 por software. A gravação deve continuar normalmente, mas o uso da CPU pode ser maior.",
+ "dismiss": "Entendi",
+ "dontShowAgain": "Não mostrar novamente"
}
}
diff --git a/src/i18n/locales/ru/launch.json b/src/i18n/locales/ru/launch.json
index 00a227ca4..b41f07bab 100644
--- a/src/i18n/locales/ru/launch.json
+++ b/src/i18n/locales/ru/launch.json
@@ -57,5 +57,11 @@
"cursor": {
"useEditableCursor": "Использовать редактируемый курсор",
"useSystemCursor": "Использовать системный курсор"
+ },
+ "softwareEncoderFallback": {
+ "title": "Выполнен переход на программное кодирование",
+ "description": "Стандартный GPU-кодировщик не запустился, поэтому OpenScreen перешёл на программное кодирование H.264. Запись продолжится как обычно, но нагрузка на процессор может быть выше.",
+ "dismiss": "Понятно",
+ "dontShowAgain": "Больше не показывать"
}
}
diff --git a/src/i18n/locales/tr/launch.json b/src/i18n/locales/tr/launch.json
index b670178a7..d30ddd0bc 100644
--- a/src/i18n/locales/tr/launch.json
+++ b/src/i18n/locales/tr/launch.json
@@ -57,5 +57,11 @@
"description": "Sistem diliniz {{language}} olarak algılandı. OpenScreen i {{language}} diline geçirmek ister misiniz?",
"switch": "{{language}} diline geç",
"keepDefault": "Mevcut dili koru"
+ },
+ "softwareEncoderFallback": {
+ "title": "Yazılım kodlamasına geçildi",
+ "description": "Varsayılan GPU kodlayıcı başlatılamadığı için OpenScreen yazılım tabanlı H.264 kodlamasına geçti. Kayıt normal şekilde devam eder, ancak CPU kullanımı daha yüksek olabilir.",
+ "dismiss": "Anladım",
+ "dontShowAgain": "Bir daha gösterme"
}
}
diff --git a/src/i18n/locales/vi/launch.json b/src/i18n/locales/vi/launch.json
index 203f2b414..c9f3c3bf4 100644
--- a/src/i18n/locales/vi/launch.json
+++ b/src/i18n/locales/vi/launch.json
@@ -57,5 +57,11 @@
"cursor": {
"useEditableCursor": "Dùng con trỏ có thể chỉnh sửa",
"useSystemCursor": "Dùng con trỏ hệ thống"
+ },
+ "softwareEncoderFallback": {
+ "title": "Đã chuyển sang mã hóa bằng phần mềm",
+ "description": "Bộ mã hóa GPU mặc định không khởi động được, nên OpenScreen đã chuyển sang mã hóa H.264 bằng phần mềm. Quá trình ghi vẫn tiếp tục bình thường, nhưng mức sử dụng CPU có thể cao hơn.",
+ "dismiss": "Đã hiểu",
+ "dontShowAgain": "Không hiển thị lại"
}
}
diff --git a/src/i18n/locales/zh-CN/launch.json b/src/i18n/locales/zh-CN/launch.json
index f78a611c0..b20f4546c 100644
--- a/src/i18n/locales/zh-CN/launch.json
+++ b/src/i18n/locales/zh-CN/launch.json
@@ -57,5 +57,11 @@
"description": "我们检测到你的系统语言是{{language}}。是否将 OpenScreen 切换为{{language}}?",
"switch": "切换到{{language}}",
"keepDefault": "保持当前语言"
+ },
+ "softwareEncoderFallback": {
+ "title": "已切换到软件编码",
+ "description": "默认 GPU 编码器启动失败,OpenScreen 已改用软件 H.264 编码。录制会正常继续,但 CPU 占用可能更高。",
+ "dismiss": "知道了",
+ "dontShowAgain": "不再提示"
}
}
diff --git a/src/i18n/locales/zh-TW/launch.json b/src/i18n/locales/zh-TW/launch.json
index 6887546d9..f20f6b61c 100644
--- a/src/i18n/locales/zh-TW/launch.json
+++ b/src/i18n/locales/zh-TW/launch.json
@@ -57,5 +57,11 @@
"description": "偵測到系統語言為 {{language}}。要將 OpenScreen 切換為 {{language}} 嗎?",
"switch": "切換為 {{language}}",
"keepDefault": "保持目前語言"
+ },
+ "softwareEncoderFallback": {
+ "title": "已切換至軟體編碼",
+ "description": "預設 GPU 編碼器啟動失敗,OpenScreen 已改用軟體 H.264 編碼。錄製會照常繼續,但 CPU 使用率可能較高。",
+ "dismiss": "知道了",
+ "dontShowAgain": "不再顯示"
}
}
diff --git a/src/lib/nativeWindowsRecording.ts b/src/lib/nativeWindowsRecording.ts
index dd668b010..313eff9b5 100644
--- a/src/lib/nativeWindowsRecording.ts
+++ b/src/lib/nativeWindowsRecording.ts
@@ -45,6 +45,8 @@ export type NativeWindowsRecordingStartResult = {
path?: string;
helperPath?: string;
error?: string;
+ /** Helper-reported encoder selection: "default", "software-preferred", or "software-fallback". */
+ videoEncoderSelection?: string | null;
};
export function parseWindowHandleFromSourceId(sourceId?: string | null) {
diff --git a/src/lib/userPreferences.test.ts b/src/lib/userPreferences.test.ts
index ac3d901a9..ca66c53d5 100644
--- a/src/lib/userPreferences.test.ts
+++ b/src/lib/userPreferences.test.ts
@@ -118,4 +118,19 @@ describe("user preferences", () => {
expect(loadUserPreferences().preferSoftwareEncoder).toBe(false);
});
+
+ it("persists the software encoder fallback notice suppression", () => {
+ saveUserPreferences({ hideSoftwareEncoderFallbackNotice: true });
+
+ expect(loadUserPreferences().hideSoftwareEncoderFallbackNotice).toBe(true);
+ });
+
+ it("falls back to showing the software encoder fallback notice for invalid stored values", () => {
+ localStorage.setItem(
+ "openscreen_user_preferences",
+ JSON.stringify({ hideSoftwareEncoderFallbackNotice: "yes" }),
+ );
+
+ expect(loadUserPreferences().hideSoftwareEncoderFallbackNotice).toBe(false);
+ });
});
diff --git a/src/lib/userPreferences.ts b/src/lib/userPreferences.ts
index 09860bd3f..f166d5e5e 100644
--- a/src/lib/userPreferences.ts
+++ b/src/lib/userPreferences.ts
@@ -35,6 +35,8 @@ export interface UserPreferences {
trayLayout: "horizontal" | "vertical";
/** Force the Windows native recorder to use the software H.264 encoder */
preferSoftwareEncoder: boolean;
+ /** Stop showing the notice that recording fell back to software encoding */
+ hideSoftwareEncoderFallbackNotice: boolean;
}
export const DEFAULT_PREFS: UserPreferences = {
@@ -46,6 +48,7 @@ export const DEFAULT_PREFS: UserPreferences = {
projectFolder: null,
trayLayout: "horizontal",
preferSoftwareEncoder: false,
+ hideSoftwareEncoderFallbackNotice: false,
};
/** Parses stored preferences without throwing on malformed JSON. */
@@ -106,6 +109,10 @@ export function loadUserPreferences(): UserPreferences {
typeof raw.preferSoftwareEncoder === "boolean"
? raw.preferSoftwareEncoder
: DEFAULT_PREFS.preferSoftwareEncoder,
+ hideSoftwareEncoderFallbackNotice:
+ typeof raw.hideSoftwareEncoderFallbackNotice === "boolean"
+ ? raw.hideSoftwareEncoderFallbackNotice
+ : DEFAULT_PREFS.hideSoftwareEncoderFallbackNotice,
};
}