Add filelike support and tests to streaming encoder#1319
Add filelike support and tests to streaming encoder#1319Dan-Flores merged 2 commits intometa-pytorch:mainfrom
Conversation
🔗 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. |
| raise ValueError(f"Unknown method: {method}") | ||
|
|
||
| @staticmethod | ||
| def _get_decoder_source(output): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
For sure, once we add a Python API we can migrate these tests to test_encoders.py and reuse the testing helper functions.
This PR adds a
MultiStreamEncoderconstructor that accepts anAVIOContextHolderto support writing to a file-like.Tests are updated to call both
create_streaming_encoder_to_file_likeandcreate_streaming_encoder_to_file.