From 8eced835c0c03d955aaf7b357986a709aa1b3ffa Mon Sep 17 00:00:00 2001 From: Nyanmisaka Date: Sun, 2 Feb 2020 15:58:29 +0800 Subject: [PATCH 1/4] Update JobLogger.cs --- MediaBrowser.Controller/MediaEncoding/JobLogger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs index ac989f6ba..171aedb0e 100644 --- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs +++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs @@ -146,7 +146,7 @@ namespace MediaBrowser.Controller.MediaEncoding if (framerate.HasValue || percent.HasValue) { - state.ReportTranscodingProgress(transcodingPosition, 0, percent, 0, bitRate); + state.ReportTranscodingProgress(transcodingPosition, framerate, percent, bytesTranscoded, bitRate); } } } From 7472ae5ca92f7051b674ebe7a276895c8a028f73 Mon Sep 17 00:00:00 2001 From: Nyanmisaka Date: Sun, 2 Feb 2020 16:27:02 +0800 Subject: [PATCH 2/4] fix fps info issue when the video is h264. Fixed an issue that when the media source is in H264 format and the frame rate info is not displayed due to missing space characters in ffmpeg log. --- MediaBrowser.Controller/MediaEncoding/JobLogger.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs index 171aedb0e..a1ae31ac5 100644 --- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs +++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs @@ -90,6 +90,15 @@ namespace MediaBrowser.Controller.MediaEncoding framerate = val; } } + else if (part.Contains("fps=", StringComparison.OrdinalIgnoreCase)) + { + var rate = part.Split(new[] { '=' }, 2).Last(); + + if (float.TryParse(rate, NumberStyles.Any, _usCulture, out var val)) + { + framerate = val; + } + } else if (state.RunTimeTicks.HasValue && part.StartsWith("time=", StringComparison.OrdinalIgnoreCase)) { From 2c3b1bb8cb4ac788397929f52b824f547a6b2a18 Mon Sep 17 00:00:00 2001 From: Nyanmisaka Date: Sun, 2 Feb 2020 16:46:56 +0800 Subject: [PATCH 3/4] Update JobLogger.cs --- MediaBrowser.Controller/MediaEncoding/JobLogger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs index a1ae31ac5..b514ac699 100644 --- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs +++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs @@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.MediaEncoding framerate = val; } } - else if (part.Contains("fps=", StringComparison.OrdinalIgnoreCase)) + else if (part.StartsWith("fps=", StringComparison.OrdinalIgnoreCase)) { var rate = part.Split(new[] { '=' }, 2).Last(); From c149fcb3ee4a393653603419fc988670cb31778c Mon Sep 17 00:00:00 2001 From: Nyanmisaka Date: Mon, 3 Feb 2020 00:02:24 +0800 Subject: [PATCH 4/4] Update MediaBrowser.Controller/MediaEncoding/JobLogger.cs Co-Authored-By: Bond-009 --- MediaBrowser.Controller/MediaEncoding/JobLogger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs index b514ac699..38fb45810 100644 --- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs +++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs @@ -92,7 +92,7 @@ namespace MediaBrowser.Controller.MediaEncoding } else if (part.StartsWith("fps=", StringComparison.OrdinalIgnoreCase)) { - var rate = part.Split(new[] { '=' }, 2).Last(); + var rate = part.Split(new[] { '=' }, 2)[^1]; if (float.TryParse(rate, NumberStyles.Any, _usCulture, out var val)) {