Consolidate addstream to solve issue 1064#1240
Draft
zy1git wants to merge 2 commits intometa-pytorch:mainfrom
Draft
Consolidate addstream to solve issue 1064#1240zy1git wants to merge 2 commits intometa-pytorch:mainfrom
zy1git wants to merge 2 commits intometa-pytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1240
Note: Links to docs will display an error until the docs builds have been completed. ❌ 27 New FailuresAs of commit 649bf41 with merge base 85d1dad ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
zy1git
commented
Feb 13, 2026
Comment on lines
+64
to
+70
| # Use consolidated function that creates decoder and adds audio stream in one call | ||
| self._decoder = create_audio_decoder( | ||
| source=source, | ||
| seek_mode="approximate", | ||
| stream_index=stream_index, | ||
| sample_rate=sample_rate, | ||
| num_channels=num_channels, |
Author
There was a problem hiding this comment.
Here is to combine create decoder and add stream into one call.
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 commit consolidates the two-step API (create decoder + add audio stream) into a single constructor call for AudioDecoder. Previously, creating an AudioDecoder required two separate C++ calls: first creating the decoder, then adding the audio stream. Now this is done in one consolidated operation.
As for the video decoder, we need to get
metadata(to obtain height and width) and computetransform_specsusingmetadata.heightandmetadata.widthbetween the create decoder and add audio stream ( see this code chunk), so it is hard to implement. Will continue implementing that.Please correct me if I misunderstand anything.