invoke-ai/InvokeAI · error · ValueError

Video {self.video.video_name} has no decodable frames (probe

Error message

Video {self.video.video_name} has no decodable frames (probed {n_frames}).

What it means

Thrown when the resolved total frame count for the video is <= 0, meaning the file decodes to zero frames. Same guard as the single-frame extractor: the range extractor cannot operate on an empty frame stream.

Source

Thrown at invokeai/app/invocations/video_frame_extract_range.py:156

        le=120,
        description="Output frame rate. 0 = match the source video's frame rate "
        "(falls back to 16 fps if the source rate can't be probed).",
    )

    def invoke(self, context: InvocationContext) -> ExtractVideoRangeOutput:
        video_path = context.videos.get_path(self.video.video_name)
        width, height, duration, source_fps = probe_video(video_path)

        n_frames = decoder_frame_count(video_path)
        if n_frames is None:
            if not source_fps or duration <= 0:
                raise ValueError(
                    f"Cannot determine frame count for {self.video.video_name}: "
                    f"probe returned duration={duration}, fps={source_fps}."
                )
            n_frames = int(round(duration * source_fps))
        if n_frames <= 0:
            raise ValueError(f"Video {self.video.video_name} has no decodable frames (probed {n_frames}).")

        start = self._resolve_index(self.start_frame, n_frames, "start_frame")
        end = self._resolve_index(self.end_frame, n_frames, "end_frame")
        if end < start:
            raise ValueError(
                f"end_frame ({self.end_frame} → {end}) must be >= start_frame "
                f"({self.start_frame} → {start}) after resolving negative indices."
            )

        # Derive the output frame rate from the source video when ``fps`` is 0
        # (the default), so a trimmed clip plays back at the same speed as its
        # source. Fall back to 16 fps (the Wan video default) when the source
        # rate couldn't be probed.
        if self.fps > 0:
            output_fps = float(self.fps)
        elif source_fps and source_fps > 0:
            output_fps = float(source_fps)
        else:

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Confirm the video plays and contains frames
  2. Re-record or re-export the source
  3. Re-mux/re-encode with ffmpeg to repair the container
  4. Remove the empty clip from the pipeline

Example fix

// before
VideoFrameExtractRange(video=aborted_capture, start_frame=0, end_frame=10)  # 0 frames
// after
VideoFrameExtractRange(video=valid_capture, start_frame=0, end_frame=10)
Defensive patterns

Strategy: validation

Validate before calling

n = decoder_frame_count(path)
if n is not None and n <= 0:
    raise ValueError(f'{path} has no decodable frames; remove from pipeline')

Type guard

def is_nonempty_clip(n_frames: int | None) -> bool:
    return n_frames is not None and n_frames > 0

Try / catch

try:
    out = range_extract.invoke(context)
except ValueError as e:
    if 'no decodable frames' in str(e):
        raise RuntimeError(f'{video.video_name} is empty; supply a valid source') from e
    raise

Prevention

When it happens

Trigger: invoke(): decoder_frame_count returns <= 0, or the duration*fps fallback rounds to 0.

Common situations: Empty files; recordings aborted before any frames were written; containers with 0 fps metadata.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/34ab094ebde2f99f. Report an issue: GitHub.