Browse Source

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.
Nyanmisaka 5 năm trước cách đây
mục cha
commit
7472ae5ca9
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      MediaBrowser.Controller/MediaEncoding/JobLogger.cs

+ 9 - 0
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))
                 {