mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Save GIF palette to Tools folder instead of near FFmpeg.exe
This commit is contained in:
parent
4a965181b4
commit
88d362383a
3 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue