mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-04 04:06:05 +13:00
Changing FFmpeg default settings
This commit is contained in:
parent
c1de749603
commit
3253897282
4 changed files with 11 additions and 19 deletions
|
@ -66,7 +66,7 @@ public enum FFmpegVideoCodec
|
||||||
{
|
{
|
||||||
[Description("x264")]
|
[Description("x264")]
|
||||||
libx264,
|
libx264,
|
||||||
[Description("VP8")]
|
[Description("VP8 (WebM)")]
|
||||||
libvpx,
|
libvpx,
|
||||||
[Description("Xvid")]
|
[Description("Xvid")]
|
||||||
libxvid
|
libxvid
|
||||||
|
|
|
@ -37,18 +37,14 @@ public class FFmpegOptions
|
||||||
public string Extension { get; set; }
|
public string Extension { get; set; }
|
||||||
public string CLIPath { get; set; }
|
public string CLIPath { get; set; }
|
||||||
public string UserArgs { get; set; }
|
public string UserArgs { get; set; }
|
||||||
public bool ShowError { get; set; }
|
|
||||||
public bool UseCustomCommands { get; set; }
|
public bool UseCustomCommands { get; set; }
|
||||||
public string CustomCommands { get; set; }
|
public string CustomCommands { get; set; }
|
||||||
|
public bool ShowError { get; set; }
|
||||||
|
|
||||||
// H.264 - x264
|
// Video
|
||||||
public FFmpegPreset Preset { get; set; }
|
public FFmpegPreset x264_Preset { get; set; }
|
||||||
public int x264_CRF { get; set; }
|
public int x264_CRF { get; set; }
|
||||||
|
|
||||||
// H.264 - VPx
|
|
||||||
public int VPx_bitrate { get; set; } // kbit/s
|
public int VPx_bitrate { get; set; } // kbit/s
|
||||||
|
|
||||||
// H.263
|
|
||||||
public int XviD_qscale { get; set; }
|
public int XviD_qscale { get; set; }
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
|
@ -92,15 +88,11 @@ public FFmpegOptions()
|
||||||
UserArgs = "";
|
UserArgs = "";
|
||||||
ShowError = true;
|
ShowError = true;
|
||||||
|
|
||||||
// x264
|
// Video
|
||||||
x264_CRF = 30;
|
x264_CRF = 30;
|
||||||
Preset = FFmpegPreset.fast;
|
x264_Preset = FFmpegPreset.veryfast;
|
||||||
|
VPx_bitrate = 3000;
|
||||||
// VPx
|
XviD_qscale = 10;
|
||||||
VPx_bitrate = 1000;
|
|
||||||
|
|
||||||
// XviD
|
|
||||||
XviD_qscale = 3;
|
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
AAC_bitrate = 128;
|
AAC_bitrate = 128;
|
||||||
|
|
|
@ -76,7 +76,7 @@ private void SettingsLoad()
|
||||||
|
|
||||||
// x264
|
// x264
|
||||||
nudx264CRF.Value = Options.FFmpeg.x264_CRF.Between((int)nudx264CRF.Minimum, (int)nudx264CRF.Maximum);
|
nudx264CRF.Value = Options.FFmpeg.x264_CRF.Between((int)nudx264CRF.Minimum, (int)nudx264CRF.Maximum);
|
||||||
cbPreset.SelectedIndex = (int)Options.FFmpeg.Preset;
|
cbPreset.SelectedIndex = (int)Options.FFmpeg.x264_Preset;
|
||||||
|
|
||||||
// VPx
|
// VPx
|
||||||
nudVP8Bitrate.Value = Options.FFmpeg.VPx_bitrate.Between((int)nudVP8Bitrate.Minimum, (int)nudVP8Bitrate.Maximum);
|
nudVP8Bitrate.Value = Options.FFmpeg.VPx_bitrate.Between((int)nudVP8Bitrate.Minimum, (int)nudVP8Bitrate.Maximum);
|
||||||
|
@ -223,7 +223,7 @@ private void nudx264CRF_ValueChanged(object sender, EventArgs e)
|
||||||
|
|
||||||
private void cbPreset_SelectedIndexChanged(object sender, EventArgs e)
|
private void cbPreset_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Options.FFmpeg.Preset = (FFmpegPreset)cbPreset.SelectedIndex;
|
Options.FFmpeg.x264_Preset = (FFmpegPreset)cbPreset.SelectedIndex;
|
||||||
UpdateUI();
|
UpdateUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ public string GetFFmpegArgs(bool isCustom = false)
|
||||||
{
|
{
|
||||||
case FFmpegVideoCodec.libx264: // https://trac.ffmpeg.org/wiki/Encode/H.264
|
case FFmpegVideoCodec.libx264: // https://trac.ffmpeg.org/wiki/Encode/H.264
|
||||||
args.AppendFormat("-crf {0} ", FFmpeg.x264_CRF);
|
args.AppendFormat("-crf {0} ", FFmpeg.x264_CRF);
|
||||||
args.AppendFormat("-preset {0} ", FFmpeg.Preset);
|
args.AppendFormat("-preset {0} ", FFmpeg.x264_Preset);
|
||||||
args.AppendFormat("-tune {0} ", "zerolatency");
|
args.AppendFormat("-tune {0} ", "zerolatency");
|
||||||
args.Append("-pix_fmt yuv420p "); // -pix_fmt yuv420p required otherwise can't stream in Chrome
|
args.Append("-pix_fmt yuv420p "); // -pix_fmt yuv420p required otherwise can't stream in Chrome
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue