Add FPS to get_frames_played_in_range()#1148
Merged
mollyxu merged 13 commits intometa-pytorch:mainfrom Jan 23, 2026
Merged
Conversation
mollyxu
commented
Dec 30, 2025
added 3 commits
December 30, 2025 14:20
scotts
reviewed
Jan 5, 2026
scotts
reviewed
Jan 5, 2026
scotts
reviewed
Jan 5, 2026
scotts
reviewed
Jan 5, 2026
scotts
reviewed
Jan 5, 2026
scotts
reviewed
Jan 5, 2026
scotts
reviewed
Jan 5, 2026
scotts
reviewed
Jan 5, 2026
NicolasHug
reviewed
Jan 6, 2026
NicolasHug
reviewed
Jan 6, 2026
scotts
reviewed
Jan 6, 2026
NicolasHug
reviewed
Jan 21, 2026
Contributor
NicolasHug
left a comment
There was a problem hiding this comment.
Thanks for the great PR @mollyxu ! Left a first pass, this looks good
NicolasHug
approved these changes
Jan 22, 2026
Contributor
There was a problem hiding this comment.
Thanks for the great work @mollyxu ! I left two comments below and followed-up on the FFmpeg 4 thing above (#1148 (comment)). But this LGTM!
added 2 commits
January 22, 2026 11:21
Contributor
Author
|
Thank you everyone for your feedback and reviews! |
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.
Add FPS to
get_frames_played_in_range()Context: #1133
This PR adds support for specifying a target frame rate when calling
get_frames_played_in_range(). Whentarget_fpsis provided, the method resamples the video to output frames at evenly-spaced timestamps matching the target FPS.The way to read this API if fps is:
None, default: returns decoded frames betweenstart_secondsandstop_secondsat the input frame rate. This is the existing behavior.float: returns decoded frames betweenstart_secondsandstop_secondswhere the output frame rate matches the value offps.Implementation
num_output_frames = round((stop - start) * fps)i, computetarget_pts = start + i / fpstarget_ptsusing lower-bound search