diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2022-12-07 18:28:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 18:28:41 +0100 |
| commit | 7195223dd8cc6dd8487678504c98502a00cbe2ee (patch) | |
| tree | 6a47df0f26ccf375ed5641defa0de07fa06c33c4 /MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | |
| parent | 16fdb127ab9c97ec9366b9e740ea4ab929f97f0f (diff) | |
| parent | ec6b7efe23a98be73bb33774e361f9772fac4cc9 (diff) | |
Merge pull request #8866 from Bond-009/mediaencoder
Always log when starting ffprobe
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index ffaf5246d..91bf42b15 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -415,8 +415,6 @@ namespace MediaBrowser.MediaEncoding.Encoder analyzeDuration = "-analyzeduration " + ffmpegAnalyzeDuration; } - var forceEnableLogging = request.MediaSource.Protocol != MediaProtocol.File; - return GetMediaInfoInternal( GetInputArgument(inputFile, request.MediaSource), request.MediaSource.Path, @@ -425,7 +423,6 @@ namespace MediaBrowser.MediaEncoding.Encoder analyzeDuration, request.MediaType == DlnaProfileType.Audio, request.MediaSource.VideoType, - forceEnableLogging, cancellationToken); } @@ -473,7 +470,6 @@ namespace MediaBrowser.MediaEncoding.Encoder string probeSizeArgument, bool isAudio, VideoType? videoType, - bool forceEnableLogging, CancellationToken cancellationToken) { var args = extractChapters @@ -488,7 +484,7 @@ namespace MediaBrowser.MediaEncoding.Encoder CreateNoWindow = true, UseShellExecute = false, - // Must consume both or ffmpeg may hang due to deadlocks. See comments below. + // Must consume both or ffmpeg may hang due to deadlocks. RedirectStandardOutput = true, FileName = _ffprobePath, @@ -500,21 +496,13 @@ namespace MediaBrowser.MediaEncoding.Encoder EnableRaisingEvents = true }; - if (forceEnableLogging) - { - _logger.LogInformation("{ProcessFileName} {ProcessArgs}", process.StartInfo.FileName, process.StartInfo.Arguments); - } - else - { - _logger.LogDebug("{ProcessFileName} {ProcessArgs}", process.StartInfo.FileName, process.StartInfo.Arguments); - } + _logger.LogInformation("Starting {ProcessFileName} with args {ProcessArgs}", _ffprobePath, args); using (var processWrapper = new ProcessWrapper(process, this)) { await using var memoryStream = new MemoryStream(); - _logger.LogDebug("Starting ffprobe with args {Args}", args); StartProcess(processWrapper); - await process.StandardOutput.BaseStream.CopyToAsync(memoryStream, cancellationToken: cancellationToken); + await process.StandardOutput.BaseStream.CopyToAsync(memoryStream, cancellationToken); memoryStream.Seek(0, SeekOrigin.Begin); InternalMediaInfoResult result; try @@ -522,7 +510,7 @@ namespace MediaBrowser.MediaEncoding.Encoder result = await JsonSerializer.DeserializeAsync<InternalMediaInfoResult>( memoryStream, _jsonSerializerOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); + cancellationToken).ConfigureAwait(false); } catch { |
