Repository navigation
Support scan() and seek(0) on streams without timestamps - #1783
Draft
NicolasHug wants to merge 1 commit into
Draft
NicolasHug wants to merge 1 commit into
NicolasHug wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1783
Note: Links to docs will display an error until the docs builds have been completed. ❌ 19 New Failures, 10 Unrelated FailuresAs of commit ba2c9c4 with merge base ffb098a ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
NicolasHug
force-pushed
the
raw-stream-scan
branch
from
October 27, 2026 13:25
2e075f7 to
ba5b3c9
Compare
NicolasHug
force-pushed
the
raw-stream-scan
branch
3 times, most recently
from
October 27, 2026 13:54
536c1bb to
976645b
Compare
NicolasHug
force-pushed
the
raw-stream-scan
branch
from
October 27, 2026 16:32
976645b to
318e318
Compare
Raw H.264 / HEVC elementary streams have no timestamps, so FFmpeg can't seek them to a timestamp. That made VideoStream.scan() fail (it rewinds the demuxer before and after reading the stream), and Demuxer.seek() fail entirely. seek(0) now rewinds such streams by byte offset, so scan() works too. Seeking anywhere else still raises, now with an explanation. A FrameIndex's pts_seconds are NaN for frames without a pts, and index_at() / key_frame_seconds_for() raise on a stream with no timestamps at all. The frame count, durations and keyframe positions (in decoding order) are available. Part of #1771.
NicolasHug
force-pushed
the
raw-stream-scan
branch
from
October 27, 2026 19:04
318e318 to
ba2c9c4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of a stack that adds demuxer-free decoding to the low-level APIs: decoding packets that don't come from a
Demuxer(#1585), demuxing and decoding in different processes, and raw H.264 / HEVC streams (#1771).Raw H.264 / HEVC elementary streams have no timestamps, so FFmpeg can't seek them to a timestamp. That made
VideoStream.scan()fail, because it rewinds the demuxer before and after reading the stream, and madeDemuxer.seek()fail entirely (#1771).seek(0)now rewinds such streams by byte offset, soscan()works too.FrameIndex:pts_secondsisNaNfor frames without a pts.index_at()andkey_frame_seconds_for()raise on a stream with no timestamps at all.VideoDecoderstill doesn't support raw streams: the low-level APIs are where they're handled.Part of #1771.
Tests
scan()on raw H.264 and HEVC streams.Stack created with GitHub Stacks CLI • Give Feedback 💬