Skip to content

Commit 2798fe4

Browse files
committed
server: document insane synology bug.
1 parent 55a76a8 commit 2798fe4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/src/plugin/ffmpeg-path.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ export async function getScryptedFFmpegPath(): Promise<string> {
1313
return f;
1414
}
1515

16+
// strange behavior on synology and possibly unraid
17+
// where environment variables are not necessarily kept
18+
// in their container manager thing.
19+
// so even if the Dockerfile sets SCRYPTED_FFMPEG_PATH,
20+
// it is not gauranteed to be present in the environment.
21+
// this causes issues with @scrypted/ffmpeg-static,
22+
// which looks at that environment variable at build time
23+
// to determine whether to install ffmpeg.
24+
1625
// try to get the ffmpeg path from a variable
1726
// ie:
1827
// export SCRYPTED_FFMPEG_PATH=/usr/local/bin/ffmpeg
@@ -21,5 +30,8 @@ export async function getScryptedFFmpegPath(): Promise<string> {
2130
return f;
2231

2332
const defaultPath = os.platform() === 'win32' ? 'ffmpeg.exe' : 'ffmpeg';
24-
return getFfmpegPath() || defaultPath;
33+
const scryptedFfmpegStatic = getFfmpegPath();
34+
if (scryptedFfmpegStatic && fs.existsSync(scryptedFfmpegStatic))
35+
return scryptedFfmpegStatic;
36+
return defaultPath;
2537
}

0 commit comments

Comments
 (0)