Revert "FFmpeg download and setup now works properly"

This reverts commit 8e6bd56043.
This commit is contained in:
mcored 2014-05-12 06:13:22 +08:00
parent 31053f5cc2
commit 914cbde3f6
11 changed files with 31 additions and 32 deletions

View file

@ -221,6 +221,16 @@ public enum BorderType
Inside
}
public enum ScreenRecordOutput
{
[Description("FFmpeg")]
FFmpeg,
[Description("Video Compression Manager (VCM)")]
AVI,
[Description("Animated GIF")]
GIF
}
public enum DownloaderFormStatus
{
Waiting,

View file

@ -47,16 +47,6 @@ public enum NodePosition
Left
}
public enum ScreenRecordOutput
{
[Description("FFmpeg")]
FFmpeg,
[Description("Video Compression Manager (VCM)")]
AVI,
[Description("Animated GIF")]
GIF
}
public enum FFmpegVideoCodec
{
[Description("x264")]

View file

@ -45,6 +45,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AsyncBridge.Net35.0.2.0\lib\net35-Client\AsyncBridge.Net35.dll</HintPath>
</Reference>
<Reference Include="SevenZipSharp">
<HintPath>..\packages\SevenZipSharp.0.64\lib\SevenZipSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
@ -59,6 +62,12 @@
<ItemGroup>
<Compile Include="Enums.cs" />
<Compile Include="Screencast\FFmpegHelper.cs" />
<Compile Include="Screencast\FFmpegOptionsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Screencast\FFmpegOptionsForm.Designer.cs">
<DependentUpon>FFmpegOptionsForm.cs</DependentUpon>
</Compile>
<Compile Include="Screencast\ScreencastOptions.cs" />
<Compile Include="Screencast\AviWriter.cs" />
<Compile Include="Forms\RectangleLight.cs">
@ -136,6 +145,9 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Screencast\FFmpegOptionsForm.resx">
<DependentUpon>FFmpegOptionsForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View file

@ -1,4 +1,4 @@
namespace ShareX
namespace ScreenCaptureLib
{
partial class FFmpegOptionsForm
{

View file

@ -24,7 +24,6 @@ You should have received a copy of the GNU General Public License
#endregion License Information (GPL v3)
using HelpersLib;
using ScreenCaptureLib;
using SevenZip;
using System;
using System.Collections.Generic;
@ -37,7 +36,7 @@ You should have received a copy of the GNU General Public License
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace ShareX
namespace ScreenCaptureLib
{
public partial class FFmpegOptionsForm : Form
{
@ -87,9 +86,10 @@ private void LoadSettings()
textBoxUserArgs.Text = Options.FFmpeg.UserArgs;
textBoxUserArgs.TextChanged += (sender, e) => UpdateUI();
if (!File.Exists(Options.FFmpeg.CLIPath) && File.Exists(Program.Settings.FFmpegPath))
string cli = "ffmpeg.exe";
if (string.IsNullOrEmpty(Options.FFmpeg.CLIPath) && File.Exists(cli))
{
Options.FFmpeg.CLIPath = Program.Settings.FFmpegPath;
Options.FFmpeg.CLIPath = cli;
}
textBoxFFmpegPath.Text = Options.FFmpeg.CLIPath;
@ -171,13 +171,12 @@ public static string FFmpegDownloadLink
private void form_InstallRequested(string filePath)
{
string extractPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
string extractPath = Options.FFmpeg.CLIPath;
bool result = ExtractFFmpeg(filePath, extractPath);
if (result)
{
this.InvokeSafe(() => textBoxFFmpegPath.Text = extractPath);
Options.FFmpeg.CLIPath = extractPath;
MessageBox.Show("FFmpeg successfully downloaded.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AsyncBridge.Net35" version="0.2.0" targetFramework="net35" />
<package id="SevenZipSharp" version="0.64" targetFramework="net35" />
<package id="TaskParallelLibrary" version="1.0.2856.0" targetFramework="net35" />
</packages>

View file

@ -73,7 +73,6 @@ public ApplicationConfig()
public bool UseCustomScreenshotsPath = false;
public string CustomScreenshotsPath = string.Empty;
public string SaveImageSubFolderPattern = "%y-%mo";
public string FFmpegPath = "ffmpeg.exe";
#endregion Paths

View file

@ -104,6 +104,8 @@ public async void StartRecording(TaskSettings TaskSettings)
if (MessageBox.Show(TaskSettings.CaptureSettings.FFmpegOptions.CLIPath + " does not exist." + Environment.NewLine + Environment.NewLine + "Would you like to automatically download it?",
Application.ProductName + " - Missing ffmpeg.exe", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
TaskSettings.CaptureSettings.FFmpegOptions.CLIPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
using (FFmpegOptionsForm form = new FFmpegOptionsForm(TaskSettings.CaptureSettings.FFmpegOptions))
{
if (form.DownloadFFmpeg(false) == DialogResult.Cancel)

View file

@ -77,10 +77,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SevenZipSharp, Version=0.64.3890.29348, Culture=neutral, PublicKeyToken=20de82c62b055c88, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SevenZipSharp.0.64\lib\SevenZipSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@ -98,12 +94,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\FFmpegOptionsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FFmpegOptionsForm.Designer.cs">
<DependentUpon>FFmpegOptionsForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\ClipboardFormatForm.cs">
<SubType>Form</SubType>
</Compile>
@ -250,9 +240,6 @@
<Compile Include="WatchFolder.cs" />
<Compile Include="WatchFolderManager.cs" />
<Compile Include="WatchFolderSettings.cs" />
<EmbeddedResource Include="Forms\FFmpegOptionsForm.resx">
<DependentUpon>FFmpegOptionsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\AboutForm.resx">
<DependentUpon>AboutForm.cs</DependentUpon>
<SubType>Designer</SubType>

View file

@ -3,6 +3,5 @@
<package id="AsyncBridge.Net35" version="0.2.0" targetFramework="net35" />
<package id="MegaApiClient" version="1.0.4" targetFramework="net35" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net35" />
<package id="SevenZipSharp" version="0.64" targetFramework="net35" />
<package id="TaskParallelLibrary" version="1.0.2856.0" targetFramework="net35" />
</packages>