public TranscodeTwoPassh264Plugin() { _FFmpegFilePath = new PluginPropertyFilePath("FFmpegFilePath", this); _TemporaryDirectoryPath = new PluginPropertyDirectoryPath("TemporaryDirectoryPath", this); _AudioBitrate = new PluginPropertyValueType<uint>("AudioBitrate", this); _ShouldDeinterlaceVideo = new PluginPropertyValueType<bool>("ShouldDeinterlaceVideo", this, false); _ShouldKeepVideoAspectRatio = new PluginPropertyValueType<bool>("ShouldKeepVideoAspectRatio", this, true); _VideoWidth = new PluginPropertyValueType<uint>("VideoWidth", this); _VideoHeight = new PluginPropertyValueType<uint>("VideoHeight", this); _VideoBitrate = new PluginPropertyValueType<uint>("VideoBitrate", this); _AudioBitrate.AddIsInRangeTest(value => value > 0); _VideoWidth.AddIsInRangeTest(value => value >= 0); _VideoHeight.AddIsInRangeTest(value => value >= 0); _VideoBitrate.AddIsInRangeTest(value => value > 0); _FFmpegOutput = new StringBuilder(); }
protected void CreateUniqueFolderFromDestinationName(PluginPropertyDirectoryPath directoryPath) { directoryPath.ValidateDirectoryDoesNotExist(); if (!directoryPath.IsSet) { directoryPath.Value = Path.Combine(Path.GetDirectoryName(DestinationFilePath), _DestinationFilePath.FileNameWithoutExtension + "_TempFolder"); while (directoryPath.DoesDirectoryExist) directoryPath.Value = Path.Combine(Path.GetDirectoryName(DestinationFilePath), _DestinationFilePath.FileNameWithoutExtension + "_TempFolder" + Path.GetRandomFileName()); } Directory.CreateDirectory(directoryPath.DirectoryPath); }