fix(subsync): resolve ffmpeg only when a track needs extraction

Stream subtitles arrive as URLs and are downloaded, never piped through ffmpeg, so demanding an ffmpeg install up front broke stream syncs (and CI, which has no ffmpeg). Resolution is now lazy, scoped to embedded tracks.
This commit is contained in:
2026-08-01 17:35:59 -07:00
parent ebab843ce5
commit 1eb7f73b3b
8 changed files with 134 additions and 59 deletions
+2 -4
View File
@@ -293,9 +293,8 @@ async function subsyncToReference(
slot: SubtitleSlot,
httpHeaders: ResolvedMpvHttpHeaders | null,
): Promise<SubsyncResult> {
const ffmpegPath = resolveSubsyncExecutable(resolved.ffmpegPath, 'ffmpeg');
const targetExtraction = await extractSubtitleTrackToFile({
ffmpegPath,
resolveFfmpegPath: () => resolveSubsyncExecutable(resolved.ffmpegPath, 'ffmpeg'),
videoPath: context.videoPath,
track: targetTrack,
httpHeaders,
@@ -444,11 +443,10 @@ export async function runSubsyncManual(
return { ok: false, message: 'Reference and out-of-sync subtitles must be different tracks' };
}
const ffmpegPath = resolveSubsyncExecutable(resolved.ffmpegPath, 'ffmpeg');
let referenceExtraction: FileExtractionResult | null = null;
try {
referenceExtraction = await extractSubtitleTrackToFile({
ffmpegPath,
resolveFfmpegPath: () => resolveSubsyncExecutable(resolved.ffmpegPath, 'ffmpeg'),
videoPath: context.videoPath,
track: referenceTrack,
httpHeaders,