瀏覽代碼

Added handling of FFmpeg:probesize variable

null 1 年之前
父節點
當前提交
8dc58e8f04
共有 2 個文件被更改,包括 17 次插入1 次删除
  1. 1 0
      CONTRIBUTORS.md
  2. 16 1
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 1 - 0
CONTRIBUTORS.md

@@ -238,3 +238,4 @@
  - [Jakob Kukla](https://github.com/jakobkukla)
  - [Utku Özdemir](https://github.com/utkuozdemir)
  - [JPUC1143](https://github.com/Jpuc1143/)
+ - [0x25CBFC4F](https://github.com/0x25CBFC4F)

+ 16 - 1
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -5678,7 +5678,6 @@ namespace MediaBrowser.Controller.MediaEncoding
 
             // Apply -analyzeduration as per the environment variable,
             // otherwise ffmpeg will break on certain files due to default value is 0.
-            // The default value of -probesize is more than enough, so leave it as is.
             var ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
 
             if (state.MediaSource.AnalyzeDurationMs > 0)
@@ -5697,6 +5696,22 @@ namespace MediaBrowser.Controller.MediaEncoding
 
             inputModifier = inputModifier.Trim();
 
+            // Apply -probesize if configured
+            var probeSizeArgument = string.Empty;
+            var ffmpegProbeSize = _config.GetFFmpegProbeSize();
+
+            if (!string.IsNullOrEmpty(ffmpegProbeSize))
+            {
+                probeSizeArgument = $"-probesize {probeSizeArgument}";
+            }
+
+            if (!string.IsNullOrEmpty(probeSizeArgument))
+            {
+                inputModifier += $" {probeSizeArgument}";
+            }
+
+            inputModifier = inputModifier.Trim();
+
             var userAgentParam = GetUserAgentParam(state);
 
             if (!string.IsNullOrEmpty(userAgentParam))