Exemple #1
0
        private void SettingsLoad()
        {
            // General
            RefreshSourcesAsync();
            cboVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegVideoCodec>());
            cboVideoCodec.SelectedIndex = (int)Options.FFmpeg.VideoCodec;
            cboAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegAudioCodec>());
            cboAudioCodec.SelectedIndex = (int)Options.FFmpeg.AudioCodec;
            cbShowError.Checked         = Options.FFmpeg.ShowError;

            string cli = "ffmpeg.exe";

            if (string.IsNullOrEmpty(Options.FFmpeg.CLIPath) && File.Exists(cli))
            {
                Options.FFmpeg.CLIPath = cli;
            }

            txtFFmpegPath.Text = Options.FFmpeg.CLIPath;

            tbUserArgs.Text = Options.FFmpeg.UserArgs;

            // x264
            nudx264CRF.Value = Options.FFmpeg.x264_CRF.Between((int)nudx264CRF.Minimum, (int)nudx264CRF.Maximum);
            cbPreset.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegPreset>());
            cbPreset.SelectedIndex = (int)Options.FFmpeg.Preset;

            // VPx
            nudVPxCRF.Value = Options.FFmpeg.VPx_CRF.Between((int)nudVPxCRF.Minimum, (int)nudVPxCRF.Maximum);

            // Xvid
            nudQscale.Value = Options.FFmpeg.XviD_qscale.Between((int)nudQscale.Minimum, (int)nudQscale.Maximum);

            // AAC
            tbAACBitrate.Value = Options.FFmpeg.AAC_bitrate / 32;

            // Vorbis
            tbVorbis_qscale.Value = Options.FFmpeg.Vorbis_qscale;

            // MP3
            tbMP3_qscale.Value = FFmpegHelper.libmp3lame_qscale_end - Options.FFmpeg.MP3_qscale; // 0-9 where a lower value is a higher quality

            cbCustomCommands.Checked = Options.FFmpeg.UseCustomCommands;

            txtCommandLinePreview.Text = Options.GetFFmpegCommands();
        }
Exemple #2
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            if (File.Exists(Options.FFmpeg.CLIPath))
            {
                try
                {
                    using (Process process = new Process())
                    {
                        ProcessStartInfo psi = new ProcessStartInfo("cmd.exe");
                        psi.Arguments        = "/k ffmpeg " + Options.GetFFmpegCommands();
                        psi.WorkingDirectory = Path.GetDirectoryName(Options.FFmpeg.CLIPath);

                        process.StartInfo = psi;
                        process.Start();
                    }
                }
                catch (Exception ex)
                {
                    DebugHelper.WriteException(ex);
                }
            }
        }