[torchcodec] Update functions that return a single frame to return frame and metadata #74
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:
We now return the frame tensor, frame pts and frame duration for these functions.
Users who use the sampler or SimpleVideoDecoder are not affected.
Note that the pts and duration are returned as Tensors. This is due to a limitation of torch.compile() where it will not accept tuples of non-Tensors:
https://fb.workplace.com/groups/1075192433118967/posts/1461960124442194/?comment_id=1461971881107685
I also removed the
get_frame_with_info_at_index
because now that's redundant withget_frame_at_index
.In the proceses I also included VideoDecoderOps.h in VideoDecoderOps.cpp and fixed some inconsistencies between the two that were causing compilation failures.
TODO: I will handle the batch API functions in a subsequent diff.
Reviewed By: scotts
Differential Revision: D59542194