Skip to content

Conversation

NicolasHug
Copy link
Contributor

The Failed to open input buffer aren't resolved as they were visible in https://github.com/pytorch/torchcodec/actions/runs/16238309871/job/45851804069?pr=757.

So #724 is still a problem, and #755 wasn't a proper fix.

I hope this one is the one. It does 2 things:

  • We now call avio_close() at the end of encode(). Not just when the encoder is destructed. That makes sense.
  • We also now call avio_flush(), which was potentially needed. I'm not entirely sure, but it's probably needed. Or at least it's fairly clear that calling avio_close() isn't enough anyway, because we are seeing the error not just when relying on FFmpeg's default avio object, but also when using to_tensor(): https://github.com/pytorch/torchcodec/actions/runs/16238309871/job/45851804069?pr=757.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 12, 2025
@NicolasHug NicolasHug mentioned this pull request Jul 12, 2025
@NicolasHug
Copy link
Contributor Author

😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭

https://github.com/pytorch/torchcodec/actions/runs/16241951867/job/45859651025?pr=773

AudioEncoder::~AudioEncoder() {
if (avFormatContext_ && avFormatContext_->pb && !avioContextHolder_) {
avio_close(avFormatContext_->pb);
close_avio();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nite: closeAVIO() for consistency.

@NicolasHug NicolasHug merged commit 784003f into meta-pytorch:main Jul 23, 2025
42 of 45 checks passed
@NicolasHug NicolasHug deleted the aviocloseagain branch July 23, 2025 15:09
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.

3 participants