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

  1. Use Options > Extras to download ffmpeg.exe into %ProgramData%\ScreenToGif\, or set FfmpegLocation manually.
  2. Place ffmpeg.exe next to ScreenToGif.exe or add its folder to PATH.
  3. Allow the ffmpeg through antivirus / restore from quarantine.
  4. 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

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


AI-assisted analysis of NickeManarin/ScreenToGif@a4d0a67c21 (2026-08-13). Data as JSON: /api/errors/8571bf9bd1db3557. Report an issue: GitHub.