Skip to content

Conversation

NicolasHug
Copy link
Contributor

@NicolasHug NicolasHug commented May 15, 2025

🥶

We weren't multiplying by timeBase.num. All the videos we've been testing on so far had a timebase.num == 1, so the bug went unnoticed.

@NicolasHug NicolasHug added the bug Something isn't working label May 15, 2025
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 15, 2025
AVRational defaultTimeBase{1, AV_TIME_BASE};
containerMetadata_.durationSeconds =
ptsToSeconds(formatContext_->duration, AV_TIME_BASE);
ptsToSeconds(formatContext_->duration, defaultTimeBase);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Drive-by: I've been annoyed by the existence of double ptsToSeconds(int64_t pts, int den), so I'm removing it.

defaultTimeBase corresponds to FFmpeg's AV_TIME_BASE_Q, which we can't use due to a C++ pendantic compilation error.

Copy link
Contributor

@scotts scotts left a comment

Choose a reason for hiding this comment

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

Good catch!

@NicolasHug NicolasHug merged commit 5013118 into meta-pytorch:main May 15, 2025
46 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 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.

3 participants