NickeManarin/ScreenToGif · error · ApplicationException
FFmpeg not present.
Error message
FFmpeg not present.
What it means
EncodeWithFfmpeg throws ApplicationException when PathHelper.IsFfmpegPresent() returns false. The check inspects UserSettings.All.FfmpegLocation, the app folder, %ProgramData%\ScreenToGif\ffmpeg.exe, and PATH for ffmpeg.exe; it also calls CheckFfmpegVersion on any candidate. Encoding never starts if no ffmpeg binary resolves.
Source
Thrown at ScreenToGif/Util/EncodingManager.cs:1405
};
await using var stream = File.Create(preset.FullPath, Constants.BufferSize);
await KGySoftGifEncoder.EncodeAnimationAsync(config, stream, new TaskConfig
{
CancellationToken = cancellationToken,
ThrowIfCanceled = false
});
if (!cancellationToken.IsCancellationRequested)
await stream.FlushAsync(cancellationToken);
}
private static async Task EncodeWithFfmpeg(ExportPreset preset, List<IFrame> listFrames, int id, CancellationTokenSource tokenSource, string processing)
{
Update(id, EncodingStatus.Processing, null, true);
if (!await PathHelper.IsFfmpegPresent())
throw new ApplicationException("FFmpeg not present.");
if (File.Exists(preset.FullPath))
File.Delete(preset.FullPath);
#region Generate concat
var concat = new StringBuilder();
foreach (var frame in listFrames)
{
concat.AppendLine("file '" + frame.Path + "'");
concat.AppendLine("duration " + (frame.Delay / 1000d).ToString(CultureInfo.InvariantCulture));
}
if (preset.Type is not ExportFormats.Gif or ExportFormats.Apng or ExportFormats.Webp or ExportFormats.Avif)
{
//Fix for last frame.
concat.AppendLine("file '" + listFrames.LastOrDefault()?.Path + "'");
concat.AppendLine("duration 0");View on GitHub (pinned to a4d0a67c21)
Solutions
- Use Options > Extras to download ffmpeg.exe into %ProgramData%\ScreenToGif\, or set FfmpegLocation manually.
- Place ffmpeg.exe next to ScreenToGif.exe or add its folder to PATH.
- Allow the ffmpeg through antivirus / restore from quarantine.
- Re-verify with await PathHelper.IsFfmpegPresent() in the export panel before enabling FFmpeg-based encoders.
Example fix
// before
if (!await PathHelper.IsFfmpegPresent())
throw new ApplicationException("FFmpeg not present.");
// after
if (!await PathHelper.IsFfmpegPresent())
throw new ApplicationException("FFmpeg not present. Download it via Options > Extras or set the FFmpeg path in Options."); Defensive patterns
Strategy: validation
Validate before calling
if (!await PathHelper.IsFfmpegPresent())
{
// disable FFmpeg-based encoders in the UI and offer download
} Type guard
bool CanUseFfmpegEncoder => PathHelper.IsFfmpegPresent().GetAwaiter().GetResult();
Try / catch
try { await EncodeWithFfmpeg(...); }
catch (ApplicationException ex) when (ex.Message == "FFmpeg not present.")
{ /* open Options > Extras to download ffmpeg */ } Prevention
- Gate FFmpeg encoders behind IsFfmpegPresent() in the export panel.
- On first run, prompt to download ffmpeg into %ProgramData%\ScreenToGif\.
- Persist FfmpegLocation and re-validate after app updates.
When it happens
Trigger: Export uses FFmpeg (most video/gif types) but ffmpeg.exe is missing from the configured location, the app folder, %ProgramData%\ScreenToGif\, and the system PATH.
Common situations: Fresh install without ffmpeg downloaded; user declined the ffmpeg download prompt; ffmpeg.exe deleted by AV or user; FfmpegLocation setting points to a moved file; portable build on a clean machine without PATH; CheckFfmpegVersion crashed silently leaving the binary unset.
Related errors
- Gifski not present.
- Error while encoding the {preset.Type} with FFmpeg.
- Error while encoding the gif with Gifski. Empty output file.
- Error while capturing frames with FFmpeg.
- Missing upload preset called {preset.UploadService}
AI-assisted analysis of NickeManarin/ScreenToGif@a4d0a67c21 (2026-08-13).
Data as JSON: /api/errors/8571bf9bd1db3557.
Report an issue: GitHub.