Beispiel #1
0
        void MainWindow_OnDrop(object sender, DragEventArgs e)
        {
            var files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
            var queue = new Queue <EncodeSettings>();

            foreach (var file in files)
            {
                if (ExtensionChecker.IsUnsupportedExtension(file))
                {
                    continue;
                }

                var settings = new EncodeSettings
                {
                    input          = file,
                    videoCodec     = VideoCodec.Text,
                    videoBitrate   = VideoBitrate.Text,
                    framerate      = Framerate.Text,
                    videoSize      = (string.IsNullOrEmpty(VideoWidth.Text) || string.IsNullOrEmpty(VideoHeight.Text)) ? "" : $"{VideoWidth.Text}x{VideoHeight.Text}",
                    yuv420p        = YUV420P.IsChecked == true,
                    simultaneously = Simultaneously.IsChecked == true,
                    audioCodec     = AudioCodec.Text,
                    audioBitrate   = AudioBitrate.Text,
                    startSec       = StartSec.Text,
                    duration       = Duration.Text,
                    concatenate    = Concatenate.IsChecked == true,
                    output         = file
                };
                queue.Enqueue(settings);
            }

            MovieEncoder.AddQueue(queue, Concatenate.IsChecked == true);
        }
Beispiel #2
0
        void MainWindow_OnOptionChanged(object sender, EventArgs eventArgs)
        {
            var settings = new EncodeSettings
            {
                input          = "input.mp4",
                videoCodec     = VideoCodec.Text,
                videoBitrate   = VideoBitrate.Text,
                framerate      = Framerate.Text,
                videoSize      = (string.IsNullOrEmpty(VideoWidth.Text) || string.IsNullOrEmpty(VideoHeight.Text)) ? "" : $"{VideoWidth.Text}x{VideoHeight.Text}",
                yuv420p        = YUV420P.IsChecked == true,
                simultaneously = Simultaneously.IsChecked == true,
                audioCodec     = AudioCodec.Text,
                audioBitrate   = AudioBitrate.Text,
                startSec       = StartSec.Text,
                duration       = Duration.Text,
                concatenate    = Concatenate.IsChecked == true,
                output         = "output.mp4"
            };

            var arguments = MovieEncoder.CreateArguments(settings);

            CommandPreview.Text = "ffmpeg " + arguments;
        }
Beispiel #3
0
 void OnExit(object sender, ExitEventArgs e)
 {
     MovieEncoder.RemoveConcatFile();
     Application.Current.Exit -= OnExit;
 }