Skip to content

Decode timestamp batches without frame index conversion - #1629

Draft
mavenlin wants to merge 5 commits into
meta-pytorch:mainfrom
mavenlin:agent/vfr-timestamp-batches-review
Draft

Decode timestamp batches without frame index conversion#1629
mavenlin wants to merge 5 commits into
meta-pytorch:mainfrom
mavenlin:agent/vfr-timestamp-batches-review

Conversation

@mavenlin

@mavenlin mavenlin commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

get_frames_played_at currently converts timestamps to indices before decoding. That assumes a single global timestamp-to-index mapping, which is not valid for VFR video. The singular get_frame_played_at already seeks and decodes by requested timestamp; batch lookup should match it.

@pytorch-bot

pytorch-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1629

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 14, 2026
@mavenlin
mavenlin force-pushed the agent/vfr-timestamp-batches-review branch 5 times, most recently from 9199278 to 38d9948 Compare August 14, 2026 08:27
@mavenlin
mavenlin marked this pull request as ready for review August 14, 2026 08:31
@mavenlin
mavenlin marked this pull request as draft August 14, 2026 08:56
@mavenlin
mavenlin force-pushed the agent/vfr-timestamp-batches-review branch from 38d9948 to a581f06 Compare August 14, 2026 09:10
@mavenlin

Copy link
Copy Markdown
Contributor Author

Sharing some tests, I compare the approximate mode with the exact mode, and the new code after this PR is better in the alignment with the exact mode.

Tested on a sampled set of videos from diverse sources. The 4/5 columns reports the number of frames that differs from the exact mode.

dataset videos frames old code new code
dataset_01 200 17,202 273 0
dataset_02 10 749 214 0
dataset_03 200 13,983 256 0
dataset_04 200 25,199 206 0
dataset_05 200 16,901 448 0
dataset_06 200 14,984 201 0
dataset_07 102 5,598 682 0
dataset_08 200 17,556 256 0
dataset_09 200 15,979 233 0
dataset_10 200 17,902 351 0
dataset_11 200 21,600 427 0
dataset_12 200 20,043 247 0
dataset_13 200 13,551 314 0
dataset_14 200 12,805 255 0
dataset_15 200 25,555 6,398 0
dataset_16 200 13,662 851 0
dataset_17 200 18,109 1,461 0
dataset_18 200 16,961 404 0
dataset_19 200 20,901 724 0
dataset_20 200 22,690 0 0
dataset_21 200 24,441 934 0
dataset_22 200 14,807 1,209 1
dataset_23 200 7,454 56 0
dataset_24 200 17,940 544 0
TOTAL 4,512 396,572 16,944 1

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

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant