diff --git a/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideo10Bit.cs b/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideo10Bit.cs index f8b41190..6fab9467 100644 --- a/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideo10Bit.cs +++ b/VideoNodes/FfmpegBuilderNodes/Video/FfmpegBuilderVideo10Bit.cs @@ -1,22 +1,52 @@ -namespace FileFlows.VideoNodes.FfmpegBuilderNodes +namespace FileFlows.VideoNodes.FfmpegBuilderNodes; + +/// +/// Flow element to set the video as 10-bit +/// +public class FfmpegBuilderVideo10Bit : FfmpegBuilderNode { - public class FfmpegBuilderVideo10Bit : FfmpegBuilderNode + /// + /// Gets the number of outputs + /// + public override int Outputs => 1; + + /// + /// Gets the URL to the help page + /// + public override string HelpUrl => "https://fileflows.com/docs/plugins/video-nodes/ffmpeg-builder/video-10-bit"; + + /// + /// Gets that this is obsolete and should no longer be used + /// + public override bool Obsolete => true; + /// + /// Gets the obsolete message + /// + public override string ObsoleteMessage => "Specify 10-bit in the Video Encode or Video Codec flow element. This can flow element can cause failures with QSV."; + + /// + /// Executes the flow element + /// + /// the node parameters + /// the output to call next + public override int Execute(NodeParameters args) { - public override int Outputs => 1; + args?.Logger?.WLog("This flow element has been marked obsolete and should no longer be used."); + + var videoInfo = GetVideoInfo(args); + if (videoInfo == null || videoInfo.VideoStreams?.Any() != true) + return -1; - public override string HelpUrl => "https://fileflows.com/docs/plugins/video-nodes/ffmpeg-builder/video-10-bit"; - - public override int Execute(NodeParameters args) + var stream = Model?.VideoStreams?.Where(x => x.Deleted == false)?.FirstOrDefault(); + if (stream != null) { - 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.OptionalEncodingParameters.AddRange(new[] { "-pix_fmt:v:{index}", "p010le", "-profile:v:{index}", "main10" }); - - return 1; + args.Logger?.ILog( + "Adding optional encoding parameters: -pix_fmt:v:{index} p010le -profile:v:{index} main10"); + + stream.OptionalEncodingParameters.AddRange(new[] + { "-pix_fmt:v:{index}", "p010le", "-profile:v:{index}", "main10" }); } + + return 1; } }