diff --git a/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs b/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs index 5961ed3..e9369a5 100644 --- a/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs +++ b/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs @@ -130,7 +130,14 @@ private Instance PrepareInstance(out CancellationTokenSource cancellationTokenSo { FFMpegHelper.RootExceptionCheck(); FFMpegHelper.VerifyFFMpegExists(); - var instance = new Instance(FFMpegOptions.Options.FFmpegBinary(), _ffMpegArguments.Text); + var startInfo = new ProcessStartInfo + { + FileName = FFMpegOptions.Options.FFmpegBinary(), + Arguments = _ffMpegArguments.Text, + StandardOutputEncoding = FFMpegOptions.Options.Encoding, + StandardErrorEncoding = FFMpegOptions.Options.Encoding, + }; + var instance = new Instance(startInfo); cancellationTokenSource = new CancellationTokenSource(); if (_onTimeProgress != null || (_onPercentageProgress != null && _totalTimespan != null)) diff --git a/FFMpegCore/FFMpeg/FFMpegOptions.cs b/FFMpegCore/FFMpeg/FFMpegOptions.cs index 947f942..5bdb3a9 100644 --- a/FFMpegCore/FFMpeg/FFMpegOptions.cs +++ b/FFMpegCore/FFMpeg/FFMpegOptions.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; +using System.Text; using System.Text.Json; namespace FFMpegCore @@ -48,6 +49,7 @@ static FFMpegOptions() public Dictionary ExtensionOverrides { get; private set; } = new Dictionary(); public bool UseCache { get; set; } = true; + public Encoding Encoding { get; set; } = Encoding.Default; private static string FFBinary(string name) {