From c68e6df3d4765da556c7c2255dbcef9a07bda5a6 Mon Sep 17 00:00:00 2001 From: reven Date: Thu, 13 Jan 2022 18:09:47 +1300 Subject: [PATCH] improving logging for video nodes --- VideoNodes/FFMpegEncoder.cs | 2 ++ VideoNodes/VideoInfoHelper.cs | 8 ++++++-- VideoNodes/VideoNodes.csproj | Bin 3922 -> 3922 bytes 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/VideoNodes/FFMpegEncoder.cs b/VideoNodes/FFMpegEncoder.cs index 32dfe02c..5c9100b8 100644 --- a/VideoNodes/FFMpegEncoder.cs +++ b/VideoNodes/FFMpegEncoder.cs @@ -158,6 +158,8 @@ namespace FileFlows.VideoNodes } else { + if (e.Data.Contains("Skipping NAL unit")) + return; // just slighlty ignore these if (rgxTime.IsMatch(e.Data)) { var timeString = rgxTime.Match(e.Data).Value; diff --git a/VideoNodes/VideoInfoHelper.cs b/VideoNodes/VideoInfoHelper.cs index 7a88bf5d..2f6a9f84 100644 --- a/VideoNodes/VideoInfoHelper.cs +++ b/VideoNodes/VideoInfoHelper.cs @@ -142,10 +142,14 @@ namespace FileFlows.VideoNodes if (rgxBps.IsMatch(info) && float.TryParse(rgxBps.Match(info).Value, out float bps)) vs.Bitrate = bps; - if (rgxDuration.IsMatch(info) && TimeSpan.TryParse(rgxDuration.Match(info).Value, out TimeSpan duration)) + if (rgxDuration.IsMatch(info) && TimeSpan.TryParse(rgxDuration.Match(info).Value, out TimeSpan duration) && duration.TotalSeconds > 0) vs.Duration = duration; - else if (rgxDuration2.IsMatch(fullOutput) && TimeSpan.TryParse(rgxDuration2.Match(fullOutput).Value, out TimeSpan duration2)) + else if (rgxDuration2.IsMatch(fullOutput) && TimeSpan.TryParse(rgxDuration2.Match(fullOutput).Value, out TimeSpan duration2) && duration2.TotalSeconds > 0) vs.Duration = duration2; + else + { + Logger?.ILog("Failed to read duration for VideoStream: " + info); + } return vs; } diff --git a/VideoNodes/VideoNodes.csproj b/VideoNodes/VideoNodes.csproj index 37ecdf8372f664913ff3c9875460aab310993bb4..4c123bf01c82453e29f23e12201e77fe69c87f7e 100644 GIT binary patch delta 24 dcmca4cS&x;Jtk&L2J^`enL