cv::cudacodec::VideoWriter not working with only NVCUVID

NCUVENC is just the historical name of the encoding module in OpenCV, if its not present you haven’t compiled against the encoding lib (libnvidia-encode.so) which should be installed when you install the Nvidia driver.

Can you post your CMake output is should have an entry similar to

– Found NVCUVID: /usr/lib/wsl/lib/libnvcuvid.so
– Found NVCUVENC: /usr/lib/wsl/lib/libnvidia-encode.so
– CUDA detected: 12.0