Changing FFmpeg default settings

This commit is contained in:
Jaex 2015-06-01 13:57:37 +03:00
parent c1de749603
commit 3253897282
4 changed files with 11 additions and 19 deletions

View file

@ -66,7 +66,7 @@ public enum FFmpegVideoCodec
{
[Description("x264")]
libx264,
[Description("VP8")]
[Description("VP8 (WebM)")]
libvpx,
[Description("Xvid")]
libxvid

View file

@ -37,18 +37,14 @@ public class FFmpegOptions
public string Extension { get; set; }
public string CLIPath { get; set; }
public string UserArgs { get; set; }
public bool ShowError { get; set; }
public bool UseCustomCommands { get; set; }
public string CustomCommands { get; set; }
public bool ShowError { get; set; }
// H.264 - x264
public FFmpegPreset Preset { get; set; }
// Video
public FFmpegPreset x264_Preset { get; set; }
public int x264_CRF { get; set; }
// H.264 - VPx
public int VPx_bitrate { get; set; } // kbit/s
// H.263
public int XviD_qscale { get; set; }
// Audio
@ -92,15 +88,11 @@ public FFmpegOptions()
UserArgs = "";
ShowError = true;
// x264
// Video
x264_CRF = 30;
Preset = FFmpegPreset.fast;
// VPx
VPx_bitrate = 1000;
// XviD
XviD_qscale = 3;
x264_Preset = FFmpegPreset.veryfast;
VPx_bitrate = 3000;
XviD_qscale = 10;
// Audio
AAC_bitrate = 128;

View file

@ -76,7 +76,7 @@ private void SettingsLoad()
// x264
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
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)
{
Options.FFmpeg.Preset = (FFmpegPreset)cbPreset.SelectedIndex;
Options.FFmpeg.x264_Preset = (FFmpegPreset)cbPreset.SelectedIndex;
UpdateUI();
}

View file

@ -145,7 +145,7 @@ public string GetFFmpegArgs(bool isCustom = false)
{
case FFmpegVideoCodec.libx264: // https://trac.ffmpeg.org/wiki/Encode/H.264
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.Append("-pix_fmt yuv420p "); // -pix_fmt yuv420p required otherwise can't stream in Chrome
break;