try to fix crash on linux

pull/2304/head
Mikael Finstad 2025-01-21 14:05:17 +08:00
rodzic 8b43485579
commit 2501212755
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 25AB36E3E81CBC26
1 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -15,7 +15,13 @@ assert(screenshotOutPath);
const port = 8081;
const ps = execa(losslessCutExePath, ['--http-api', String(port)], { forceKillAfterDelay: 10000 });
const platform = os.platform();
const losslessCutArgs = [
...(platform === 'linux' ? ['--no-sandbox'] : []),
'--http-api', String(port),
];
const ps = execa(losslessCutExePath, losslessCutArgs, { forceKillAfterDelay: 10000 });
console.log('Started', losslessCutExePath);
@ -27,8 +33,6 @@ const client = ky.extend({ prefixUrl: `http://127.0.0.1:${port}` });
async function captureScreenshot(outPath: string) {
// https://trac.ffmpeg.org/wiki/Capture/Desktop#Windows
const platform = os.platform();
if (platform === 'darwin') {
const { stderr } = await execa('ffmpeg', ['-f', 'avfoundation', '-list_devices', 'true', '-i', '', '-hide_banner'], { reject: false, timeout: 30000 });
console.log(stderr);