Skip to content

[format][python] Support large video indexes with paged reads - #10891

Draft
XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/compact-video-keyframe-index
Draft

XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/compact-video-keyframe-index

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Long videos currently lose their generated seek index when they exceed the keyframe limit. Remove that limit and the 16 MiB per-index / 64 MiB per-file limits without loading entire indexes into memory.

  • Write index v2 as 4,096-entry pages with CRC32; read pages on demand with a 1 MiB entry-page cache. Decoder anchors also stay lazy.
  • Generate and rewrite indexes through temporary disk storage; validate copied indexes in bounded chunks in Java and Python.
  • Keep index v1 readable. The outer .video layout is unchanged; v2 indexes require updated readers. Pages use uncompressed int64 triples, trading index size for direct reads. The metadata-range limit is unchanged.

Tests

Python: 74 passed, 19 native-runtime cases skipped. Java: 21 descriptor/format tests and 2 rolling/compaction tests passed.

Covers one million keyframes, indexes above 16 MiB and 64 MiB per file, lazy reads, corruption, failure cleanup, shared Java/Python fixtures, and real indexed video/training reads. Python 3.6 syntax, flake8 and diff checks passed.

@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [format][python] Keep large video keyframe indexes compact [format][python] Support large video indexes with paged reads Oct 30, 2026
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