Skip to content

Commit 221e997

Browse files
committed
Fixed support for NVIDIA Codec SDK 11.x
1 parent 01fd98d commit 221e997

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/cudacodec/src/video_writer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ GUID CodecGuid(const Codec codec) {
236236
switch (codec) {
237237
case Codec::H264: return NV_ENC_CODEC_H264_GUID;
238238
case Codec::HEVC: return NV_ENC_CODEC_HEVC_GUID;
239+
#if (NVENCAPI_MAJOR_VERSION >= 12)
240+
case Codec::AV1: return NV_ENC_CODEC_AV1_GUID;
241+
#endif
239242
default: break;
240243
}
241244
std::string msg = "Unknown codec: cudacodec::VideoWriter only supports CODEC_VW::H264 and CODEC_VW::HEVC";
@@ -318,7 +321,9 @@ GUID EncodingPresetGuid(const EncodePreset nvPreset) {
318321
std::string GetVideoCodecString(const GUID codec) {
319322
if (codec == NV_ENC_CODEC_H264_GUID) return "AVC/H.264";
320323
else if (codec == NV_ENC_CODEC_HEVC_GUID) return "H.265/HEVC";
324+
#if (NVENCAPI_MAJOR_VERSION >= 12)
321325
else if (codec == NV_ENC_CODEC_AV1_GUID) return "AV1";
326+
#endif
322327
else return "Unknown";
323328
}
324329

0 commit comments

Comments
 (0)