{"record":{"id":"c46987c9f8b07550","repo":"remotion-dev/remotion","slug":"no-frame-found-at-position-for-source-origi","errorCode":null,"errorMessage":"No frame found at position {} for source {} (original source = {}). See https://remotion.dev/docs/troubleshooting/no-frame-found-at-position for troubleshooting help.","messagePattern":"No frame found at position (.+?) for source (.+?) \\(original source = (.+?)\\)\\. See https://remotion\\.dev/docs/troubleshooting/no-frame-found-at-position for troubleshooting help\\.","errorType":"exception","errorClass":"ErrorWithBacktrace","httpStatus":null,"severity":"error","filePath":"packages/compositor/rust/opened_stream.rs","lineNumber":506,"sourceCode":"                    }\n                }\n            }\n        }\n\n        // Allow a lot of threshold here, because otherwise we would crash.\n        // Better to have a frame with a lot of deviation than to crash.\n        let final_frame = frame_cache_manager.get_cache_item_id(\n            &self.src,\n            &self.original_src,\n            self.transparent,\n            tone_mapped,\n            target_position,\n            1000000000,\n            true,\n        )?;\n\n        if final_frame.is_none() {\n            return Err(std::io::Error::new(\n                ErrorKind::Other,\n                format!(\n                    \"No frame found at position {} for source {} (original source = {}). See https://remotion.dev/docs/troubleshooting/no-frame-found-at-position for troubleshooting help.\",\n                    target_position, self.src, self.original_src\n                ),\n            ))?;\n        }\n\n        return Ok(final_frame.unwrap());\n    }\n}\n\npub fn calculate_display_video_size(\n    dar_x: i32,\n    dar_y: i32,\n    sar_x: i32,\n    sar_y: i32,\n    x: u32,","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/compositor/rust/opened_stream.rs#L488-L524","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm the media duration covers the requested time using `ffprobe -show_format <src>`.","Re-encode the source to constant frame rate with frequent keyframes (e.g. `-g 30`) so every position is reachable.","Ensure the file is fully downloaded/available before rendering; re-fetch if truncated.","See https://remotion.dev/docs/troubleshooting/no-frame-found-at-position for the full checklist."],"exampleFix":"// before\n<OffthreadVideo src={url} />\n// rendering fails at frame N near end of media\n\n// after: re-encode to CFR with keyframes\n// $ ffmpeg -i in.mp4 -c:v libx264 -preset fast -crf 18 -g 30 -keyint_min 30 -sc_threshold 0 -c:a aac out.mp4","handlingStrategy":"validation","validationCode":"// ensure target_position is within media duration before decoding\nconst durationSec = await getDuration(src);\nif (targetPosition / 1_000_000 > durationSec + 0.5) {\n  throw new Error(`Requested position past media duration (${durationSec}s)`);\n}","typeGuard":"null","tryCatchPattern":"try { frame = stream.get_frame(pos)?; }\ncatch { /* fallback: use last decoded frame or nearest keyframe */ }","preventionTips":["Re-encode VFR sources to constant frame rate with frequent keyframes (-g 30).","Verify the file is fully downloaded before rendering.","Keep target positions within the probed duration."],"tags":["rust","ffmpeg","video-decode","seek","vfr","corrupt-media"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}