Skip to content

Conversation

NicolasHug
Copy link
Contributor

@NicolasHug NicolasHug commented Oct 3, 2025

This PR adds support for H265 videos. It also creates a new initializeBSF() method: previously, we were hard-coding the BSF for H264. But H265 needs a different kind of BSF, and some format do not need any. So this PR allows for that more general logic.

This PR is based on #917 so if it's not already merged, you can review it independently by looking at 12c75e7 (#919)

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 3, 2025
@NicolasHug NicolasHug marked this pull request as ready for review October 3, 2025 14:55
// No bitstream filter needed for other codecs
// TODONVDEC P1 MPEG4 will need one!
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I would prefer putting this switching logic into a function - I know we have a style difference there. :) My rationale is that I find it useful to think in terms of pure functions when I can, and this can definitely be a pure function, and then we can simply say in this scope:

std::string filterName = toFilterName(codecPar->codec_id);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIUC we'd need toFilterName to return "" when no match exist, and it would be up to the caller to check against that?

void initializeInterface(AVStream* stream) override;
void initializeInterface(
const AVStream* stream,
const UniqueDecodingAVFormatContext& avFormatCtx) override;
Copy link
Contributor

Choose a reason for hiding this comment

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

I just merged #902, so there's going to be merge conflicts. It should be easy to solve: we just rename initializeInterface() to initialize(), and keep the new param.

@NicolasHug NicolasHug merged commit b1af8ce into meta-pytorch:main Oct 4, 2025
50 checks passed
@NicolasHug NicolasHug deleted the nvdec-h265 branch October 4, 2025 08:58
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.

2 participants