diff --git a/ShareX.ScreenCaptureLib/Enums.cs b/ShareX.ScreenCaptureLib/Enums.cs index 220144385..39cfbfb9a 100644 --- a/ShareX.ScreenCaptureLib/Enums.cs +++ b/ShareX.ScreenCaptureLib/Enums.cs @@ -125,6 +125,34 @@ public enum FFmpegPreset veryslow } + public enum FFmpegNVENCPreset + { + [Description("Default")] + @default, + [Description("High quality 2 passes")] + slow, + [Description("High quality 1 pass")] + medium, + [Description("High performance 1 pass")] + fast, + [Description("High performance")] + hp, + [Description("High quality")] + hq, + [Description("Bluray disk")] + bd, + [Description("Low latency")] + ll, + [Description("Low latency high quality")] + llhq, + [Description("Low latency high performance")] + llhp, + [Description("Lossless")] + lossless, + [Description("Lossless high performance")] + losslesshp + } + public enum FFmpegTune { film, animation, grain, stillimage, psnr, ssim, fastdecode, zerolatency diff --git a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptions.cs b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptions.cs index b48623fca..b34909317 100644 --- a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptions.cs +++ b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptions.cs @@ -31,29 +31,31 @@ namespace ShareX.ScreenCaptureLib public class FFmpegOptions { // General - public bool OverrideCLIPath { get; set; } - public string CLIPath { get; set; } - public string VideoSource { get; set; } - public string AudioSource { get; set; } - public FFmpegVideoCodec VideoCodec { get; set; } - public FFmpegAudioCodec AudioCodec { get; set; } - public string UserArgs { get; set; } - public bool UseCustomCommands { get; set; } - public string CustomCommands { get; set; } - public bool ShowError { get; set; } + public bool OverrideCLIPath { get; set; } = false; + public string CLIPath { get; set; } = ""; + public string VideoSource { get; set; } = FFmpegHelper.SourceGDIGrab; + public string AudioSource { get; set; } = FFmpegHelper.SourceNone; + public FFmpegVideoCodec VideoCodec { get; set; } = FFmpegVideoCodec.libx264; + public FFmpegAudioCodec AudioCodec { get; set; } = FFmpegAudioCodec.libvoaacenc; + public string UserArgs { get; set; } = ""; + public bool UseCustomCommands { get; set; } = false; + public string CustomCommands { get; set; } = ""; + public bool ShowError { get; set; } = true; // Video - public FFmpegPreset x264_Preset { get; set; } - public int x264_CRF { get; set; } - public int VPx_bitrate { get; set; } // kbit/s - public int XviD_qscale { get; set; } - public FFmpegPaletteGenStatsMode GIFStatsMode { get; set; } - public FFmpegPaletteUseDither GIFDither { get; set; } + public FFmpegPreset x264_Preset { get; set; } = FFmpegPreset.ultrafast; + public int x264_CRF { get; set; } = 28; + public int VPx_bitrate { get; set; } = 3000; // kbit/s + public int XviD_qscale { get; set; } = 10; + public FFmpegNVENCPreset NVENC_preset { get; set; } = FFmpegNVENCPreset.@default; + public int NVENC_bitrate { get; set; } = 3000; // kbit/s + public FFmpegPaletteGenStatsMode GIFStatsMode { get; set; } = FFmpegPaletteGenStatsMode.full; + public FFmpegPaletteUseDither GIFDither { get; set; } = FFmpegPaletteUseDither.sierra2_4a; // Audio - public int AAC_bitrate { get; set; } // kbit/s - public int Vorbis_qscale { get; set; } - public int MP3_qscale { get; set; } + public int AAC_bitrate { get; set; } = 128; // kbit/s + public int Vorbis_qscale { get; set; } = 3; + public int MP3_qscale { get; set; } = 4; public string FFmpegPath { @@ -119,57 +121,18 @@ public string Extension } } - public bool IsSourceSelected - { - get - { - return IsVideoSourceSelected || IsAudioSourceSelected; - } - } + public bool IsSourceSelected => IsVideoSourceSelected || IsAudioSourceSelected; - public bool IsVideoSourceSelected - { - get - { - return !string.IsNullOrEmpty(VideoSource) && !VideoSource.Equals(FFmpegHelper.SourceNone, StringComparison.InvariantCultureIgnoreCase); - } - } + public bool IsVideoSourceSelected => !string.IsNullOrEmpty(VideoSource) && !VideoSource.Equals(FFmpegHelper.SourceNone, StringComparison.InvariantCultureIgnoreCase); - public bool IsAudioSourceSelected - { - get - { - return !string.IsNullOrEmpty(AudioSource) && !AudioSource.Equals(FFmpegHelper.SourceNone, StringComparison.InvariantCultureIgnoreCase) && - (!IsVideoSourceSelected || VideoCodec != FFmpegVideoCodec.gif); - } - } + public bool IsAudioSourceSelected => !string.IsNullOrEmpty(AudioSource) && !AudioSource.Equals(FFmpegHelper.SourceNone, StringComparison.InvariantCultureIgnoreCase) && + (!IsVideoSourceSelected || VideoCodec != FFmpegVideoCodec.gif); public FFmpegOptions() { - // General - OverrideCLIPath = false; - VideoSource = FFmpegHelper.SourceGDIGrab; - AudioSource = FFmpegHelper.SourceNone; - VideoCodec = FFmpegVideoCodec.libx264; - AudioCodec = FFmpegAudioCodec.libvoaacenc; - UserArgs = ""; - ShowError = true; - - // Video - x264_CRF = 28; - x264_Preset = FFmpegPreset.ultrafast; - VPx_bitrate = 3000; - XviD_qscale = 10; - GIFStatsMode = FFmpegPaletteGenStatsMode.full; - GIFDither = FFmpegPaletteUseDither.sierra2_4a; - - // Audio - AAC_bitrate = 128; - Vorbis_qscale = 3; - MP3_qscale = 4; } - public FFmpegOptions(string ffmpegPath) : this() + public FFmpegOptions(string ffmpegPath) { CLIPath = Helpers.GetVariableFolderPath(ffmpegPath); } diff --git a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs index 5eeb0a3c8..98ccddccf 100644 --- a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs +++ b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs @@ -90,6 +90,11 @@ private void InitializeComponent() this.gbCodecs = new System.Windows.Forms.GroupBox(); this.btnHelp = new System.Windows.Forms.Button(); this.eiFFmpeg = new ShareX.HelpersLib.ExportImportControl(); + this.tpNVENC = new System.Windows.Forms.TabPage(); + this.lblNVENCBitrate = new System.Windows.Forms.Label(); + this.nudNVENCBitrate = new System.Windows.Forms.NumericUpDown(); + this.lblNVENCPreset = new System.Windows.Forms.Label(); + this.cbNVENCPreset = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.nudx264CRF)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudXvidQscale)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbVorbis_qscale)).BeginInit(); @@ -112,6 +117,8 @@ private void InitializeComponent() this.tpMP3.SuspendLayout(); this.gbSource.SuspendLayout(); this.gbCodecs.SuspendLayout(); + this.tpNVENC.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudNVENCBitrate)).BeginInit(); this.SuspendLayout(); // // lblx264CRF @@ -357,6 +364,7 @@ private void InitializeComponent() this.tcFFmpegVideoCodecs.Controls.Add(this.tpX264); this.tcFFmpegVideoCodecs.Controls.Add(this.tpVpx); this.tcFFmpegVideoCodecs.Controls.Add(this.tpXvid); + this.tcFFmpegVideoCodecs.Controls.Add(this.tpNVENC); this.tcFFmpegVideoCodecs.Controls.Add(this.tpGIF); resources.ApplyResources(this.tcFFmpegVideoCodecs, "tcFFmpegVideoCodecs"); this.tcFFmpegVideoCodecs.Name = "tcFFmpegVideoCodecs"; @@ -615,6 +623,55 @@ private void InitializeComponent() this.eiFFmpeg.ExportRequested += new ShareX.HelpersLib.ExportImportControl.ExportEventHandler(this.eiFFmpeg_ExportRequested); this.eiFFmpeg.ImportRequested += new ShareX.HelpersLib.ExportImportControl.ImportEventHandler(this.eiFFmpeg_ImportRequested); // + // tpNVENC + // + this.tpNVENC.Controls.Add(this.cbNVENCPreset); + this.tpNVENC.Controls.Add(this.lblNVENCPreset); + this.tpNVENC.Controls.Add(this.nudNVENCBitrate); + this.tpNVENC.Controls.Add(this.lblNVENCBitrate); + resources.ApplyResources(this.tpNVENC, "tpNVENC"); + this.tpNVENC.Name = "tpNVENC"; + this.tpNVENC.UseVisualStyleBackColor = true; + // + // lblNVENCBitrate + // + resources.ApplyResources(this.lblNVENCBitrate, "lblNVENCBitrate"); + this.lblNVENCBitrate.Name = "lblNVENCBitrate"; + // + // nudNVENCBitrate + // + resources.ApplyResources(this.nudNVENCBitrate, "nudNVENCBitrate"); + this.nudNVENCBitrate.Maximum = new decimal(new int[] { + 50000, + 0, + 0, + 0}); + this.nudNVENCBitrate.Minimum = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.nudNVENCBitrate.Name = "nudNVENCBitrate"; + this.nudNVENCBitrate.Value = new decimal(new int[] { + 3000, + 0, + 0, + 0}); + this.nudNVENCBitrate.ValueChanged += new System.EventHandler(this.nudNVENCBitrate_ValueChanged); + // + // lblNVENCPreset + // + resources.ApplyResources(this.lblNVENCPreset, "lblNVENCPreset"); + this.lblNVENCPreset.Name = "lblNVENCPreset"; + // + // cbNVENCPreset + // + this.cbNVENCPreset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbNVENCPreset.FormattingEnabled = true; + resources.ApplyResources(this.cbNVENCPreset, "cbNVENCPreset"); + this.cbNVENCPreset.Name = "cbNVENCPreset"; + this.cbNVENCPreset.SelectedIndexChanged += new System.EventHandler(this.cbNVENCPreset_SelectedIndexChanged); + // // FFmpegOptionsForm // resources.ApplyResources(this, "$this"); @@ -669,6 +726,9 @@ private void InitializeComponent() this.gbSource.PerformLayout(); this.gbCodecs.ResumeLayout(false); this.gbCodecs.PerformLayout(); + this.tpNVENC.ResumeLayout(false); + this.tpNVENC.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudNVENCBitrate)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -736,5 +796,10 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbOverrideFFmpegPath; private System.Windows.Forms.PictureBox pbAudioCodecWarning; private System.Windows.Forms.PictureBox pbx264PresetWarning; + private System.Windows.Forms.TabPage tpNVENC; + private System.Windows.Forms.ComboBox cbNVENCPreset; + private System.Windows.Forms.Label lblNVENCPreset; + private System.Windows.Forms.NumericUpDown nudNVENCBitrate; + private System.Windows.Forms.Label lblNVENCBitrate; } } \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs index b8852fe3a..3927ff98e 100644 --- a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs +++ b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs @@ -30,6 +30,7 @@ using System.Diagnostics; using System.Drawing; using System.IO; +using System.Linq; using System.Windows.Forms; namespace ShareX.ScreenCaptureLib @@ -52,6 +53,7 @@ public FFmpegOptionsForm(ScreencastOptions options) cboAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions()); cbx264Preset.Items.AddRange(Helpers.GetEnumDescriptions()); cbGIFStatsMode.Items.AddRange(Helpers.GetEnumDescriptions()); + cbNVENCPreset.Items.AddRange(Helpers.GetEnums().Select(x => $"{x} ({x.GetDescription()})").ToArray()); cbGIFDither.Items.AddRange(Helpers.GetEnumDescriptions()); SettingsLoad(); @@ -90,6 +92,10 @@ private void SettingsLoad() // Xvid nudXvidQscale.SetValue(Options.FFmpeg.XviD_qscale); + // NVENC + nudNVENCBitrate.SetValue(Options.FFmpeg.NVENC_bitrate); + cbNVENCPreset.SelectedIndex = (int)Options.FFmpeg.NVENC_preset; + // GIF cbGIFStatsMode.SelectedIndex = (int)Options.FFmpeg.GIFStatsMode; cbGIFDither.SelectedIndex = (int)Options.FFmpeg.GIFDither; @@ -302,9 +308,13 @@ private void cboVideoCodec_SelectedIndexChanged(object sender, EventArgs e) case FFmpegVideoCodec.libxvid: tcFFmpegVideoCodecs.SelectedIndex = 2; break; - case FFmpegVideoCodec.gif: + case FFmpegVideoCodec.h264_nvenc: + case FFmpegVideoCodec.hevc_nvenc: tcFFmpegVideoCodecs.SelectedIndex = 3; break; + case FFmpegVideoCodec.gif: + tcFFmpegVideoCodecs.SelectedIndex = 4; + break; } } @@ -359,6 +369,18 @@ private void nudQscale_ValueChanged(object sender, EventArgs e) UpdateUI(); } + private void cbNVENCPreset_SelectedIndexChanged(object sender, EventArgs e) + { + Options.FFmpeg.NVENC_preset = (FFmpegNVENCPreset)cbNVENCPreset.SelectedIndex; + UpdateUI(); + } + + private void nudNVENCBitrate_ValueChanged(object sender, EventArgs e) + { + Options.FFmpeg.NVENC_bitrate = (int)nudNVENCBitrate.Value; + UpdateUI(); + } + private void cbGIFStatsMode_SelectedIndexChanged(object sender, EventArgs e) { Options.FFmpeg.GIFStatsMode = (FFmpegPaletteGenStatsMode)cbGIFStatsMode.SelectedIndex; diff --git a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx index 26534eacc..7f083ef1f 100644 --- a/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx +++ b/ShareX.ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx @@ -146,6 +146,9 @@ 2 + + 17, 17 + 144, 12 @@ -159,9 +162,6 @@ Center - - 17, 17 - Constant Rate Factor (CRF): The value can be between 0-51, where 0 is lossless, 30 is default, and 51 is the worst possible. A higher value means bad quality, but a low file size. @@ -178,6 +178,9 @@ A higher value means bad quality, but a low file size. 1 + + 17, 17 + 144, 12 @@ -526,6 +529,66 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 1 + + btnDownload + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFFmpegExe + + + 0 + + + btnFFmpegBrowse + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFFmpegExe + + + 1 + + + txtFFmpegPath + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbFFmpegExe + + + 2 + + + 8, 8 + + + 648, 56 + + + 0 + + + FFmpeg path + + + gbFFmpegExe + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + 552, 22 @@ -595,30 +658,6 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 2 - - 8, 8 - - - 648, 56 - - - 0 - - - FFmpeg path - - - gbFFmpegExe - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 8 - True @@ -646,6 +685,57 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 0 + + cbCustomCommands + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbCommandLinePreview + + + 0 + + + txtCommandLinePreview + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbCommandLinePreview + + + 1 + + + 8, 409 + + + 8, 8, 8, 8 + + + 648, 96 + + + 6 + + + Command line preview + + + gbCommandLinePreview + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + True @@ -706,32 +796,53 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 1 - - 8, 409 + + btnFFmpegHelp - - 8, 8, 8, 8 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 648, 96 + + gbCommandLineArgs - - 6 + + 0 - - Command line preview + + tbUserArgs - - gbCommandLinePreview + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + gbCommandLineArgs + + + 1 + + + 8, 340 + + + 648, 56 + + + 5 + + + Additional command line arguments + + + gbCommandLineArgs + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 7 + + 9 Top, Right @@ -784,30 +895,6 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 1 - - 8, 340 - - - 648, 56 - - - 5 - - - Additional command line arguments - - - gbCommandLineArgs - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 9 - 4, 22 @@ -835,6 +922,288 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 0 + + lblVP8BitrateK + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpVpx + + + 0 + + + nudVP8Bitrate + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpVpx + + + 1 + + + lblVP8Bitrate + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpVpx + + + 2 + + + 4, 22 + + + 304, 70 + + + 2 + + + VP8 + @Invariant + + tpVpx + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcFFmpegVideoCodecs + + + 1 + + + 4, 22 + + + 304, 70 + + + 3 + + + Xvid + @Invariant + + tpXvid + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcFFmpegVideoCodecs + + + 2 + + + 96, 12 + + + 192, 21 + + + 3 + + + cbNVENCPreset + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpNVENC + + + 0 + + + True + + + 16, 16 + + + 40, 13 + + + 2 + + + Preset: + + + lblNVENCPreset + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpNVENC + + + 1 + + + 96, 36 + + + 88, 20 + + + 1 + + + Center + + + nudNVENCBitrate + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpNVENC + + + 2 + + + True + + + 16, 40 + + + 40, 13 + + + 0 + + + Bitrate: + + + lblNVENCBitrate + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpNVENC + + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 304, 70 + + + 5 + + + NVENC + + + tpNVENC + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcFFmpegVideoCodecs + + + 3 + + + lblGIFDither + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGIF + + + 1 + + + lblGIFStatsMode + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGIF + + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 304, 70 + + + 4 + + + GIF + @Invariant + + tpGIF + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcFFmpegVideoCodecs + + + 4 + + + 8, 56 + + + 312, 96 + + + 3 + + + tcFFmpegVideoCodecs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbCodecs + + + 6 + True @@ -916,54 +1285,6 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 2 - - 4, 22 - - - 304, 70 - - - 2 - - - VP8 - @Invariant - - tpVpx - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tcFFmpegVideoCodecs - - - 1 - - - 4, 22 - - - 304, 70 - - - 3 - - - Xvid - @Invariant - - tpXvid - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tcFFmpegVideoCodecs - - - 2 - True @@ -1021,54 +1342,6 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 3 - - 4, 22 - - - 3, 3, 3, 3 - - - 304, 70 - - - 4 - - - GIF - @Invariant - - tpGIF - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tcFFmpegVideoCodecs - - - 3 - - - 8, 56 - - - 312, 96 - - - 3 - - - tcFFmpegVideoCodecs - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gbCodecs - - - 6 - 176, 404 @@ -1117,20 +1390,62 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 5 - - True + + tpAAC - - 16, 16 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 40, 13 + + tcFFmpegAudioCodecs - + 0 - - Bitrate: + + tpVorbis + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcFFmpegAudioCodecs + + + 1 + + + tpMP3 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcFFmpegAudioCodecs + + + 2 + + + 328, 56 + + + 312, 96 + + + 4 + + + tcFFmpegAudioCodecs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbCodecs + + + 5 lblAACQuality @@ -1171,20 +1486,32 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 0 - + True - + 16, 16 - - 42, 13 + + 40, 13 - + 0 - - Quality: + + Bitrate: + + + lblAACQuality + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpAAC + + + 1 lblVorbisQuality @@ -1225,21 +1552,33 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 1 - + True - + 16, 16 - + 42, 13 - + 0 - + Quality: + + lblVorbisQuality + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpVorbis + + + 1 + lblMP3Quality @@ -1279,26 +1618,32 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 2 - - 328, 56 + + True - - 312, 96 + + 16, 16 - - 4 + + 42, 13 - - tcFFmpegAudioCodecs + + 0 - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Quality: - - gbCodecs + + lblMP3Quality - - 5 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpMP3 + + + 1 184, 25 @@ -1444,6 +1789,78 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 2 + + btnHelperDevicesHelp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSource + + + 0 + + + lblHelperDevices + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSource + + + 1 + + + btnInstallHelperDevices + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSource + + + 2 + + + btnRefreshSources + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gbSource + + + 7 + + + 8, 68 + + + 648, 92 + + + 1 + + + Sources + + + gbSource + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + 168, 56 @@ -1543,30 +1960,6 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.< 7 - - 8, 68 - - - 648, 92 - - - 1 - - - Sources - - - gbSource - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - 8, 168 diff --git a/ShareX.ScreenCaptureLib/Screencast/ScreencastOptions.cs b/ShareX.ScreenCaptureLib/Screencast/ScreencastOptions.cs index 86050100f..0fc0fc6e5 100644 --- a/ShareX.ScreenCaptureLib/Screencast/ScreencastOptions.cs +++ b/ShareX.ScreenCaptureLib/Screencast/ScreencastOptions.cs @@ -41,12 +41,7 @@ public class ScreencastOptions public Rectangle CaptureArea { get; set; } public float Duration { get; set; } public bool DrawCursor { get; set; } - public FFmpegOptions FFmpeg { get; set; } - - public ScreencastOptions() - { - FFmpeg = new FFmpegOptions(); - } + public FFmpegOptions FFmpeg { get; set; } = new FFmpegOptions(); public string GetFFmpegCommands() { @@ -181,8 +176,8 @@ public string GetFFmpegArgs(bool isCustom = false) break; case FFmpegVideoCodec.h264_nvenc: // https://trac.ffmpeg.org/wiki/HWAccelIntro#NVENC case FFmpegVideoCodec.hevc_nvenc: - args.AppendFormat("-preset {0} ", "default"); // TODO: Add preset option - args.AppendFormat("-b:v {0}k ", "10000"); // TODO: Add bitrate option + args.AppendFormat("-preset {0} ", FFmpeg.NVENC_preset); + args.AppendFormat("-b:v {0}k ", FFmpeg.NVENC_bitrate); args.AppendFormat("-pix_fmt {0} ", "yuv420p"); break; case FFmpegVideoCodec.gif: