[BC-Breaking] Change streaming decoding to return Iterator instead#1280
Merged
meta-codesync[bot] merged 1 commit intomainfrom Jan 29, 2026
Merged
[BC-Breaking] Change streaming decoding to return Iterator instead#1280meta-codesync[bot] merged 1 commit intomainfrom
meta-codesync[bot] merged 1 commit intomainfrom
Conversation
|
@moto-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90396373. |
d99cebf to
c0cf952
Compare
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 28, 2026
Summary: X-link: facebookexternal/Legion#3 Context: In #1264, the C++ Generator has been fixed and now we can bind the Generator object to Python, which allows to create Python Iterator object out of C++ Generator. This makes the implementation of streaming decoding simpler and more aligned with how the underlying FFmpeg decoders work. With #1268 and #1271, we adopted to NVDEC decoder, which in turn allowed to batch allocate the memory for decoded buffers, improving the performance This commit applies the similar approach to software decoder. Although the memory allocation for the decoded frame is controlled by FFmpeg, so we don't have the same benefit as the case of NVDEC. However, the resulting change in the user-facing interface "Optional[Frame]" -> "Iterator[Frame]" makes the handling of decoded frames less awkward as it naturally handles the case where the feeding the next packets or flushing will generate multiple batches of frames. Reviewed By: vbourgin Differential Revision: D90396373
c0cf952 to
ccaa56f
Compare
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 28, 2026
Summary: X-link: facebookexternal/Legion#3 Context: In #1264, the C++ Generator has been fixed and now we can bind the Generator object to Python, which allows to create Python Iterator object out of C++ Generator. This makes the implementation of streaming decoding simpler and more aligned with how the underlying FFmpeg decoders work. With #1268 and #1271, we adopted to NVDEC decoder, which in turn allowed to batch allocate the memory for decoded buffers, improving the performance This commit applies the similar approach to software decoder. Although the memory allocation for the decoded frame is controlled by FFmpeg, so we don't have the same benefit as the case of NVDEC. However, the resulting change in the user-facing interface "Optional[Frame]" -> "Iterator[Frame]" makes the handling of decoded frames less awkward as it naturally handles the case where the feeding the next packets or flushing will generate multiple batches of frames. Reviewed By: vbourgin Differential Revision: D90396373
ccaa56f to
93b952b
Compare
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 29, 2026
Summary: X-link: facebookexternal/Legion#3 Context: In #1264, the C++ Generator has been fixed and now we can bind the Generator object to Python, which allows to create Python Iterator object out of C++ Generator. This makes the implementation of streaming decoding simpler and more aligned with how the underlying FFmpeg decoders work. With #1268 and #1271, we adopted to NVDEC decoder, which in turn allowed to batch allocate the memory for decoded buffers, improving the performance This commit applies the similar approach to software decoder. Although the memory allocation for the decoded frame is controlled by FFmpeg, so we don't have the same benefit as the case of NVDEC. However, the resulting change in the user-facing interface "Optional[Frame]" -> "Iterator[Frame]" makes the handling of decoded frames less awkward as it naturally handles the case where the feeding the next packets or flushing will generate multiple batches of frames. Reviewed By: vbourgin Differential Revision: D90396373
93b952b to
ae23679
Compare
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 29, 2026
Summary: X-link: facebookexternal/Legion#3 Context: In #1264, the C++ Generator has been fixed and now we can bind the Generator object to Python, which allows to create Python Iterator object out of C++ Generator. This makes the implementation of streaming decoding simpler and more aligned with how the underlying FFmpeg decoders work. With #1268 and #1271, we adopted to NVDEC decoder, which in turn allowed to batch allocate the memory for decoded buffers, improving the performance This commit applies the similar approach to software decoder. Although the memory allocation for the decoded frame is controlled by FFmpeg, so we don't have the same benefit as the case of NVDEC. However, the resulting change in the user-facing interface "Optional[Frame]" -> "Iterator[Frame]" makes the handling of decoded frames less awkward as it naturally handles the case where the feeding the next packets or flushing will generate multiple batches of frames. Reviewed By: vbourgin Differential Revision: D90396373
ae23679 to
6f36b40
Compare
Summary: X-link: facebookexternal/Legion#3 Context: In #1264, the C++ Generator has been fixed and now we can bind the Generator object to Python, which allows to create Python Iterator object out of C++ Generator. This makes the implementation of streaming decoding simpler and more aligned with how the underlying FFmpeg decoders work. With #1268 and #1271, we adopted to NVDEC decoder, which in turn allowed to batch allocate the memory for decoded buffers, improving the performance This commit applies the similar approach to software decoder. Although the memory allocation for the decoded frame is controlled by FFmpeg, so we don't have the same benefit as the case of NVDEC. However, the resulting change in the user-facing interface "Optional[Frame]" -> "Iterator[Frame]" makes the handling of decoded frames less awkward as it naturally handles the case where the feeding the next packets or flushing will generate multiple batches of frames. Reviewed By: vbourgin Differential Revision: D90396373
6f36b40 to
2916a79
Compare
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.
Summary:
Context:
In #1264, the C++ Generator has been fixed and now we can bind the Generator object to Python, which allows to create Python Iterator object out of C++ Generator.
This makes the implementation of streaming decoding simpler and more aligned with how the underlying FFmpeg decoders work.
With #1268 and #1271, we adopted to NVDEC decoder, which in turn allowed to batch allocate the memory for decoded buffers, improving the performance
This commit applies the similar approach to software decoder. Although the memory allocation for the decoded frame is controlled by FFmpeg, so we don't have the same benefit as the case of NVDEC.
However, the resulting change in the user-facing interface "Optional[Frame]" -> "Iterator[Frame]" makes the handling of decoded frames less awkward as it naturally handles the case where the feeding the next packets or flushing will generate multiple batches of frames.
Differential Revision: D90396373