Skip to content

rldb/lance: stream frames from MP4 byte ranges, drop chunk tables - #730

Draft
RyanPCo wants to merge 1 commit into
ryanco/eva-to-lancefrom
ryanco/lance-mp4-ranges
Draft

RyanPCo wants to merge 1 commit into
ryanco/eva-to-lancefrom
ryanco/lance-mp4-ranges

Conversation

@RyanPCo

@RyanPCo RyanPCo commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

LanceStreamingDataset now reads frames straight from the MP4s: each
process reads an MP4's sample table once (one range GET of its moov),
then a batch fetches only the packets its frames need (keyframe through
frame; adjacent with GOP 2) in one concurrent round of range GETs and
decodes them in memory with PyAV. Frames match torchcodec bit for bit.

On R2 with 8 workers this ties the K=8 chunk tables on raw reads (277
vs 276 samples/s steady state) and runs 5-15% behind through the full
loader, with video stored once and nothing for the committer to build.
So video_chunks tables, chunk_videos.py and --chunk-k go. The chunk path
had been broken since leaves were keyed by recording_id (row.episode_hash).

https://claude.ai/code/session_01HjCQBqQCr2igFEMR7yUovw

@RyanPCo
RyanPCo force-pushed the ryanco/eva-to-lance branch from e642184 to bd04b38 Compare October 22, 2026 14:06
@RyanPCo
RyanPCo force-pushed the ryanco/lance-mp4-ranges branch from 8ae0806 to 0b25bc8 Compare October 22, 2026 14:06
@RyanPCo
RyanPCo force-pushed the ryanco/eva-to-lance branch from bd04b38 to 204c215 Compare October 23, 2026 19:28
@RyanPCo
RyanPCo force-pushed the ryanco/lance-mp4-ranges branch from 0b25bc8 to 07c145d Compare October 23, 2026 19:28
@RyanPCo
RyanPCo force-pushed the ryanco/eva-to-lance branch from 204c215 to f5b66c3 Compare October 23, 2026 19:36
@RyanPCo
RyanPCo force-pushed the ryanco/lance-mp4-ranges branch from 07c145d to 12ee83c Compare October 23, 2026 19:36
LanceStreamingDataset now reads frames straight from the MP4s: each
process reads an MP4's sample table once (one range GET of its moov),
then a batch fetches only the packets its frames need (keyframe through
frame; adjacent with GOP 2) in one concurrent round of range GETs and
decodes them in memory with PyAV. Frames match torchcodec bit for bit.

On R2 with 8 workers this ties the K=8 chunk tables on raw reads (277
vs 276 samples/s steady state) and runs 5-15% behind through the full
loader, with video stored once and nothing for the committer to build.
So video_chunks tables, chunk_videos.py and --chunk-k go. The chunk path
had been broken since leaves were keyed by recording_id (row.episode_hash).

Claude-Session: https://claude.ai/code/session_01Kt1E8T2x8kdV9akAvbJyVd
@RyanPCo
RyanPCo force-pushed the ryanco/lance-mp4-ranges branch from 12ee83c to ffa99f1 Compare October 23, 2026 20:03
@RyanPCo
RyanPCo force-pushed the ryanco/eva-to-lance branch from f5b66c3 to ca35d13 Compare October 23, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant