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 37ecdf83..4c123bf0 100644 Binary files a/VideoNodes/VideoNodes.csproj and b/VideoNodes/VideoNodes.csproj differ