{"record":{"id":"9d33d0ddcfdc26f7","repo":"SubtitleEdit/subtitleedit","slug":"no-frames-were-extracted-from-the-video-see-log","errorCode":null,"errorMessage":"No frames were extracted from the video - see log for the ffmpeg command line.","messagePattern":"No frames were extracted from the video - see log for the ffmpeg command line\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/VideoOcr/VideoOcrViewModel.cs","lineNumber":679,"sourceCode":"        _cancellationTokenSource = new CancellationTokenSource();\n        var cancellationToken = _cancellationTokenSource.Token;\n\n        IsRunning = true;\n        IsOkEnabled = false;\n        ProgressValue = 0;\n        Lines.Clear();\n\n        var framesFolder = Path.Combine(Path.GetTempPath(), \"se_video_ocr_\" + Guid.NewGuid());\n        Directory.CreateDirectory(framesFolder);\n\n        try\n        {\n            await ExtractFrames(framesFolder, cancellationToken);\n\n            var frameFileNames = Directory.GetFiles(framesFolder, \"*.jpg\").OrderBy(p => p, StringComparer.Ordinal).ToList();\n            if (frameFileNames.Count == 0)\n            {\n                throw new Exception(\"No frames were extracted from the video - see log for the ffmpeg command line.\");\n            }\n\n            var lastAnalyzeUpdate = 0L;\n            var groups = await Task.Run(() => VideoOcrFrameGrouper.Group(\n                frameFileNames,\n                BrightnessMinimum,\n                Se.Settings.Video.VideoOcr.ImageSimilarityPercent,\n                (current, total) =>\n                {\n                    var now = Environment.TickCount64;\n                    if (now - lastAnalyzeUpdate > 200 || current == total)\n                    {\n                        lastAnalyzeUpdate = now;\n                        Dispatcher.UIThread.Post(() =>\n                        {\n                            ProgressText = string.Format(Se.Language.Video.VideoOcr.AnalyzingFramesXY, current, total);\n                            ProgressValue = total == 0 ? 0 : current * 100.0 / total;\n                        });","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/VideoOcr/VideoOcrViewModel.cs#L661-L697","documentation":"Thrown in VideoOcrViewModel.StartOcr after ExtractFrames runs ffmpeg to dump JPEGs into the temp frames folder: Directory.GetFiles returned zero *.jpg files, so the whole-video extraction produced nothing. Like 304 the actionable detail is the ffmpeg command line in the tools log. This blocks the entire OCR scan before grouping/OCR even begins.","triggerScenarios":"ffmpeg batch extraction failed or wrote no JPGs: corrupt/unsupported source, an invalid extraction range/fps, ffmpeg not found, the temp frames folder was cleaned mid-run, or a crop/scale filter rejected by ffmpeg.","commonSituations":"Corrupt source video; ffmpeg missing from PATH/tools folder; user pointed OCR at an audio-only or unsupported container; antivirus deleting the extracted frames; disk full in temp.","solutions":["Read the tools log for the ExtractFrames ffmpeg command and run it manually to capture stderr.","Verify the source opens in ffprobe and is a real video stream (not audio-only).","Ensure ffmpeg is installed/runnable and the temp folder has free disk space.","Confirm the extraction fps/range settings produce frames (e.g. FramesPerStep > 0, in-range start/end)."],"exampleFix":"// before\nawait ExtractFrames(framesFolder, cancellationToken);\nvar frameFileNames = Directory.GetFiles(framesFolder, \"*.jpg\").OrderBy(p => p, StringComparer.Ordinal).ToList();\nif (frameFileNames.Count == 0)\n    throw new Exception(\"No frames were extracted from the video - see log for the ffmpeg command line.\");\n\n// after - validate the source is decodable first, name ffmpeg's failure\nif (!await FfmpeWrapper.CanDecode(_videoFileName))\n    throw new Exception(\"Source video could not be decoded by ffmpeg - see log.\");\nawait ExtractFrames(framesFolder, cancellationToken);\nvar frameFileNames = Directory.GetFiles(framesFolder, \"*.jpg\").OrderBy(p => p, StringComparer.Ordinal).ToList();\nif (frameFileNames.Count == 0)\n    throw new Exception($\"No frames were extracted (ffmpeg exit {_ffmpegExitCode}) - see log for the command line.\");","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(_videoFileName) || VideoWidth <= 0) return;\nif (!await FfmpegWrapper.CanDecode(_videoFileName))\n    throw new Exception(\"Source video cannot be decoded by ffmpeg.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await ExtractFrames(framesFolder, cancellationToken);\n    var frameFileNames = Directory.GetFiles(framesFolder, \"*.jpg\");\n    if (frameFileNames.Length == 0) throw new Exception(\"No frames extracted - see log.\");\n}\ncatch (Exception ex) { SeLogger.Error(ex, \"Video OCR extraction failed\"); /* show message */ }","preventionTips":["ffprobe the source to confirm it has a decodable video stream before OCR.","Ensure temp disk space for the extracted frames.","Log the ffmpeg command line and exit code on failure."],"tags":["ffmpeg","video-ocr","frame-extraction","ocr"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}