From a36287329e066c1f5793c0db0a1e36a27728d5bb Mon Sep 17 00:00:00 2001 From: Pepijn Date: Tue, 28 Apr 2026 14:21:38 +0200 Subject: [PATCH] fix(annotate): tolerate decoder returning fewer frames than requested pyav (and sometimes torchcodec) decode can return fewer frames than requested timestamps when some timestamps fall outside the video file's content range. Drop the strict=True on the zip and rely on the None-filter to discard missing frames. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lerobot/annotations/steerable_pipeline/frames.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lerobot/annotations/steerable_pipeline/frames.py b/src/lerobot/annotations/steerable_pipeline/frames.py index 79ef5f3ed..9540635bd 100644 --- a/src/lerobot/annotations/steerable_pipeline/frames.py +++ b/src/lerobot/annotations/steerable_pipeline/frames.py @@ -109,7 +109,10 @@ class VideoFrameProvider: if misses: decoded = self._decode(record.episode_index, misses) - for i, img in zip(miss_indices, decoded, strict=True): + # decoder may return fewer frames than requested when some + # timestamps fall outside the video; pair what we have and + # leave the rest as None to be filtered below. + for i, img in zip(miss_indices, decoded): out[i] = img key = (record.episode_index, round(float(timestamps[i]), 6)) if len(self._cache) >= self.cache_size: