mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-30 23:09:31 -06:00
added option to VideoCodec node to only include first video stream in output
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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;
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user