diff --git a/VideoNodes/LogicalNodes/DetectBlackBars.cs b/VideoNodes/LogicalNodes/DetectBlackBars.cs index 8ac26c80..99f207d6 100644 --- a/VideoNodes/LogicalNodes/DetectBlackBars.cs +++ b/VideoNodes/LogicalNodes/DetectBlackBars.cs @@ -55,7 +55,7 @@ namespace FileFlows.VideoNodes process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.CreateNoWindow = true; - process.StartInfo.Arguments = $" -ss {ss} -i \"{file}\" -hide_banner -vframes 25 -vf cropdetect=24:16:0 -f null -"; + process.StartInfo.Arguments = $" -ss {ss} -i \"{file}\" -hide_banner -vframes 25 -vf cropdetect -f null -"; args.Logger?.DLog("Executing ffmpeg " + process.StartInfo.Arguments); process.Start(); string output = process.StandardError.ReadToEnd(); diff --git a/VideoNodes/Tests/DetectBlackBarsTests.cs b/VideoNodes/Tests/DetectBlackBarsTests.cs new file mode 100644 index 00000000..e8377be7 --- /dev/null +++ b/VideoNodes/Tests/DetectBlackBarsTests.cs @@ -0,0 +1,42 @@ +#if(DEBUG) + +namespace VideoNodes.Tests +{ + using FileFlows.VideoNodes; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + + [TestClass] + public class DetectBlackBarsTests + { + [TestMethod] + public void DetectBlackBars_Test_01() + { + const string file = @"D:\videos\unprocessed\Fast Five (2011) Bluray-2160p.mkv"; + var vi = new VideoInfoHelper(@"C:\utils\ffmpeg\ffmpeg.exe", new TestLogger()); + var vii = vi.Read(file); + + DetectBlackBars node = new(); + //node.OutputFile = file + ".sup"; + var args = new FileFlows.Plugin.NodeParameters(file, new TestLogger(), false, string.Empty); + args.GetToolPath = (string tool) => @"C:\utils\ffmpeg\ffmpeg.exe"; + args.TempPath = @"D:\videos\temp"; + + new VideoFile().Execute(args); + + int output = node.Execute(args); + + string crop = args.Parameters[DetectBlackBars.CROP_KEY] as string; + Assert.IsFalse(string.IsNullOrWhiteSpace(crop)); + + Assert.AreEqual(1, output); + } + } +} + + +#endif \ No newline at end of file