diff --git a/Lib/AForge.Video.FFMPEG.dll b/Lib/AForge.Video.FFMPEG.dll new file mode 100644 index 000000000..4403604f0 Binary files /dev/null and b/Lib/AForge.Video.FFMPEG.dll differ diff --git a/Lib/AForge.Video.dll b/Lib/AForge.Video.dll new file mode 100644 index 000000000..dc67243ec Binary files /dev/null and b/Lib/AForge.Video.dll differ diff --git a/ShareX Setup.iss b/ShareX Setup.iss index 7b23821b1..4672eb90b 100644 --- a/ShareX Setup.iss +++ b/ShareX Setup.iss @@ -56,7 +56,7 @@ Name: "CreateStartupIcon"; Description: "Launch {#MyAppName} automatically at Wi [Files] Source: "ShareX\bin\Release\*.exe"; Excludes: *.vshost.exe; DestDir: {app}; Flags: ignoreversion -Source: "ShareX\bin\Release\*.dll"; DestDir: {app}; Flags: ignoreversion +Source: "ShareX\bin\Release\*.dll"; Excludes: AForge.*.dll; DestDir: {app}; Flags: ignoreversion Source: "ShareX\bin\Release\*.css"; DestDir: {app}; Flags: ignoreversion Source: "ShareX\bin\Release\*.txt"; DestDir: {app}; Flags: ignoreversion ;Source: "ShareX\bin\Release\*.pdb"; DestDir: {app}; Flags: ignoreversion diff --git a/ShareX/Forms/ApplicationSettingsForm.cs b/ShareX/Forms/ApplicationSettingsForm.cs index ef49ccd6b..547723f30 100644 --- a/ShareX/Forms/ApplicationSettingsForm.cs +++ b/ShareX/Forms/ApplicationSettingsForm.cs @@ -123,9 +123,9 @@ private void LoadSettings() // Profiles if (Program.Settings.VideoEncoders.Count == 0) { - Program.Settings.VideoEncoders.Add(new VideoEncoder() { Name = "x264 encoder to MP4", Path = "x264.exe", Args = "--output %output %input", OutputExtension = "mp4" }); - Program.Settings.VideoEncoders.Add(new VideoEncoder() { Name = "ffmpeg encoder to WebM", Path = "ffmpeg.exe", Args = "-i %input -c:v libvpx -crf 12 -b:v 500K %output", OutputExtension = "webm" }); - Program.Settings.VideoEncoders.Add(new VideoEncoder() { Name = "Change container to MP4 using ffmpeg encoder", Path = "ffmpeg.exe", Args = "-i %input -c:v copy %output", OutputExtension = "mp4" }); + Program.Settings.VideoEncoders.Add(new VideoEncoder() { Name = "Encode using x264.exe to H.264", Path = "x264.exe", Args = "--output %output %input", OutputExtension = "mp4" }); + Program.Settings.VideoEncoders.Add(new VideoEncoder() { Name = "Encode using ffmpeg.exe to WebM", Path = "ffmpeg.exe", Args = "-i %input -c:v libvpx -crf 12 -b:v 500K %output", OutputExtension = "webm" }); + Program.Settings.VideoEncoders.Add(new VideoEncoder() { Name = "Change container to MP4 using ffmpeg.exe", Path = "ffmpeg.exe", Args = "-i %input -c:v copy %output", OutputExtension = "mp4" }); } Program.Settings.VideoEncoders.ForEach(x => AddVideoEncoder(x)); diff --git a/ShareX/Forms/ScreenRecordForm.cs b/ShareX/Forms/ScreenRecordForm.cs index e062ccc19..2122a96da 100644 --- a/ShareX/Forms/ScreenRecordForm.cs +++ b/ShareX/Forms/ScreenRecordForm.cs @@ -82,6 +82,15 @@ private void SelectRegion() public async void StartRecording(TaskSettings TaskSettings) { + if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg && !FFmpegRecorder.HasDependencies()) + { + if (MessageBox.Show("FFmpeg files are not present. Would you like to download them?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) + { + Helpers.OpenURL("http://aforgeffmpeg.codeplex.com"); + } + return; + } + if (TaskSettings.CaptureSettings.RunScreencastCLI) { if (!Program.Settings.VideoEncoders.IsValidIndex(TaskSettings.CaptureSettings.VideoEncoderSelected)) @@ -96,14 +105,6 @@ public async void StartRecording(TaskSettings TaskSettings) return; } } - else if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg && !FFmpegRecorder.HasDependencies()) - { - if (MessageBox.Show("FFmpeg files are not present. Would you like to download them?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) - { - Helpers.OpenURL("http://aforgeffmpeg.codeplex.com"); - } - return; - } SelectRegion(); Screenshot.CaptureCursor = TaskSettings.CaptureSettings.ShowCursor; diff --git a/ShareX/Forms/TaskSettingsForm.Designer.cs b/ShareX/Forms/TaskSettingsForm.Designer.cs index 7c78f0018..00a786c61 100644 --- a/ShareX/Forms/TaskSettingsForm.Designer.cs +++ b/ShareX/Forms/TaskSettingsForm.Designer.cs @@ -41,12 +41,16 @@ private void InitializeComponent() this.tpTask = new System.Windows.Forms.TabPage(); this.chkOverrideFTP = new System.Windows.Forms.CheckBox(); this.cboFTPaccounts = new System.Windows.Forms.ComboBox(); + this.btnAfterCapture = new HelpersLib.MenuButton(); + this.btnAfterUpload = new HelpersLib.MenuButton(); + this.btnDestinations = new HelpersLib.MenuButton(); this.cmsDestinations = new System.Windows.Forms.ContextMenuStrip(this.components); this.tsmiImageUploaders = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTextUploaders = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFileUploaders = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiURLShorteners = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiSocialServices = new System.Windows.Forms.ToolStripMenuItem(); + this.btnTask = new HelpersLib.MenuButton(); this.tpGeneral = new System.Windows.Forms.TabPage(); this.panelGeneral = new System.Windows.Forms.Panel(); this.lblAfterTaskNotification = new System.Windows.Forms.Label(); @@ -105,6 +109,7 @@ private void InitializeComponent() this.tpCaptureShape = new System.Windows.Forms.TabPage(); this.pgShapesCapture = new System.Windows.Forms.PropertyGrid(); this.tpScreenRecorder = new System.Windows.Forms.TabPage(); + this.chkRunScreencastCLI = new System.Windows.Forms.CheckBox(); this.lblScreenRecorderCLI = new System.Windows.Forms.Label(); this.btnScreenRecorderAVIOptions = new System.Windows.Forms.Button(); this.btnEncoderConfig = new System.Windows.Forms.Button(); @@ -121,6 +126,10 @@ private void InitializeComponent() this.tpActions = new System.Windows.Forms.TabPage(); this.pActions = new System.Windows.Forms.Panel(); this.btnActionsAdd = new System.Windows.Forms.Button(); + this.lvActions = new HelpersLib.MyListView(); + this.chActionsName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chActionsPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chActionsArgs = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.btnActionsEdit = new System.Windows.Forms.Button(); this.btnActionsRemove = new System.Windows.Forms.Button(); this.chkUseDefaultActions = new System.Windows.Forms.CheckBox(); @@ -153,15 +162,6 @@ private void InitializeComponent() this.tpAdvanced = new System.Windows.Forms.TabPage(); this.pgTaskSettings = new System.Windows.Forms.PropertyGrid(); this.chkUseDefaultAdvancedSettings = new System.Windows.Forms.CheckBox(); - this.chkRunScreencastCLI = new System.Windows.Forms.CheckBox(); - this.btnAfterCapture = new HelpersLib.MenuButton(); - this.btnAfterUpload = new HelpersLib.MenuButton(); - this.btnDestinations = new HelpersLib.MenuButton(); - this.btnTask = new HelpersLib.MenuButton(); - this.lvActions = new HelpersLib.MyListView(); - this.chActionsName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chActionsPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.chActionsArgs = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tcHotkeySettings.SuspendLayout(); this.tpTask.SuspendLayout(); this.cmsDestinations.SuspendLayout(); @@ -324,6 +324,42 @@ private void InitializeComponent() this.cboFTPaccounts.TabIndex = 13; this.cboFTPaccounts.SelectedIndexChanged += new System.EventHandler(this.cboFTPaccounts_SelectedIndexChanged); // + // btnAfterCapture + // + this.btnAfterCapture.Location = new System.Drawing.Point(6, 93); + this.btnAfterCapture.Menu = this.cmsAfterCapture; + this.btnAfterCapture.Name = "btnAfterCapture"; + this.btnAfterCapture.Size = new System.Drawing.Size(506, 23); + this.btnAfterCapture.TabIndex = 4; + this.btnAfterCapture.Text = "After capture..."; + this.btnAfterCapture.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnAfterCapture.UseMnemonic = false; + this.btnAfterCapture.UseVisualStyleBackColor = true; + // + // btnAfterUpload + // + this.btnAfterUpload.Location = new System.Drawing.Point(6, 149); + this.btnAfterUpload.Menu = this.cmsAfterUpload; + this.btnAfterUpload.Name = "btnAfterUpload"; + this.btnAfterUpload.Size = new System.Drawing.Size(506, 23); + this.btnAfterUpload.TabIndex = 6; + this.btnAfterUpload.Text = "After upload..."; + this.btnAfterUpload.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnAfterUpload.UseMnemonic = false; + this.btnAfterUpload.UseVisualStyleBackColor = true; + // + // btnDestinations + // + this.btnDestinations.Location = new System.Drawing.Point(6, 205); + this.btnDestinations.Menu = this.cmsDestinations; + this.btnDestinations.Name = "btnDestinations"; + this.btnDestinations.Size = new System.Drawing.Size(506, 23); + this.btnDestinations.TabIndex = 8; + this.btnDestinations.Text = "Destinations..."; + this.btnDestinations.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnDestinations.UseMnemonic = false; + this.btnDestinations.UseVisualStyleBackColor = true; + // // cmsDestinations // this.cmsDestinations.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -370,6 +406,18 @@ private void InitializeComponent() this.tsmiSocialServices.Size = new System.Drawing.Size(212, 22); this.tsmiSocialServices.Text = "Social networking services"; // + // btnTask + // + this.btnTask.Location = new System.Drawing.Point(6, 37); + this.btnTask.Menu = this.cmsTask; + this.btnTask.Name = "btnTask"; + this.btnTask.Size = new System.Drawing.Size(506, 23); + this.btnTask.TabIndex = 2; + this.btnTask.Text = "Task..."; + this.btnTask.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnTask.UseMnemonic = false; + this.btnTask.UseVisualStyleBackColor = true; + // // tpGeneral // this.tpGeneral.Controls.Add(this.panelGeneral); @@ -1080,6 +1128,17 @@ private void InitializeComponent() this.tpScreenRecorder.Text = "Screen recorder"; this.tpScreenRecorder.UseVisualStyleBackColor = true; // + // chkRunScreencastCLI + // + this.chkRunScreencastCLI.AutoSize = true; + this.chkRunScreencastCLI.Location = new System.Drawing.Point(336, 14); + this.chkRunScreencastCLI.Name = "chkRunScreencastCLI"; + this.chkRunScreencastCLI.Size = new System.Drawing.Size(117, 17); + this.chkRunScreencastCLI.TabIndex = 14; + this.chkRunScreencastCLI.Text = "Run CLI afterwards"; + this.chkRunScreencastCLI.UseVisualStyleBackColor = true; + this.chkRunScreencastCLI.CheckedChanged += new System.EventHandler(this.chkRunScreencastCLI_CheckedChanged); + // // lblScreenRecorderCLI // this.lblScreenRecorderCLI.AutoSize = true; @@ -1095,7 +1154,7 @@ private void InitializeComponent() this.btnScreenRecorderAVIOptions.Name = "btnScreenRecorderAVIOptions"; this.btnScreenRecorderAVIOptions.Size = new System.Drawing.Size(96, 23); this.btnScreenRecorderAVIOptions.TabIndex = 12; - this.btnScreenRecorderAVIOptions.Text = "AVI options..."; + this.btnScreenRecorderAVIOptions.Text = "VfW options..."; this.btnScreenRecorderAVIOptions.UseVisualStyleBackColor = true; this.btnScreenRecorderAVIOptions.Click += new System.EventHandler(this.btnScreenRecorderAVIOptions_Click); // @@ -1296,6 +1355,38 @@ private void InitializeComponent() this.btnActionsAdd.UseVisualStyleBackColor = true; this.btnActionsAdd.Click += new System.EventHandler(this.btnActionsAdd_Click); // + // lvActions + // + this.lvActions.CheckBoxes = true; + this.lvActions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chActionsName, + this.chActionsPath, + this.chActionsArgs}); + this.lvActions.FullRowSelect = true; + this.lvActions.Location = new System.Drawing.Point(8, 40); + this.lvActions.MultiSelect = false; + this.lvActions.Name = "lvActions"; + this.lvActions.Size = new System.Drawing.Size(496, 280); + this.lvActions.TabIndex = 3; + this.lvActions.UseCompatibleStateImageBehavior = false; + this.lvActions.View = System.Windows.Forms.View.Details; + this.lvActions.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvActions_ItemChecked); + // + // chActionsName + // + this.chActionsName.Text = "Name"; + this.chActionsName.Width = 100; + // + // chActionsPath + // + this.chActionsPath.Text = "Path"; + this.chActionsPath.Width = 250; + // + // chActionsArgs + // + this.chActionsArgs.Text = "Args"; + this.chActionsArgs.Width = 134; + // // btnActionsEdit // this.btnActionsEdit.Location = new System.Drawing.Point(88, 8); @@ -1644,97 +1735,6 @@ private void InitializeComponent() this.chkUseDefaultAdvancedSettings.UseVisualStyleBackColor = true; this.chkUseDefaultAdvancedSettings.CheckedChanged += new System.EventHandler(this.chkUseDefaultAdvancedSettings_CheckedChanged); // - // chkRunScreencastCLI - // - this.chkRunScreencastCLI.AutoSize = true; - this.chkRunScreencastCLI.Location = new System.Drawing.Point(336, 14); - this.chkRunScreencastCLI.Name = "chkRunScreencastCLI"; - this.chkRunScreencastCLI.Size = new System.Drawing.Size(117, 17); - this.chkRunScreencastCLI.TabIndex = 14; - this.chkRunScreencastCLI.Text = "Run CLI afterwards"; - this.chkRunScreencastCLI.UseVisualStyleBackColor = true; - this.chkRunScreencastCLI.CheckedChanged += new System.EventHandler(this.chkRunScreencastCLI_CheckedChanged); - // - // btnAfterCapture - // - this.btnAfterCapture.Location = new System.Drawing.Point(6, 93); - this.btnAfterCapture.Menu = this.cmsAfterCapture; - this.btnAfterCapture.Name = "btnAfterCapture"; - this.btnAfterCapture.Size = new System.Drawing.Size(506, 23); - this.btnAfterCapture.TabIndex = 4; - this.btnAfterCapture.Text = "After capture..."; - this.btnAfterCapture.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnAfterCapture.UseMnemonic = false; - this.btnAfterCapture.UseVisualStyleBackColor = true; - // - // btnAfterUpload - // - this.btnAfterUpload.Location = new System.Drawing.Point(6, 149); - this.btnAfterUpload.Menu = this.cmsAfterUpload; - this.btnAfterUpload.Name = "btnAfterUpload"; - this.btnAfterUpload.Size = new System.Drawing.Size(506, 23); - this.btnAfterUpload.TabIndex = 6; - this.btnAfterUpload.Text = "After upload..."; - this.btnAfterUpload.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnAfterUpload.UseMnemonic = false; - this.btnAfterUpload.UseVisualStyleBackColor = true; - // - // btnDestinations - // - this.btnDestinations.Location = new System.Drawing.Point(6, 205); - this.btnDestinations.Menu = this.cmsDestinations; - this.btnDestinations.Name = "btnDestinations"; - this.btnDestinations.Size = new System.Drawing.Size(506, 23); - this.btnDestinations.TabIndex = 8; - this.btnDestinations.Text = "Destinations..."; - this.btnDestinations.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnDestinations.UseMnemonic = false; - this.btnDestinations.UseVisualStyleBackColor = true; - // - // btnTask - // - this.btnTask.Location = new System.Drawing.Point(6, 37); - this.btnTask.Menu = this.cmsTask; - this.btnTask.Name = "btnTask"; - this.btnTask.Size = new System.Drawing.Size(506, 23); - this.btnTask.TabIndex = 2; - this.btnTask.Text = "Task..."; - this.btnTask.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnTask.UseMnemonic = false; - this.btnTask.UseVisualStyleBackColor = true; - // - // lvActions - // - this.lvActions.CheckBoxes = true; - this.lvActions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.chActionsName, - this.chActionsPath, - this.chActionsArgs}); - this.lvActions.FullRowSelect = true; - this.lvActions.Location = new System.Drawing.Point(8, 40); - this.lvActions.MultiSelect = false; - this.lvActions.Name = "lvActions"; - this.lvActions.Size = new System.Drawing.Size(496, 280); - this.lvActions.TabIndex = 3; - this.lvActions.UseCompatibleStateImageBehavior = false; - this.lvActions.View = System.Windows.Forms.View.Details; - this.lvActions.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvActions_ItemChecked); - // - // chActionsName - // - this.chActionsName.Text = "Name"; - this.chActionsName.Width = 100; - // - // chActionsPath - // - this.chActionsPath.Text = "Path"; - this.chActionsPath.Width = 250; - // - // chActionsArgs - // - this.chActionsArgs.Text = "Args"; - this.chActionsArgs.Width = 134; - // // TaskSettingsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/ShareX/Forms/TaskSettingsForm.cs b/ShareX/Forms/TaskSettingsForm.cs index 00c601c4c..efb85d5d2 100644 --- a/ShareX/Forms/TaskSettingsForm.cs +++ b/ShareX/Forms/TaskSettingsForm.cs @@ -646,7 +646,8 @@ private void cbScreenRecorderOutput_SelectedIndexChanged(object sender, EventArg { TaskSettings.CaptureSettings.ScreenRecordOutput = (ScreenRecordOutput)cbScreenRecorderOutput.SelectedIndex; btnScreenRecorderAVIOptions.Enabled = TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.AVI; - btnEncoderConfig.Enabled = cboEncoder.Enabled = chkRunScreencastCLI.Enabled = TaskSettings.CaptureSettings.ScreenRecordOutput != ScreenRecordOutput.GIF; + chkRunScreencastCLI.Enabled = TaskSettings.CaptureSettings.ScreenRecordOutput != ScreenRecordOutput.GIF; + btnEncoderConfig.Enabled = cboEncoder.Enabled = chkRunScreencastCLI.Enabled && chkRunScreencastCLI.Checked; } private void btnScreenRecorderAVIOptions_Click(object sender, EventArgs e)