Repository: opencv
Issue: Opencv4.5.5 compilation error: opencv_cudacodec.dir/src/video_decoder.cpp.o failed
Labels: category: build/install,category: gpu/cuda (contrib)

Hello, I'm compiling OpenCV 4.5.5 with hardware acceleration on JetsonNano. Cuda version is 10.2. The cmake compilation options are as follows :
```
cmake -D WITH_CUDA=ON  \
      -D WITH_CUDNN=ON  \
      -D WITH_CUBLAS=ON  \
      -D CUDA_ARCH_BIN="5.3"  \
      -D CUDA_ARCH_PTX=""  \
      -D BUILD_CUDA_STUBS=ON  \
      -D ENABLE_FAST_MATH=ON  \
      -D CUDA_FAST_MATH=ON  \
      -D OPENCV_DNN_CUDA=ON  \
      -D OPENCV_ENABLE_NONFREE=ON  \
      -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.5.5/modules  \
      -D WITH_GSTREAMER=ON  \
      -D WITH_LIBV4L=ON  \
      -D WITH_NVCUVID=ON  \
      -D BUILD_opencv_cudacodec=ON  \
      -D WITH_FFMPEG=ON  \
      -D WITH_CUFFT=ON  \
      -D OPENCV_GENERATE_PKGCONFIG=ON  \
      -D BUILD_opencv_python2=OFF  \
      -D BUILD_opencv_python3=ON  \
      -D BUILD_TESTS=OFF  \
      -D BUILD_PERF_TESTS=OFF  \
      -D BUILD_EXAMPLES=OFF  \
      -D CMAKE_BUILD_TYPE=RELEASE  \
      -D CMAKE_INSTALL_PREFIX=/usr/local  \
      -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2  \
      ../opencv-4.5.5
```
However, the following compilation error occurs.
```
[ 67%] Built target opencv_calib3d
Consolidate compiler generated dependencies of target opencv_cudacodec
[ 67%] Building CXX object modules/cudacodec/CMakeFiles/opencv_cudacodec.dir/src/video_decoder.cpp.o
/opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/video_decoder.cpp: In member function ‘void cv::cudacodec::detail::VideoDecoder::create(const cv::cudacodec::FormatInfo&)’:
/opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/video_decoder.cpp:81:29: error: ‘cudaVideoCodec_AV1’ was not declared in this scope
                             cudaVideoCodec_AV1      == _codec ||
                             ^~~~~~~~~~~~~~~~~~
/opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/video_decoder.cpp:81:29: note: suggested alternative: ‘cudaVideoCodec_NV12’
                             cudaVideoCodec_AV1      == _codec ||
                             ^~~~~~~~~~~~~~~~~~
                             cudaVideoCodec_NV12
In file included from /opt/opencv/opencv-4.5.5/modules/core/include/opencv2/core.hpp:53:0,
                 from /opt/opencv/opencv-4.5.5/modules/core/include/opencv2/core/cuda.hpp:51,
                 from /opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/include/opencv2/cudacodec.hpp:51,
                 from /opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/precomp.hpp:54,
                 from /opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/video_decoder.cpp:44:
/opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/video_decoder.cpp:106:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         videoFormat.ulWidth <= decodeCaps.nMaxWidth &&
         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/opt/opencv/opencv-4.5.5/modules/core/include/opencv2/core/base.hpp:342:38: note: in definition of macro ‘CV_Assert’
 #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
                                      ^~~~
/opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/video_decoder.cpp:107:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         videoFormat.ulHeight <= decodeCaps.nMaxHeight);
         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/opt/opencv/opencv-4.5.5/modules/core/include/opencv2/core/base.hpp:342:38: note: in definition of macro ‘CV_Assert’
 #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
                                      ^~~~
/opt/opencv/opencv_contrib-4.5.5/modules/cudacodec/src/video_decoder.cpp:109:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     CV_Assert((videoFormat.width >> 4)* (videoFormat.height >> 4) <= decodeCaps.nMaxMBCount);
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/opt/opencv/opencv-4.5.5/modules/core/include/opencv2/core/base.hpp:342:38: note: in definition of macro ‘CV_Assert’
 #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
                                      ^~~~
modules/cudacodec/CMakeFiles/opencv_cudacodec.dir/build.make:805: recipe for target 'modules/cudacodec/CMakeFiles/opencv_cudacodec.dir/src/video_decoder.cpp.o' failed
make[2]: *** [modules/cudacodec/CMakeFiles/opencv_cudacodec.dir/src/video_decoder.cpp.o] Error 1
CMakeFiles/Makefile2:4873: recipe for target 'modules/cudacodec/CMakeFiles/opencv_cudacodec.dir/all' failed
make[1]: *** [modules/cudacodec/CMakeFiles/opencv_cudacodec.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2
```
What causes this and how to solve it? Thank you very much.