aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornull <9310d27e@gmail.com>2023-08-20 21:18:55 +0400
committernull <9310d27e@gmail.com>2023-08-20 21:31:14 +0400
commit8dc58e8f04ca891aa8e515c369f14ecbb21d2191 (patch)
treec3016de3ecd52f1c1f89d74d4367d1eae14a7d1b
parent4c7fb8f45268c0123d0488dab23dff00c9578257 (diff)
Added handling of FFmpeg:probesize variable
-rw-r--r--CONTRIBUTORS.md1
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs17
2 files changed, 17 insertions, 1 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index b7e777817..e3af12a49 100644
--- a/CONTRIBUTORS.md
+++ b/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)
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index d61430b0b..f8d2dd40f 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/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))