SubtitleEdit/subtitleedit · error · Exception

No frames were extracted from the video - see log for the…

Error message

No frames were extracted from the video - see log for the ffmpeg command line.

What it means

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.

Solutions

  1. Read the tools log for the ExtractFrames ffmpeg command and run it manually to capture stderr.
  2. Verify the source opens in ffprobe and is a real video stream (not audio-only).
  3. Ensure ffmpeg is installed/runnable and the temp folder has free disk space.
  4. Confirm the extraction fps/range settings produce frames (e.g. FramesPerStep > 0, in-range start/end).

Example fix

// before
await ExtractFrames(framesFolder, cancellationToken);
var frameFileNames = Directory.GetFiles(framesFolder, "*.jpg").OrderBy(p => p, StringComparer.Ordinal).ToList();
if (frameFileNames.Count == 0)
    throw new Exception("No frames were extracted from the video - see log for the ffmpeg command line.");

// after - validate the source is decodable first, name ffmpeg's failure
if (!await FfmpeWrapper.CanDecode(_videoFileName))
    throw new Exception("Source video could not be decoded by ffmpeg - see log.");
await ExtractFrames(framesFolder, cancellationToken);
var frameFileNames = Directory.GetFiles(framesFolder, "*.jpg").OrderBy(p => p, StringComparer.Ordinal).ToList();
if (frameFileNames.Count == 0)
    throw new Exception($"No frames were extracted (ffmpeg exit {_ffmpegExitCode}) - see log for the command line.");
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrEmpty(_videoFileName) || VideoWidth <= 0) return;
if (!await FfmpegWrapper.CanDecode(_videoFileName))
    throw new Exception("Source video cannot be decoded by ffmpeg.");

Try / catch

try
{
    await ExtractFrames(framesFolder, cancellationToken);
    var frameFileNames = Directory.GetFiles(framesFolder, "*.jpg");
    if (frameFileNames.Length == 0) throw new Exception("No frames extracted - see log.");
}
catch (Exception ex) { SeLogger.Error(ex, "Video OCR extraction failed"); /* show message */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/9d33d0ddcfdc26f7. Report an issue: GitHub.

Appendix: source

Thrown at src/ui/Features/Video/VideoOcr/VideoOcrViewModel.cs:679

        _cancellationTokenSource = new CancellationTokenSource();
        var cancellationToken = _cancellationTokenSource.Token;

        IsRunning = true;
        IsOkEnabled = false;
        ProgressValue = 0;
        Lines.Clear();

        var framesFolder = Path.Combine(Path.GetTempPath(), "se_video_ocr_" + Guid.NewGuid());
        Directory.CreateDirectory(framesFolder);

        try
        {
            await ExtractFrames(framesFolder, cancellationToken);

            var frameFileNames = Directory.GetFiles(framesFolder, "*.jpg").OrderBy(p => p, StringComparer.Ordinal).ToList();
            if (frameFileNames.Count == 0)
            {
                throw new Exception("No frames were extracted from the video - see log for the ffmpeg command line.");
            }

            var lastAnalyzeUpdate = 0L;
            var groups = await Task.Run(() => VideoOcrFrameGrouper.Group(
                frameFileNames,
                BrightnessMinimum,
                Se.Settings.Video.VideoOcr.ImageSimilarityPercent,
                (current, total) =>
                {
                    var now = Environment.TickCount64;
                    if (now - lastAnalyzeUpdate > 200 || current == total)
                    {
                        lastAnalyzeUpdate = now;
                        Dispatcher.UIThread.Post(() =>
                        {
                            ProgressText = string.Format(Se.Language.Video.VideoOcr.AnalyzingFramesXY, current, total);
                            ProgressValue = total == 0 ? 0 : current * 100.0 / total;
                        });

View on GitHub (pinned to 17a9f07487)