remotion-dev/remotion · error · ErrorWithBacktrace

No frame found at position {} for source {} (original source

Error message

No frame found at position {} for source {} (original source = {}). See https://remotion.dev/docs/troubleshooting/no-frame-found-at-position for troubleshooting help.

What it means

Thrown by opened_stream.rs when, after decoding the source with a large tolerance threshold, no decoded frame could be located near the requested target_position. Remotion prefers returning a slightly-off frame over crashing, so this only fires when the cache lookup yields nothing at all.

Source

Thrown at packages/compositor/rust/opened_stream.rs:506

                    }
                }
            }
        }

        // Allow a lot of threshold here, because otherwise we would crash.
        // Better to have a frame with a lot of deviation than to crash.
        let final_frame = frame_cache_manager.get_cache_item_id(
            &self.src,
            &self.original_src,
            self.transparent,
            tone_mapped,
            target_position,
            1000000000,
            true,
        )?;

        if final_frame.is_none() {
            return Err(std::io::Error::new(
                ErrorKind::Other,
                format!(
                    "No frame found at position {} for source {} (original source = {}). See https://remotion.dev/docs/troubleshooting/no-frame-found-at-position for troubleshooting help.",
                    target_position, self.src, self.original_src
                ),
            ))?;
        }

        return Ok(final_frame.unwrap());
    }
}

pub fn calculate_display_video_size(
    dar_x: i32,
    dar_y: i32,
    sar_x: i32,
    sar_y: i32,
    x: u32,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Confirm the media duration covers the requested time using `ffprobe -show_format <src>`.
  2. Re-encode the source to constant frame rate with frequent keyframes (e.g. `-g 30`) so every position is reachable.
  3. Ensure the file is fully downloaded/available before rendering; re-fetch if truncated.
  4. See https://remotion.dev/docs/troubleshooting/no-frame-found-at-position for the full checklist.

Example fix

// before
<OffthreadVideo src={url} />
// rendering fails at frame N near end of media

// after: re-encode to CFR with keyframes
// $ ffmpeg -i in.mp4 -c:v libx264 -preset fast -crf 18 -g 30 -keyint_min 30 -sc_threshold 0 -c:a aac out.mp4
Defensive patterns

Strategy: validation

Validate before calling

// ensure target_position is within media duration before decoding
const durationSec = await getDuration(src);
if (targetPosition / 1_000_000 > durationSec + 0.5) {
  throw new Error(`Requested position past media duration (${durationSec}s)`);
}

Type guard

null

Try / catch

try { frame = stream.get_frame(pos)?; }
catch { /* fallback: use last decoded frame or nearest keyframe */ }

Prevention

When it happens

Trigger: Seeking to a position beyond the media duration, a position inside a gap with no nearby keyframe, a truncated/corrupt file where decoding produced no frames, or a misreported duration/pts that places target_position outside available data.

Common situations: Variable-frame-rate media where pts values are sparse; rendering at a frame index past the true end; source URL that partially downloaded; ffmpeg seek missing the keyframe and the decoder yielding nothing.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/c46987c9f8b07550. Report an issue: GitHub.