added Video 10bit node

This commit is contained in:
John Andrews
2022-04-19 10:24:26 +12:00
parent 94e47d43b5
commit 4c4a36f013
3 changed files with 44 additions and 2 deletions

View File

@@ -13,6 +13,20 @@
_Filter = value ?? new List<string>();
}
}
private List<string> _OptionalFilter = new List<string>();
/// <summary>
/// Gets or sets filters that will process but only if processing is needed, these won't trigger a has changed
/// value of the video file by themselves
/// </summary>
public List<string> OptionalFilter
{
get => _OptionalFilter;
set
{
_OptionalFilter = value ?? new List<string>();
}
}
private List<string> _EncodingParameters = new List<string>();
public List<string> EncodingParameters
@@ -50,10 +64,10 @@
//results.Add("copy");
}
if (Filter.Any())
if (Filter.Any() || OptionalFilter.Any())
{
results.Add("-filter:v:" + outputIndex);
results.Add(String.Join(", ", Filter));
results.Add(String.Join(", ", Filter.Concat(OptionalFilter)).Replace("{index}", outputIndex.ToString()));
}
}

View File

@@ -0,0 +1,21 @@
namespace FileFlows.VideoNodes.FfmpegBuilderNodes
{
public class FfmpegBuilderVideo10Bit : FfmpegBuilderNode
{
public override int Outputs => 1;
public override int Execute(NodeParameters args)
{
base.Init(args);
var videoInfo = GetVideoInfo(args);
if (videoInfo == null || videoInfo.VideoStreams?.Any() != true)
return -1;
var stream = Model?.VideoStreams?.Where(x => x.Deleted == false)?.FirstOrDefault();
if (stream != null)
stream.OptionalFilter.AddRange(new[] { "-pix_fmt:{index}", "yuv420p10le" });
return 1;
}
}
}

View File

@@ -362,6 +362,13 @@
"Resolution": "Resolution"
}
},
"FfmpegBuilderVideo10Bit": {
"Label": "FFMPEG Builder: Video 10 Bit",
"Description": "Sets FFMPEG Builder to encode the video streams in 10 Bit",
"Outputs": {
"1": "FFMPEG Builder video streams set to encode in 10 Bit"
}
},
"FfmpegBuilderVideoCodec": {
"Label": "FFMPEG Builder: Video Codec",
"Description": "Sets FFMPEG Builder to encode the video streams in the specified codec",