Skip to content

Conversation

NicolasHug
Copy link
Contributor

Fixes #553.

The fix is just to set

streamInfo.codecContext->pkt_timebase = streamInfo.stream->time_base;

as is done in ffprobe (which, from #553 , was correct): https://github.com/FFmpeg/FFmpeg/blob/1eafbf820312d45b31907e16877ae780022598c4/fftools/ffprobe.c#L3974

I looked and debugged with a source-build of ffprobe for a bit, trying to see if it was doing something clever with frames / packets pts. But I couldn't find anything. And the above is the only thing I could find that we weren't already doing with the AVCodecContext. So, while I don't necessarily understand why this is a fix, I'm fairly confident that this is indeed the right fix.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 16, 2025
@NicolasHug NicolasHug added the bug Something isn't working label Mar 16, 2025
@NicolasHug NicolasHug changed the title Fix first PTS audio bug Fix first PTS bug Mar 16, 2025
@scotts
Copy link
Contributor

scotts commented Mar 17, 2025

Great fix! This must have also been a problem with video as well, but we never had any examples that exposed it.

@NicolasHug NicolasHug merged commit 28e1503 into meta-pytorch:main Mar 17, 2025
46 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.

Incorrect audio frame pts with nasa_13013.mp4.audio.mp3

3 participants