{"record":{"id":"aa95d849dfcdf318","repo":"MathewSachin/Captura","slug":"ffmpeg-could-not-be-found-please-download-using-t-aa95d8","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/Video/FFmpegVideoWriter.cs","lineNumber":36,"sourceCode":"        readonly NamedPipeServerStream _ffmpegIn;\n        byte[] _videoBuffer;\n\n        // This semaphore helps prevent FFmpeg audio/video pipes getting deadlocked.\n        readonly SemaphoreSlim _spVideo = new SemaphoreSlim(5);\n\n        // Timeout used with Semaphores, if elapsed would mean FFmpeg might be deadlocked.\n        readonly TimeSpan _spTimeout = TimeSpan.FromMilliseconds(50);\n\n        static string GetPipeName() => $\"captura-{Guid.NewGuid()}\";\n\n        /// <summary>\n        /// Creates a new instance of <see cref=\"FFmpegWriter\"/>.\n        /// </summary>\n        public FFmpegWriter(FFmpegVideoWriterArgs Args)\n        {\n            if (!FFmpegService.FFmpegExists)\n            {\n                throw new FFmpegNotFoundException();\n            }\n\n            var nv12 = Args.ImageProvider.DummyFrame is INV12Frame;\n\n            var settings = ServiceProvider.Get<FFmpegSettings>();\n\n            var w = Args.ImageProvider.Width;\n            var h = Args.ImageProvider.Height;\n\n            _videoBuffer = new byte[(int)(w * h * (nv12 ? 1.5 : 4))];\n\n            Console.WriteLine($\"Video Buffer Allocated: {_videoBuffer.Length}\");\n\n            var videoPipeName = GetPipeName();\n\n            var argsBuilder = new FFmpegArgsBuilder();\n\n            argsBuilder.AddInputPipe(videoPipeName)","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/MathewSachin/Captura/blob/3fdf41529bf4d50cd7a85aedd856f30e34279a47/src/Captura.FFmpeg/Video/FFmpegVideoWriter.cs#L18-L54","documentation":"Thrown by the FFmpegWriter constructor (src/Captura.FFmpeg/Video/FFmpegVideoWriter.cs:36) when FFmpegService.FFmpegExists is false. The live video writer must spawn ffmpeg before creating its named pipes, so it refuses construction without the binary.","triggerScenarios":"Constructing FFmpegWriter (the live recording writer) when FFmpegService.FFmpegExists is false. This is the start-of-recording path, so it fails before any pipe or process is created.","commonSituations":"User hits Record on a fresh install with no ffmpeg downloaded; the FFmpeg folder setting points at a removed directory; ffmpeg.exe deleted by AV or cleanup.","solutions":["Guarantee FFmpegService.FFmpegExists is true before enabling the Record button (run the downloader otherwise).","Verify FFmpegSettings.GetFolderPath() resolves to a real ffmpeg.exe.","Place ffmpeg.exe in the app or lib directory as a fallback."],"exampleFix":"// before\nvar writer = new FFmpegWriter(args);\n// after\nif (!FFmpegService.FFmpegExists)\n    throw new FFmpegNotFoundException();\nvar writer = new FFmpegWriter(args);","handlingStrategy":"validation","validationCode":"// gate the Record button\nrecordButton.Enabled = FFmpegService.FFmpegExists;\n// and at construction time\nif (!FFmpegService.FFmpegExists) throw new FFmpegNotFoundException();","typeGuard":"static FFmpegWriter CreateOrThrow(FFmpegVideoWriterArgs args)\n    => FFmpegService.FFmpegExists ? new FFmpegWriter(args) : throw new FFmpegNotFoundException();","tryCatchPattern":"try { var w = new FFmpegWriter(args); }\ncatch (FFmpegNotFoundException) { /* run downloader, do not retry blindly */ }","preventionTips":["Block recording until FFmpegService.FFmpegExists is true.","Auto-download ffmpeg on first launch.","Re-check existence right before constructing the writer (path may have changed)."],"tags":["ffmpeg","configuration","dependency-missing","recording","csharp"],"backgroundTag":null,"analyzedSha":"3fdf41529bf4d50cd7a85aedd856f30e34279a47","analyzedAt":"2026-08-13T19:35:27.486Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}