コード例 #1
0
ファイル: VideoConverterForm.cs プロジェクト: ywscr/ShareX
        private bool StartEncoding()
        {
            bool result = false;

            if (File.Exists(FFmpegFilePath) && !string.IsNullOrEmpty(Options.InputFilePath) && File.Exists(Options.InputFilePath) &&
                !string.IsNullOrEmpty(Options.OutputFolderPath) && !string.IsNullOrEmpty(Options.OutputFileName))
            {
                using (ffmpeg = new FFmpegCLIManager(FFmpegFilePath))
                {
                    ffmpeg.ShowError              = true;
                    ffmpeg.TrackEncodeProgress    = true;
                    ffmpeg.EncodeProgressChanged += Manager_EncodeProgressChanged;

                    try
                    {
                        string outputFilePath = Options.OutputFilePath;
                        string args           = Options.Arguments;
                        result = ffmpeg.Run(args);

                        if (Options.AutoOpenFolder && result && !ffmpeg.StopRequested)
                        {
                            Helpers.OpenFolderWithFile(outputFilePath);
                        }
                    }
                    catch (Exception e)
                    {
                        e.ShowError();
                    }
                }
            }

            return(result);
        }
コード例 #2
0
ファイル: VideoThumbnailer.cs プロジェクト: McoreD/ShareX
 private void UpdateVideoInfo()
 {
     using (FFmpegCLIManager ffmpeg = new FFmpegCLIManager(FFmpegPath))
     {
         VideoInfo = ffmpeg.GetVideoInfo(MediaPath);
     }
 }
コード例 #3
0
        private bool StartEncoding()
        {
            bool result = false;

            if (File.Exists(FFmpegFilePath) && !string.IsNullOrEmpty(Options.InputFilePath) && File.Exists(Options.InputFilePath) &&
                !string.IsNullOrEmpty(Options.OutputFolderPath) && !string.IsNullOrEmpty(Options.OutputFileName))
            {
                using (FFmpegCLIManager ffmpeg = new FFmpegCLIManager(FFmpegFilePath))
                {
                    ffmpeg.ShowError              = true;
                    ffmpeg.TrackEncodeProgress    = true;
                    ffmpeg.EncodeProgressChanged += Manager_EncodeProgressChanged;

                    string outputFilePath = Options.OutputFilePath;
                    string args           = Options.GetFFmpegArgs();
                    result = ffmpeg.Run(args);

                    if (result)
                    {
                        Helpers.OpenFolderWithFile(outputFilePath);
                    }
                }
            }

            return(result);
        }
コード例 #4
0
ファイル: VideoThumbnailer.cs プロジェクト: zz110/ShareX
        public VideoThumbnailer(string mediaPath, string ffmpegPath, VideoThumbnailOptions options)
        {
            MediaPath  = mediaPath;
            FFmpegPath = ffmpegPath;
            Options    = options;

            using (FFmpegCLIManager ffmpegCLI = new FFmpegCLIManager(FFmpegPath))
            {
                VideoInfo = ffmpegCLI.GetVideoInfo(MediaPath);
            }
        }
コード例 #5
0
ファイル: VideoThumbnailer.cs プロジェクト: yunfeifei/ShareX
        public VideoThumbnailer(string mediaPath, string ffmpegPath, VideoThumbnailOptions options)
        {
            MediaPath = mediaPath;
            FFmpegPath = ffmpegPath;
            Options = options;

            using (FFmpegCLIManager ffmpegCLI = new FFmpegCLIManager(FFmpegPath))
            {
                VideoInfo = ffmpegCLI.GetVideoInfo(MediaPath);
            }
        }
コード例 #6
0
        private bool StartEncoding()
        {
            bool result = false;

            if (!string.IsNullOrEmpty(Options.InputFilePath) && File.Exists(Options.InputFilePath) && !string.IsNullOrEmpty(Options.OutputFolderPath) &&
                !string.IsNullOrEmpty(Options.OutputFileName))
            {
                using (FFmpegCLIManager manager = new FFmpegCLIManager(FFmpegFilePath))
                {
                    manager.ShowError = true;

                    string outputFilePath = Options.OutputFilePath;
                    string args           = Options.GetFFmpegArgs();
                    result = manager.Run(args);

                    if (result)
                    {
                        Helpers.OpenFolderWithFile(outputFilePath);
                    }
                }
            }

            return(result);
        }