Save GIF palette to Tools folder instead of near FFmpeg.exe

This commit is contained in:
Jaex 2017-12-05 10:27:17 +03:00
parent 4a965181b4
commit 88d362383a
3 changed files with 6 additions and 5 deletions

View file

@ -92,11 +92,11 @@ protected void OnRecordingStarted()
}
}
public bool EncodeGIF(string input, string output)
public bool EncodeGIF(string input, string output, string tempFolder)
{
bool result;
string palettePath = Path.Combine(Path.GetDirectoryName(Options.FFmpeg.FFmpegPath), "palette.png");
string palettePath = Path.Combine(tempFolder, "FFmpeg-palette.png");
try
{

View file

@ -230,10 +230,11 @@ public void SaveAsGIF(string path, GIFQuality quality)
}
}
public bool FFmpegEncodeAsGIF(string sourceFilePath, string targetFilePath)
public bool FFmpegEncodeAsGIF(string sourceFilePath, string targetFilePath, string tempFolder)
{
Helpers.CreateDirectoryFromFilePath(targetFilePath);
return ffmpegCli.EncodeGIF(sourceFilePath, targetFilePath);
Helpers.CreateDirectoryFromDirectoryPath(tempFolder);
return ffmpegCli.EncodeGIF(sourceFilePath, targetFilePath, tempFolder);
}
public void EncodeUsingCommandLine(VideoEncoder encoder, string sourceFilePath, string targetFilePath)

View file

@ -257,7 +257,7 @@ private static void StartRecording(ScreenRecordOutput outputType, TaskSettings t
if (outputType == ScreenRecordOutput.GIF)
{
path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, "gif"));
screenRecorder.FFmpegEncodeAsGIF(sourceFilePath, path);
screenRecorder.FFmpegEncodeAsGIF(sourceFilePath, path, Program.ToolsFolder);
}
if (taskSettings.CaptureSettings.RunScreencastCLI)