cv::cudacodec::VideoWriter has not worked for several years unfortunately.
cv::cudacodec::VideoWriter