Skip to content

Add filelike support and tests to streaming encoder#1319

Merged
Dan-Flores merged 2 commits intometa-pytorch:mainfrom
Dan-Flores:multistream_enc_filelike
Apr 16, 2026
Merged

Add filelike support and tests to streaming encoder#1319
Dan-Flores merged 2 commits intometa-pytorch:mainfrom
Dan-Flores:multistream_enc_filelike

Conversation

@Dan-Flores
Copy link
Copy Markdown
Contributor

@Dan-Flores Dan-Flores commented Apr 1, 2026

This PR adds a MultiStreamEncoder constructor that accepts an AVIOContextHolder to support writing to a file-like.
Tests are updated to call both create_streaming_encoder_to_file_like and create_streaming_encoder_to_file.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 1, 2026

🔗 Helpful Links

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

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 Apr 1, 2026
@Dan-Flores Dan-Flores marked this pull request as ready for review April 2, 2026 04:32
Copy link
Copy Markdown
Contributor

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Dan-Flores !

Comment thread test/test_ops.py Outdated
raise ValueError(f"Unknown method: {method}")

@staticmethod
def _get_decoder_source(output):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeing source and output in the same context confused me, I didn't know which one was which. I think renaming output to encode_output would help. Same above in create_encoder, to keep consistent names across functions / helpers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That being said, as soon as we can, we probably want to get rid of all this and just use the same 'scaffolding' we already have for TestVideoEncoder in test_encoders.py?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure, once we add a Python API we can migrate these tests to test_encoders.py and reuse the testing helper functions.

@Dan-Flores Dan-Flores merged commit 7ed4515 into meta-pytorch:main Apr 16, 2026
23 checks passed
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.

2 participants