Merge pull request #7443 from whiteowl3/strm-probe

This commit is contained in:
Cody Robibero
2022-03-25 13:33:10 -06:00
committed by GitHub
2 changed files with 19 additions and 14 deletions

View File

@@ -461,14 +461,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
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);
memoryStream.Seek(0, SeekOrigin.Begin);
InternalMediaInfoResult result;
try
{
result = await JsonSerializer.DeserializeAsync<InternalMediaInfoResult>(
process.StandardOutput.BaseStream,
memoryStream,
_jsonSerializerOptions,
cancellationToken: cancellationToken).ConfigureAwait(false);
}