Skip to content

feat: decode H.265 and AV1 with NVDEC on Linux - #350

Merged
devopvoid merged 1 commit into
feat/windows-hevc-codecsfrom
feat/linux-nvdec-hevc-av1
Oct 11, 2026
Merged

devopvoid merged 1 commit into
feat/windows-hevc-codecsfrom
feat/linux-nvdec-hevc-av1

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

Summary

Stacked on #347 (hardware H.265 on Windows, which brings NVENC's H.265 to Linux as well), and based on its branch until that is merged.

The NVDEC decoders on Linux decoded H.264 and VP9. They now decode H.265 (Main profile) and AV1 (profile 0) too, where the GPU does (AV1 since Ampere):

  • NvdecLibrary asks the driver (cuvidGetDecoderCaps) for H.265 and AV1 as it does for the others, and the factory offers what the GPU decodes: H.265 in the H265Format of feat: encode and decode H.265 in hardware on Windows #347, AV1 in profile 0.
  • NVDEC's own parser takes the bitstream, so a codec is mostly a matter of telling it which. Its AV1 parser takes temporal units, which begin with a temporal delimiter OBU, and WebRTC's AV1 frames come without one, so one is put in front.
  • Frames of AV1 spatial layers above the first go to dav1d, as those of VP9 go to libvpx.
  • H.265 has no software decoder to fall back to: what NVDEC cannot decode is an error, and WebRTC asks the sender for a key frame.
  • The Javadoc and the codec guide say so.

With NVENC's H.265 from #347, an NVIDIA GPU on Linux now carries H.265 calls both ways.

Testing

  • The changed Linux sources (NVDEC, NVENC from feat: encode and decode H.265 in hardware on Windows #347, EncoderOutputProcessor, H265Format, the Linux factories) compile with GCC 12 in WSL (Debian 12), syntax-only against the WebRTC headers with the defines of the Linux build; the same check rejects a deliberately broken file. CI builds them for real.
  • The existing tests cover it on a Linux machine with an NVIDIA GPU: hardwareDecodesH265 and hardwareCropsPaddedH265 (feat: encode and decode H.265 in hardware on Windows #347) with NVENC and NVDEC, and the AV1 decoder tests.

Not verified

Nothing here has run on an NVIDIA GPU under Linux: there is none here, and CI has no GPU, where the hardware tests skip. In particular whether NVDEC's AV1 parser needs the temporal delimiter, which is harmless if it does not.

@devopvoid
devopvoid force-pushed the feat/windows-hevc-codecs branch from ab23890 to 14a0dc4 Compare October 11, 2026 13:59
The NVDEC decoders decoded H.264 and VP9. They now decode H.265 (Main
profile) and AV1 (profile 0) as well, where the GPU does (AV1 since
Ampere), asking the driver which codecs it decodes. NVDEC's parser takes
the bitstream, so a codec is mostly a matter of telling it which.

NVDEC's AV1 parser takes temporal units, which begin with a temporal
delimiter, and WebRTC's AV1 frames come without one, so one is put in
front. Frames of AV1 spatial layers above the first go to dav1d, as those
of VP9 go to libvpx. H.265 has no software decoder to fall back to: what
NVDEC cannot decode is an error, and WebRTC asks for a key frame.

With NVENC's H.265, NVIDIA GPUs on Linux now carry H.265 calls both ways.
@devopvoid
devopvoid force-pushed the feat/linux-nvdec-hevc-av1 branch from 94d6c61 to c3792ef Compare October 11, 2026 17:51
@devopvoid
devopvoid merged commit 931b5e8 into feat/windows-hevc-codecs Oct 11, 2026
1 check passed
@devopvoid
devopvoid deleted the feat/linux-nvdec-hevc-av1 branch October 11, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant