Skip to content

{Feature} Core - Add random-access P-frame decoding support in ImageSensorPlayer#339

Open
kongchen1992 wants to merge 1 commit intofacebookresearch:mainfrom
kongchen1992:export-D101928539
Open

{Feature} Core - Add random-access P-frame decoding support in ImageSensorPlayer#339
kongchen1992 wants to merge 1 commit intofacebookresearch:mainfrom
kongchen1992:export-D101928539

Conversation

@kongchen1992
Copy link
Copy Markdown
Contributor

Summary:
Adds random-access support for P-frame video streams in VrsDataProvider.

Previously, getImageDataByIndex() only worked correctly for sequential reads or I-frames. Reading a mid-GOP P-frame out of order returned incorrect pixels because the decoder's DPB (Decoded Picture Buffer) lacked the required reference frames.

This adds a recordReadComplete() override in ImageSensorPlayer that detects isMissingFrames() and walks back to the preceding keyframe via readMissingFrames(), then replays through the target frame. The user callback fires exactly once per getImageDataByIndex() call, even when the replay decodes multiple intermediate frames.

Enables random-access video frame retrieval for training data pipelines, video editors, and any workflow that needs non-sequential frame access.

Differential Revision: D101928539

…ensorPlayer

Summary:
Adds random-access support for P-frame video streams in VrsDataProvider.

Previously, getImageDataByIndex() only worked correctly for sequential reads or I-frames. Reading a mid-GOP P-frame out of order returned incorrect pixels because the decoder's DPB (Decoded Picture Buffer) lacked the required reference frames.

This adds a recordReadComplete() override in ImageSensorPlayer that detects isMissingFrames() and walks back to the preceding keyframe via readMissingFrames(), then replays through the target frame. The user callback fires exactly once per getImageDataByIndex() call, even when the replay decodes multiple intermediate frames.

Enables random-access video frame retrieval for training data pipelines, video editors, and any workflow that needs non-sequential frame access.

Differential Revision: D101928539
@meta-cla meta-cla Bot added the cla signed label Apr 22, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 22, 2026

@kongchen1992 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101928539.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant