Added handling of FFmpeg:probesize variable

This commit is contained in:
null 2023-08-20 21:18:55 +04:00
parent 4c7fb8f452
commit 8dc58e8f04
No known key found for this signature in database
GPG Key ID: 0500817FCFFFD226
2 changed files with 17 additions and 1 deletions

View File

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

View File

@ -5678,7 +5678,6 @@ namespace MediaBrowser.Controller.MediaEncoding
// Apply -analyzeduration as per the environment variable, // Apply -analyzeduration as per the environment variable,
// otherwise ffmpeg will break on certain files due to default value is 0. // 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; var ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
if (state.MediaSource.AnalyzeDurationMs > 0) if (state.MediaSource.AnalyzeDurationMs > 0)
@ -5697,6 +5696,22 @@ namespace MediaBrowser.Controller.MediaEncoding
inputModifier = inputModifier.Trim(); 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); var userAgentParam = GetUserAgentParam(state);
if (!string.IsNullOrEmpty(userAgentParam)) if (!string.IsNullOrEmpty(userAgentParam))