Error in OpenCV 4.1.0 cv::cudacodec::createVideoReader

Asked 2 years ago, Updated 2 years ago, 148 views

I want to use cv::cudacodec::createVideoReader in opencv 4.1 for high resolution video processing
cuda I have placed a valid opencv, but it cannot work.

 std::string fname("C:/Users/****/****.avi");
cv::Ptr<cv::cudacodec::VideoReader>d_reader=cv::cudacodec::createVideoReader(fname);

running

 0x0000***************************************************************************************************************************** 
Microsoft C++ Exception: cv::Exception (memory location 0x000000*******).

The error appears.

I have been able to process jpeg images using GPUMAT, and the cuda feature installation has been successful, though apparently, and opencv has been built in VS2019.I thought it would be necessary to install the codec separately, but I didn't know how to do it, and I didn't see that on several websites, so I posted it.If you have any knowledge, please take good care of me.

The environment is
Windows 10 home 64bit CPU Intel i7-8750H GPU RTX 2070 note (driver 26.21.14.4274)
cuda 10.1
opencv4.1
Visual Studio 2019 C++

That's right.

opencv cuda

2022-09-30 21:45

1 Answers

I will reply for your reference.
The NVIDIA VIDEO CODEC SDK is required to utilize cv::cudacodec::createVideoReader.
Copy the files that you downloaded and deployed from the NVIDIA home page to the CUDA 10.1 installation folder.
Then, turn on the WITH_NVCUVID for the CMake option and build the OpenCV library.
The build takes in cudacodec related processing, so the build is required even if the options are unchanged.
Now you're ready.

The rest was done by linking cuda.lib, nvcuvid.lib.


2022-09-30 21:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.