mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-07 19:21:32 -07:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user