About form update, FFmpeg default setting changes

This commit is contained in:
Jaex 2014-05-27 13:36:37 +03:00
parent 7aa28d610d
commit 80eca25509
5 changed files with 26 additions and 29 deletions

View file

@ -67,8 +67,8 @@ public FFmpegOptions()
ShowError = true; ShowError = true;
// x264 // x264
x264_CRF = 23; x264_CRF = 30;
Preset = FFmpegPreset.medium; Preset = FFmpegPreset.fast;
// VPx // VPx
VPx_CRF = 12; VPx_CRF = 12;
@ -77,9 +77,9 @@ public FFmpegOptions()
XviD_qscale = 3; XviD_qscale = 3;
// Audio // Audio
AAC_bitrate = 128;
Vorbis_qscale = 3; Vorbis_qscale = 3;
MP3_qscale = 4; MP3_qscale = 4;
AAC_bitrate = 128;
} }
public bool IsAudioSourceSelected() public bool IsAudioSourceSelected()

View file

@ -311,7 +311,7 @@ private void InitializeComponent()
this.gbFFmpegExe.Controls.Add(this.btnDownload); this.gbFFmpegExe.Controls.Add(this.btnDownload);
this.gbFFmpegExe.Controls.Add(this.btnFFmpegBrowse); this.gbFFmpegExe.Controls.Add(this.btnFFmpegBrowse);
this.gbFFmpegExe.Controls.Add(this.txtFFmpegPath); this.gbFFmpegExe.Controls.Add(this.txtFFmpegPath);
this.gbFFmpegExe.Location = new System.Drawing.Point(8, 216); this.gbFFmpegExe.Location = new System.Drawing.Point(8, 184);
this.gbFFmpegExe.Name = "gbFFmpegExe"; this.gbFFmpegExe.Name = "gbFFmpegExe";
this.gbFFmpegExe.Size = new System.Drawing.Size(648, 56); this.gbFFmpegExe.Size = new System.Drawing.Size(648, 56);
this.gbFFmpegExe.TabIndex = 6; this.gbFFmpegExe.TabIndex = 6;
@ -349,7 +349,7 @@ private void InitializeComponent()
// gbCommandLinePreview // gbCommandLinePreview
// //
this.gbCommandLinePreview.Controls.Add(this.txtCommandLinePreview); this.gbCommandLinePreview.Controls.Add(this.txtCommandLinePreview);
this.gbCommandLinePreview.Location = new System.Drawing.Point(8, 349); this.gbCommandLinePreview.Location = new System.Drawing.Point(8, 317);
this.gbCommandLinePreview.Name = "gbCommandLinePreview"; this.gbCommandLinePreview.Name = "gbCommandLinePreview";
this.gbCommandLinePreview.Padding = new System.Windows.Forms.Padding(8); this.gbCommandLinePreview.Padding = new System.Windows.Forms.Padding(8);
this.gbCommandLinePreview.Size = new System.Drawing.Size(648, 96); this.gbCommandLinePreview.Size = new System.Drawing.Size(648, 96);
@ -372,7 +372,7 @@ private void InitializeComponent()
// //
this.gbCommandLineArgs.Controls.Add(this.btnFFmpegHelp); this.gbCommandLineArgs.Controls.Add(this.btnFFmpegHelp);
this.gbCommandLineArgs.Controls.Add(this.tbUserArgs); this.gbCommandLineArgs.Controls.Add(this.tbUserArgs);
this.gbCommandLineArgs.Location = new System.Drawing.Point(8, 280); this.gbCommandLineArgs.Location = new System.Drawing.Point(8, 248);
this.gbCommandLineArgs.Name = "gbCommandLineArgs"; this.gbCommandLineArgs.Name = "gbCommandLineArgs";
this.gbCommandLineArgs.Size = new System.Drawing.Size(648, 56); this.gbCommandLineArgs.Size = new System.Drawing.Size(648, 56);
this.gbCommandLineArgs.TabIndex = 7; this.gbCommandLineArgs.TabIndex = 7;
@ -460,7 +460,7 @@ private void InitializeComponent()
// //
// btnTest // btnTest
// //
this.btnTest.Location = new System.Drawing.Point(136, 344); this.btnTest.Location = new System.Drawing.Point(136, 312);
this.btnTest.Name = "btnTest"; this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(88, 23); this.btnTest.Size = new System.Drawing.Size(88, 23);
this.btnTest.TabIndex = 8; this.btnTest.TabIndex = 8;
@ -470,7 +470,7 @@ private void InitializeComponent()
// //
// btnCopyPreview // btnCopyPreview
// //
this.btnCopyPreview.Location = new System.Drawing.Point(227, 344); this.btnCopyPreview.Location = new System.Drawing.Point(227, 312);
this.btnCopyPreview.Name = "btnCopyPreview"; this.btnCopyPreview.Name = "btnCopyPreview";
this.btnCopyPreview.Size = new System.Drawing.Size(53, 23); this.btnCopyPreview.Size = new System.Drawing.Size(53, 23);
this.btnCopyPreview.TabIndex = 9; this.btnCopyPreview.TabIndex = 9;
@ -659,7 +659,7 @@ private void InitializeComponent()
// cbShowError // cbShowError
// //
this.cbShowError.AutoSize = true; this.cbShowError.AutoSize = true;
this.cbShowError.Location = new System.Drawing.Point(10, 184); this.cbShowError.Location = new System.Drawing.Point(9, 424);
this.cbShowError.Name = "cbShowError"; this.cbShowError.Name = "cbShowError";
this.cbShowError.Size = new System.Drawing.Size(295, 17); this.cbShowError.Size = new System.Drawing.Size(295, 17);
this.cbShowError.TabIndex = 11; this.cbShowError.TabIndex = 11;

View file

@ -112,12 +112,12 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="tpFFmpeg.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="tpFFmpeg.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<data name="nudx264CRF.ToolTip" xml:space="preserve"> <data name="nudx264CRF.ToolTip" xml:space="preserve">

View file

@ -105,6 +105,9 @@ public string GetFFmpegArgs()
case FFmpegVideoCodec.libx264: // https://trac.ffmpeg.org/wiki/x264EncodingGuide case FFmpegVideoCodec.libx264: // https://trac.ffmpeg.org/wiki/x264EncodingGuide
args.AppendFormat("-crf {0} ", FFmpeg.x264_CRF); args.AppendFormat("-crf {0} ", FFmpeg.x264_CRF);
args.AppendFormat("-preset {0} ", FFmpeg.Preset.ToString()); args.AppendFormat("-preset {0} ", FFmpeg.Preset.ToString());
args.AppendFormat("-tune {0} ", "zerolatency");
// -pix_fmt yuv420p required otherwise can't stream in Chrome
args.Append("-pix_fmt yuv420p ");
break; break;
case FFmpegVideoCodec.libvpx: // https://trac.ffmpeg.org/wiki/vpxEncodingGuide case FFmpegVideoCodec.libvpx: // https://trac.ffmpeg.org/wiki/vpxEncodingGuide
args.AppendFormat("-crf {0} ", FFmpeg.VPx_CRF); args.AppendFormat("-crf {0} ", FFmpeg.VPx_CRF);
@ -114,25 +117,19 @@ public string GetFFmpegArgs()
break; break;
} }
// -pix_fmt yuv420p required for libx264 otherwise can't stream in Chrome
if (FFmpeg.VideoCodec == FFmpegVideoCodec.libx264)
{
args.Append("-pix_fmt yuv420p -tune zerolatency ");
}
if (FFmpeg.IsAudioSourceSelected()) if (FFmpeg.IsAudioSourceSelected())
{ {
switch (FFmpeg.AudioCodec) switch (FFmpeg.AudioCodec)
{ {
case FFmpegAudioCodec.libvoaacenc: // http://trac.ffmpeg.org/wiki/AACEncodingGuide
args.AppendFormat("-c:a libvo_aacenc -ac 2 -b:a {0}k ", FFmpeg.AAC_bitrate); // -ac 2 required otherwise failing with 7.1
break;
case FFmpegAudioCodec.libvorbis: // http://trac.ffmpeg.org/wiki/TheoraVorbisEncodingGuide case FFmpegAudioCodec.libvorbis: // http://trac.ffmpeg.org/wiki/TheoraVorbisEncodingGuide
args.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libvorbis.ToString(), FFmpeg.Vorbis_qscale); args.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libvorbis.ToString(), FFmpeg.Vorbis_qscale);
break; break;
case FFmpegAudioCodec.libmp3lame: // http://trac.ffmpeg.org/wiki/Encoding%20VBR%20(Variable%20Bit%20Rate)%20mp3%20audio case FFmpegAudioCodec.libmp3lame: // http://trac.ffmpeg.org/wiki/Encoding%20VBR%20(Variable%20Bit%20Rate)%20mp3%20audio
args.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libmp3lame.ToString(), FFmpeg.MP3_qscale); args.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libmp3lame.ToString(), FFmpeg.MP3_qscale);
break; break;
case FFmpegAudioCodec.libvoaacenc: // http://trac.ffmpeg.org/wiki/AACEncodingGuide
args.AppendFormat("-c:a libvo_aacenc -ac 2 -b:a {0}k ", FFmpeg.AAC_bitrate); // -ac 2 required otherwise failing with 7.1
break;
} }
} }

View file

@ -112,10 +112,10 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="rtbCredits.Text" xml:space="preserve"> <data name="rtbCredits.Text" xml:space="preserve">
<value>Contributors: <value>Contributors:
@ -127,18 +127,18 @@ Amazon S3 and DreamObjects support: Alan Edwardes - http://alanedwardes.com
External libraries: External libraries:
Greenshot Image Editor: http://sourceforge.net/projects/greenshot Greenshot Image Editor: https://bitbucket.org/greenshot/greenshot
FTP Library: http://biko.codeplex.com Json.NET: https://json.codeplex.com
Json.NET: http://json.codeplex.com SSH.NET: https://sshnet.codeplex.com
SSH.NET: http://sshnet.codeplex.com
Icons: http://p.yusukekamiyamane.com Icons: http://p.yusukekamiyamane.com
ImageListView: http://code.google.com/p/imagelistview ImageListView: https://code.google.com/p/imagelistview
AviWriter: https://code.google.com/p/aforge AviWriter: https://code.google.com/p/aforge
FFmpeg Windows builds: http://ffmpeg.zeranoe.com/builds FFmpeg Windows builds: http://ffmpeg.zeranoe.com/builds
7-Zip: http://www.7-zip.org 7-Zip: http://www.7-zip.org
SevenZipSharp: http://sevenzipsharp.codeplex.com SevenZipSharp: https://sevenzipsharp.codeplex.com
DirectShow video and audio device: https://github.com/rdp/screen-capture-recorder-to-video-windows-free DirectShow video and audio device: https://github.com/rdp/screen-capture-recorder-to-video-windows-free
QrCode.Net: https://qrcodenet.codeplex.com QrCode.Net: https://qrcodenet.codeplex.com
System.Net.FtpClient: https://netftp.codeplex.com
Copyright © 2007 - 2014 ShareX Developers</value> Copyright © 2007 - 2014 ShareX Developers</value>
</data> </data>