From be4170a488633e73da3afc384541a38504d6d515 Mon Sep 17 00:00:00 2001 From: N00MKRAD Date: Wed, 3 Mar 2021 22:30:00 +0100 Subject: [PATCH] Skip muxing if original input video no longer exists at expected path --- Code/Media/FfmpegAudioAndMetadata.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Code/Media/FfmpegAudioAndMetadata.cs b/Code/Media/FfmpegAudioAndMetadata.cs index f686198..6d572d7 100644 --- a/Code/Media/FfmpegAudioAndMetadata.cs +++ b/Code/Media/FfmpegAudioAndMetadata.cs @@ -173,6 +173,12 @@ namespace Flowframes.Media public static async Task MergeStreamsFromInput (string inputVideo, string interpVideo, string tempFolder) { + if (!File.Exists(inputVideo)) + { + Logger.Log("Warning: Input video file not found, can't copy audio/subtitle streams to output video!"); + return; + } + string containerExt = Path.GetExtension(interpVideo); string tempPath = Path.Combine(tempFolder, $"vid{containerExt}"); string outPath = Path.Combine(tempFolder, $"muxed{containerExt}"); @@ -191,8 +197,6 @@ namespace Flowframes.Media if (!Config.GetBool("keepSubs")) subArgs = "-sn"; - // TODO: Check if movflags faststart is needed here! - if (QuickSettingsTab.trimEnabled) { string otherStreamsName = $"otherStreams{containerExt}";