diff --git a/FFMpegCore/FFMpegCore.csproj b/FFMpegCore/FFMpegCore.csproj index ed3b71c..7e279fb 100644 --- a/FFMpegCore/FFMpegCore.csproj +++ b/FFMpegCore/FFMpegCore.csproj @@ -18,7 +18,7 @@ - + diff --git a/FFMpegCore/FFOptions.cs b/FFMpegCore/FFOptions.cs index 3194874..2d4e4c9 100644 --- a/FFMpegCore/FFOptions.cs +++ b/FFMpegCore/FFOptions.cs @@ -1,4 +1,5 @@ using System.Text; +using System.Text.Json.Serialization; using FFMpegCore.Enums; namespace FFMpegCore @@ -20,10 +21,20 @@ public class FFOptions : ICloneable /// public string TemporaryFilesFolder { get; set; } = Path.GetTempPath(); + /// + /// Encoding web name used to persist encoding + /// + public string EncodingWebName { get; set; } = Encoding.Default.WebName; + /// /// Encoding used for parsing stdout/stderr on ffmpeg and ffprobe processes /// - public Encoding Encoding { get; set; } = Encoding.Default; + [JsonIgnore] + public Encoding Encoding + { + get => Encoding.GetEncoding(EncodingWebName); + set => EncodingWebName = value?.WebName ?? Encoding.Default.WebName; + } /// /// The log level to use when calling of the ffmpeg executable.