diff --git a/FFMpegCore/FFMPEG/FFBase.cs b/FFMpegCore/FFMPEG/FFBase.cs index cc52b39..d38c8ca 100644 --- a/FFMpegCore/FFMPEG/FFBase.cs +++ b/FFMpegCore/FFMPEG/FFBase.cs @@ -14,12 +14,27 @@ public abstract class FFBase : IDisposable protected string ConfiguredRoot; protected Process Process; - protected FFBase() + protected FFBase(FFMpegOptions opts = null) { - ConfiguredRoot = - !File.Exists(_ConfigFile) ? - _DefaultRoot : - JsonConvert.DeserializeObject>(File.ReadAllText(_ConfigFile))["RootDirectory"]; + var options = opts; + + if ( + opts == null && + File.Exists(_ConfigFile) + ) + { + options = JsonConvert.DeserializeObject(File.ReadAllText(_ConfigFile)); + } + + if (options == null) + { + options = new FFMpegOptions + { + RootDirectory = _DefaultRoot + }; + } + + ConfiguredRoot = options.RootDirectory; } /// diff --git a/FFMpegCore/FFMPEG/FFMpegOptions.cs b/FFMpegCore/FFMPEG/FFMpegOptions.cs new file mode 100644 index 0000000..5030e39 --- /dev/null +++ b/FFMpegCore/FFMPEG/FFMpegOptions.cs @@ -0,0 +1,7 @@ +namespace FFMpegCore.FFMPEG +{ + public class FFMpegOptions + { + public string RootDirectory { get; set; } + } +} diff --git a/FFMpegCore/FFMpegCore.csproj b/FFMpegCore/FFMpegCore.csproj index ac1c985..608fc81 100644 --- a/FFMpegCore/FFMpegCore.csproj +++ b/FFMpegCore/FFMpegCore.csproj @@ -7,9 +7,9 @@ https://github.com/vladjerca/FFMpegCore Vlad Jerca A great way to use FFMpeg encoding when writing video applications, client-side and server-side. It has wrapper methods that allow conversion to all web formats: MP4, OGV, TS and methods of capturing screens from the videos. - 1.0.2 - 1.0.2.0 - 1.0.2.0 + 1.0.3 + 1.0.3.0 + 1.0.3.0