public CutVideoFramePlugin()
        {
            _FFmpegFilePath = new PluginPropertyFilePath("FFmpegFilePath", this, "ffmpeg.exe");

            _VideoPosition = new PluginPropertyString("Position", this, "", true);

            _Width = new PluginPropertyValueType<uint>("Width", this, 0);
            _Height = new PluginPropertyValueType<uint>("Height", this, 0);

            _ShouldKeepAspectRatio = new PluginPropertyValueType<bool>("ShouldKeepAspectRatio", this, true);
        }
        protected static void RenameExistingFile(PluginPropertyFilePath filePath, PluginPropertyFilePath temporaryFilePath)
        {
            filePath.ValidateFileExist();

            if (temporaryFilePath.IsSet)
            {
                temporaryFilePath.ValidateFileDoesNotExist();
            }
            else
            {
                temporaryFilePath.Value = Path.Combine(filePath.DirectoryPath, filePath.FileNameWithoutExtension + "_tmp" + filePath.FileExtension);

                while (!temporaryFilePath.IsSet || temporaryFilePath.DoesFileExist)
                    temporaryFilePath.Value = Path.Combine(filePath.DirectoryPath, Path.Combine(filePath.DirectoryPath, filePath.FileNameWithoutExtension + "_tmp_" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + filePath.FileExtension));
            }

            File.Move(filePath.FilePath, temporaryFilePath.FilePath);
        }
        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();
        }
Beispiel #4
0
 public FileDeletePlugin()
 {
     _FilePath = new PluginPropertyFilePath("FilePath", this);
 }
Beispiel #5
0
 public S3CopyPlugin()
 {
     _DestinationFilePath = new PluginPropertyFilePath("DestinationFilePath", this);
     _SourceFilePath      = new PluginPropertyFilePath("SourceFilePath", this);
 }
 protected APluginExtendedFileOperation()
 {
     _SourceFilePath = new PluginPropertyFilePath("SourceFilePath", this);
     _DestinationFilePath = new PluginPropertyFilePath("DestinationFilePath", this);
     _ShouldOwerwriteExistingFile = new PluginProperty<bool>("ShouldOwerwriteExistingFile", this, false);
 }
        protected void RenameExistingFileIfExist(PluginPropertyFilePath filePath)
        {
            if(!filePath.DoesFileExist)
                return;

            RenameExistingFile(filePath);
        }
 protected void RenameExistingFile(PluginPropertyFilePath filePath)
 {
     RenameExistingFile(filePath, _TemporaryFilePath);
 }
 protected APluginExtendedTemporaryFile()
 {
     _TemporaryFilePath = new PluginPropertyFilePath("TemporaryFilePath", this);
 }
        protected void RestoreTemporaryFileIfExist(PluginPropertyFilePath filePath)
        {
            if (!_TemporaryFilePath.DoesFileExist)
                return;

            RestoreTemporaryFile(filePath);
        }
        protected void RestoreTemporaryFile(PluginPropertyFilePath filePath)
        {
            filePath.ValidateFileDoesNotExist();
            _TemporaryFilePath.ValidateFileExist();

            File.Move(_TemporaryFilePath.FilePath, filePath.FilePath);
        }
Beispiel #12
0
 public MP4BoxPlugin()
 {
     _MP4BoxPath = new PluginPropertyFilePath( "MP4BoxPath", this );
 }