Merge pull request #223 from CepheiSigma/hotfix

support specific StandardOutputEncoding & StandardErrorEncoding for ffprobe
This commit is contained in:
Malte Rosenbjerg 2021-07-10 17:28:37 +02:00 committed by GitHub
commit d3193827ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using System.Threading.Tasks;
@ -117,7 +118,13 @@ private static Instance PrepareInstance(string filePath, int outputCapacity, FFO
FFProbeHelper.RootExceptionCheck();
FFProbeHelper.VerifyFFProbeExists(ffOptions);
var arguments = $"-loglevel error -print_format json -show_format -sexagesimal -show_streams \"{filePath}\"";
var instance = new Instance(GlobalFFOptions.GetFFProbeBinaryPath(), arguments) {DataBufferCapacity = outputCapacity};
var startInfo = new ProcessStartInfo(GlobalFFOptions.GetFFProbeBinaryPath(), arguments)
{
StandardOutputEncoding = ffOptions.Encoding,
StandardErrorEncoding = ffOptions.Encoding
};
var instance = new Instance(startInfo)
{ DataBufferCapacity = outputCapacity };
return instance;
}
}