fixed #160: Removed input fps which was causing fast video problem

This commit is contained in:
Jaex 2014-06-04 00:16:33 +03:00
parent 281cb4574a
commit 6850774a18
3 changed files with 19 additions and 15 deletions

View file

@ -29,9 +29,9 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
this.scMain = new System.Windows.Forms.SplitContainer();
this.tcMain = new System.Windows.Forms.TabControl();
this.lvMain = new HelpersLib.MyListView();
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tcMain = new System.Windows.Forms.TabControl();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout();
@ -59,15 +59,6 @@ private void InitializeComponent()
this.scMain.SplitterWidth = 3;
this.scMain.TabIndex = 0;
//
// tcMain
//
this.tcMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcMain.Location = new System.Drawing.Point(0, 0);
this.tcMain.Name = "tcMain";
this.tcMain.SelectedIndex = 0;
this.tcMain.Size = new System.Drawing.Size(460, 500);
this.tcMain.TabIndex = 0;
//
// lvMain
//
this.lvMain.AutoFillColumn = true;
@ -86,6 +77,15 @@ private void InitializeComponent()
this.lvMain.View = System.Windows.Forms.View.Details;
this.lvMain.SelectedIndexChanged += new System.EventHandler(this.lvMain_SelectedIndexChanged);
//
// tcMain
//
this.tcMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcMain.Location = new System.Drawing.Point(0, 0);
this.tcMain.Name = "tcMain";
this.tcMain.SelectedIndex = 0;
this.tcMain.Size = new System.Drawing.Size(460, 500);
this.tcMain.TabIndex = 0;
//
// TabToListView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View file

@ -107,6 +107,8 @@ private void FillListView(TabControl tab)
lvi.Group = lvg;
lvMain.Items.Add(lvi);
}
tab2.TabPages.Clear();
}
}
}

View file

@ -50,8 +50,11 @@ public string GetFFmpegArgs()
{
StringBuilder args = new StringBuilder();
// input FPS
args.AppendFormat("-r {0} ", ScreenRecordFPS);
// -y for overwrite file
args.Append("-y ");
// default real time buffer size was 3041280 (3M)
args.Append("-rtbufsize 10M ");
if (string.IsNullOrEmpty(FFmpeg.VideoSource) || FFmpeg.VideoSource.Equals(FFmpegHelper.GDIgrab, StringComparison.InvariantCultureIgnoreCase))
{
@ -106,6 +109,7 @@ public string GetFFmpegArgs()
args.AppendFormat("-crf {0} ", FFmpeg.x264_CRF);
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;
@ -135,12 +139,10 @@ public string GetFFmpegArgs()
if (Duration > 0)
{
// duration limit
args.AppendFormat("-t {0} ", Duration);
}
// -y for overwrite file
args.Append("-y ");
args.AppendFormat("\"{0}\"", Path.ChangeExtension(OutputPath, FFmpeg.Extension));
return args.ToString();