Skip to content

Conversation

@Dan-Flores
Copy link
Contributor

@Dan-Flores Dan-Flores commented Oct 29, 2025

This PR adds CUDA support to the VideoEncoder.

  • Splits findCodec into findEncoder and findDecoder, and relocates shared component in codecSupportsCudaHardware.

    • The usage of findCodec in SingleStreamDecoder.cpp is updated to use findDecoder().
  • Add deviceInterface_ member variable to Encoder which stores an nvenc codec, if available.

  • Several tests are updated to test using a CUDA device. Some caveats:

    • Round trip tests using CUDA + FFmpeg4 have much lower pixel accuracy. I want to chalk this up to an FFmpeg bug, since accuracy is significantly better on other versions. As a result, I am skipping CUDA + FFmpeg4 tests.
    • Only mp4, mov, mkv can be tested, since the nvenc_h264 is the only nvenc codec available.
    • To get accurate round trip testing, the crf equivalent for this encoder qp is swapped in during the test and in Encoder.cpp.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 29, 2025
@Dan-Flores Dan-Flores changed the title video encoder python file video encoder CUDA support Oct 29, 2025
@Dan-Flores Dan-Flores marked this pull request as ready for review November 3, 2025 21:07
@Dan-Flores Dan-Flores changed the title video encoder CUDA support Enable CUDA device for video encoder Nov 3, 2025
@Dan-Flores Dan-Flores marked this pull request as draft November 3, 2025 21:35
@Dan-Flores Dan-Flores changed the title Enable CUDA device for video encoder [wip] Enable CUDA device for video encoder Nov 6, 2025
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.

1 participant