Skip to content

Conversation

Dan-Flores
Copy link
Contributor

@Dan-Flores Dan-Flores commented Oct 14, 2025

This PR enables encoding a video to file_like, similar to the AudioEncoder. The VideoEncoder constructor accept an AVIOContextHolder and file format. It is instantiated with AVIOFileLikeContext.

Testing:

  • test_video_encoder_round_trip and test_against_to_file are updated to test to_file_like method.
  • test_to_file_like_custom_file_object, test_to_file_like_real_file, test_to_file_like_bad_methods tests are added.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 14, 2025
@Dan-Flores Dan-Flores changed the title to_tensor, AVIOTensorContext fix Add to_filelike support for VideoEncoder Oct 14, 2025
@Dan-Flores Dan-Flores marked this pull request as ready for review October 14, 2025 19:51
@Dan-Flores Dan-Flores changed the title Add to_filelike support for VideoEncoder Add to_file_like support for VideoEncoder Oct 14, 2025
@Dan-Flores
Copy link
Contributor Author

Addressed feedback from 3e97d89:

  • Added more detailed file_like tests, similar to the ones that exist for AudioEncoder
  • Added TODO for tests that use different memory layouts (test_contiguity)
  • Removed seek(0)

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.

1 participant