diff --git a/FileFlows.Plugin.dll b/FileFlows.Plugin.dll index f3efaf01..ef3f1968 100644 Binary files a/FileFlows.Plugin.dll and b/FileFlows.Plugin.dll differ diff --git a/FileFlows.Plugin.pdb b/FileFlows.Plugin.pdb index 341340c6..c5abbe14 100644 Binary files a/FileFlows.Plugin.pdb and b/FileFlows.Plugin.pdb differ diff --git a/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideoCodec.cs b/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideoCodec.cs index 26cffd66..81a3a8b3 100644 --- a/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideoCodec.cs +++ b/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideoCodec.cs @@ -15,6 +15,10 @@ [Boolean(3)] public bool Force { get; set; } + [Boolean(4)] + [DefaultValue(true)] + public bool DisableOtherVideoStreams { get; set; } + public override int Execute(NodeParameters args) { base.Init(args); @@ -28,15 +32,20 @@ parameters = CheckVideoCodec(ffmpegExe, parameters); bool encoding = false; - foreach (var stream in Model.VideoStreams) + foreach (var item in Model.VideoStreams.Select((x, index) => (stream: x, index))) { + if(DisableOtherVideoStreams && item.index > 0) + { + item.stream.Deleted = true; + continue; + } if(Force == false) { - if (IsSameVideoCodec(stream.Stream.Codec, this.VideoCodec)) + if (IsSameVideoCodec(item.stream.Stream.Codec, this.VideoCodec)) continue; } - stream.EncodingParameters.Clear(); - stream.EncodingParameters.AddRange(SplitCommand(parameters)); + item.stream.EncodingParameters.Clear(); + item.stream.EncodingParameters.AddRange(SplitCommand(parameters)); encoding = true; } return encoding ? 1 : 2; diff --git a/VideoNodes/VideoNodes.en.json b/VideoNodes/VideoNodes.en.json index 57c17f0e..577ca077 100644 --- a/VideoNodes/VideoNodes.en.json +++ b/VideoNodes/VideoNodes.en.json @@ -275,7 +275,9 @@ "VideoCodecParameters": "Video Codec Parameters", "VideoCodecParameters-Help": "The parameters to use to encode the video, eg. \"hevc_nvenc -preset hq -crf 23\" to encode into hevc using the HQ preset a constant rate factor of 23 and using NVIDIA hardware acceleration.", "Force": "Force Encode", - "Force-Help": "Will force a encode of the video even if it is already in the target Video Codec" + "Force-Help": "Will force a encode of the video even if it is already in the target Video Codec", + "DisableOtherVideoStreams": "Only First", + "DisableOtherVideoStreams-Help": "When checked if there are multiple video streams in the file, this will remove all but the first video stream from the file once executed." } }, "RemuxToMKV": { diff --git a/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll b/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll index 07202f7d..ca764d55 100644 Binary files a/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll and b/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll differ diff --git a/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb b/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb index 4f87f723..14977e03 100644 Binary files a/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb and b/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb differ