MathewSachin/Captura · error · FFmpegNotFoundException

FFmpeg could not be found. Please download using the in-buil

Error message

FFmpeg could not be found. Please download using the in-built downloader.

What it means

Thrown by FFmpegGifConverter.StartAsync (src/Captura.FFmpeg/Video/FFmpegGifConverter.cs:18) when FFmpegService.FFmpegExists is false. Identical guard to the audio writer: the GIF conversion path needs an ffmpeg binary before it can build the palettegen/paletteuse filter graph.

Source

Thrown at src/Captura.FFmpeg/Video/FFmpegGifConverter.cs:18

using System;
using System.Threading.Tasks;
using Captura.Video;

namespace Captura.FFmpeg
{
    // ReSharper disable once InconsistentNaming
    class FFmpegGifConverter : IVideoConverter
    {
        public string Name => "Gif (FFmpeg)";

        public string Extension => ".gif";

        public async Task StartAsync(VideoConverterArgs Args, IProgress<int> Progress)
        {
            if (!FFmpegService.FFmpegExists)
            {
                throw new FFmpegNotFoundException();
            }

            var argsBuilder = new FFmpegArgsBuilder();

            argsBuilder.AddInputFile(Args.InputFile);

            const string filter = "\"[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse\"";

            argsBuilder.AddOutputFile(Args.FileName)
                .AddArg("filter_complex", filter)
                .SetFrameRate(Args.FrameRate);

            var process = FFmpegService.StartFFmpeg(argsBuilder.GetArgs(), Args.FileName, out var log);
            log.ProgressChanged += Progress.Report;

            await Task.Run(() => process.WaitForExit());

            if (process.ExitCode != 0)

View on GitHub (pinned to 3fdf41529b)

Solutions

  1. Download ffmpeg via the in-built downloader before offering the GIF conversion action.
  2. Verify FFmpegSettings.GetFolderPath() resolves to a real ffmpeg.exe.
  3. Place ffmpeg.exe in the app or lib directory as a fallback.

Example fix

// before
await new FFmpegGifConverter().StartAsync(args, progress);
// after
if (!FFmpegService.FFmpegExists)
    await DownloadFFmpeg.Run(); // ensure binary present
await new FFmpegGifConverter().StartAsync(args, progress);
Defensive patterns

Strategy: validation

Validate before calling

if (!FFmpegService.FFmpegExists) await DownloadFFmpeg.Run();
if (!FFmpegService.FFmpegExists) throw new FFmpegNotFoundException();

Try / catch

try { await new FFmpegGifConverter().StartAsync(args, progress); }
catch (FFmpegNotFoundException) { /* run downloader, then offer retry */ }

Prevention

When it happens

Trigger: Invoking the GIF converter before ffmpeg.exe is available in the configured folder, app/lib dir, or PATH (FFmpegService.FFmpegExists returns false).

Common situations: User converts a recording to GIF on a fresh install with no ffmpeg downloaded yet; the FFmpeg folder setting was reset or points at a removed portable folder.

Related errors


AI-assisted analysis of MathewSachin/Captura@3fdf41529b (2026-08-13). Data as JSON: /api/errors/0aa33a8569a6e330. Report an issue: GitHub.