{"record":{"id":"601fb55067cf2066","repo":"MathewSachin/Captura","slug":"ffmpeg-could-not-be-found-please-download-using-t","errorCode":null,"errorMessage":"FFmpeg could not be found. Please download using the in-built downloader.","messagePattern":"FFmpeg could not be found\\. Please download using the in-built downloader\\.","errorType":"exception","errorClass":"FFmpegNotFoundException","httpStatus":null,"severity":"error","filePath":"src/Captura.FFmpeg/Audio/FFmpegAudioWriter.cs","lineNumber":16,"sourceCode":"﻿using Captura.Audio;\nusing System.Diagnostics;\nusing System.IO;\n\nnamespace Captura.FFmpeg\n{\n    class FFmpegAudioWriter : IAudioFileWriter\n    {\n        readonly Process _ffmpegProcess;\n        readonly Stream _ffmpegIn;\n        \n        public FFmpegAudioWriter(string FileName, int AudioQuality, FFmpegAudioArgsProvider AudioArgsProvider, int Frequency = 44100, int Channels = 2)\n        {\n            if (!FFmpegService.FFmpegExists)\n            {\n                throw new FFmpegNotFoundException();\n            }\n\n            var argsBuilder  = new FFmpegArgsBuilder();\n\n            argsBuilder.AddStdIn()\n                .SetFormat(\"s16le\")\n                .SetAudioCodec(\"pcm_s16le\")\n                .SetAudioFrequency(Frequency)\n                .SetAudioChannels(Channels)\n                .DisableVideo();\n\n            var output = argsBuilder.AddOutputFile(FileName);\n\n            AudioArgsProvider(AudioQuality, output);\n\n            _ffmpegProcess = FFmpegService.StartFFmpeg(argsBuilder.GetArgs(), FileName, out _);\n            \n            _ffmpegIn = _ffmpegProcess.StandardInput.BaseStream;","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/MathewSachin/Captura/blob/3fdf41529bf4d50cd7a85aedd856f30e34279a47/src/Captura.FFmpeg/Audio/FFmpegAudioWriter.cs#L1-L34","documentation":"Thrown by the FFmpegAudioWriter constructor (src/Captura.FFmpeg/Audio/FFmpegAudioWriter.cs:16) when FFmpegService.FFmpegExists is false. FFmpegExists (src/Captura.FFmpeg/FFmpegService.cs:14-47) probes the configured folder, the app/lib directories, and finally runs `ffmpeg.exe -version` off PATH. Captura ships without an ffmpeg binary, so the encoder pipeline cannot start until one is present.","triggerScenarios":"Constructing FFmpegAudioWriter while no ffmpeg.exe exists in the settings folder, AppDir, LibDir, or PATH. FFmpegExists returning false (the PATH probe throws and is swallowed) is the sole trigger.","commonSituations":"First run of Captura before the built-in downloader has run; a user pointed the FFmpeg folder setting at the wrong directory; ffmpeg was uninstalled or the PATH entry removed; the folder setting holds a stale path from a portable install.","solutions":["Run the in-built FFmpeg downloader (DownloadFFmpeg) so ffmpeg.exe lands in the configured folder before any recording.","Verify FFmpegSettings.GetFolderPath() points at a directory that actually contains ffmpeg.exe.","Place ffmpeg.exe in the application or lib directory as a fallback.","Add the folder containing ffmpeg.exe to the system PATH as a last resort."],"exampleFix":"// before\nvar writer = new FFmpegAudioWriter(fileName, quality, argsProvider);\n// after\nif (!FFmpegService.FFmpegExists)\n    throw new FFmpegNotFoundException(); // or trigger the downloader UI\nvar writer = new FFmpegAudioWriter(fileName, quality, argsProvider);","handlingStrategy":"validation","validationCode":"// run before constructing FFmpegAudioWriter\nif (!FFmpegService.FFmpegExists)\n{\n    // trigger the in-built downloader, then re-check\n    await DownloadFFmpeg.Run();\n}\nif (!FFmpegService.FFmpegExists)\n    throw new FFmpegNotFoundException();","typeGuard":"// static guarantee: prefer a factory that returns null when absent\nstatic FFmpegAudioWriter CreateOrNull(string file, int q, FFmpegAudioArgsProvider p, int freq = 44100, int ch = 2)\n    => FFmpegService.FFmpegExists ? new FFmpegAudioWriter(file, q, p, freq, ch) : null;","tryCatchPattern":"try { var w = new FFmpegAudioWriter(file, q, provider); }\ncatch (FFmpegNotFoundException) { /* prompt download, do not retry in a loop */ }","preventionTips":["Treat FFmpegService.FFmpegExists as a hard prerequisite: gate the Record/Convert UI behind it.","Run the built-in downloader on first launch and after any settings folder change.","Re-check FFmpegExists after the user edits the FFmpeg folder setting."],"tags":["ffmpeg","configuration","dependency-missing","csharp"],"backgroundTag":null,"analyzedSha":"3fdf41529bf4d50cd7a85aedd856f30e34279a47","analyzedAt":"2026-08-13T19:35:27.486Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}