Пример #1
0
        private void btnScreenRecorderOptions_Click(object sender, EventArgs e)
        {
            ScreencastOptions options = new ScreencastOptions
            {
                FFmpeg = TaskSettings.CaptureSettings.FFmpegOptions,
                AVI    = TaskSettings.CaptureSettings.AVIOptions,
                ShowAVIOptionsDialog = true,
                ScreenRecordFPS      = TaskSettings.CaptureSettings.ScreenRecordFPS,
                GIFFPS       = TaskSettings.CaptureSettings.GIFFPS,
                Duration     = TaskSettings.CaptureSettings.ScreenRecordFixedDuration ? TaskSettings.CaptureSettings.ScreenRecordDuration : 0,
                OutputPath   = "output.mp4",
                CaptureArea  = Screen.PrimaryScreen.Bounds,
                DrawCursor   = TaskSettings.CaptureSettings.ShowCursor,
                ParentWindow = this.Handle
            };

            switch (TaskSettings.CaptureSettings.ScreenRecordOutput)
            {
            case ScreenRecordOutput.AVI:

                try
                {
                    options.OutputPath = Program.ScreenRecorderCacheFilePath;

                    // Ugly workaround for show AVI compression dialog
                    using (AVICache aviCache = new AVICache(options))
                    {
                        TaskSettings.CaptureSettings.AVIOptions.CompressOptions = options.AVI.CompressOptions;
                    }
                }
                catch (Exception ex)
                {
                    TaskSettings.CaptureSettings.AVIOptions.CompressOptions = new AVICOMPRESSOPTIONS();
                    MessageBox.Show(ex.ToString(), "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                break;

            case ScreenRecordOutput.FFmpeg:
                using (FFmpegOptionsForm form = new FFmpegOptionsForm(options))
                {
                    form.DefaultToolsPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
                    form.ShowDialog();
                }
                break;
            }
        }
Пример #2
0
        private void btnScreenRecorderFFmpegOptions_Click(object sender, EventArgs e)
        {
            ScreencastOptions options = new ScreencastOptions
            {
                FFmpeg          = TaskSettings.CaptureSettings.FFmpegOptions,
                ScreenRecordFPS = TaskSettings.CaptureSettings.ScreenRecordFPS,
                GIFFPS          = TaskSettings.CaptureSettings.GIFFPS,
                Duration        = TaskSettings.CaptureSettings.ScreenRecordFixedDuration ? TaskSettings.CaptureSettings.ScreenRecordDuration : 0,
                OutputPath      = "output.mp4",
                CaptureArea     = Screen.PrimaryScreen.Bounds,
                DrawCursor      = TaskSettings.CaptureSettings.ShowCursor
            };

            using (FFmpegOptionsForm form = new FFmpegOptionsForm(options))
            {
                form.DefaultToolsPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
                form.ShowDialog();
            }
        }