-
Notifications
You must be signed in to change notification settings - Fork 5.8k
cv2.cudacodec.createVideoReader(x2_rma.mp4) #3920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D BUILD_EXAMPLES=ON -D WITH_CUDA=ON -D CUDA_ARCH_BIN=7.5 -D CUDA_ARCH_PTX= -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON -D BUILD_opencv_world=ON -D BUILD_opencv_python3=ON -D PYTHON3_EXECUTABLE=$(which python3) .. |
/video_analysis# python3 -c "import cv2; print(cv2.getBuildInformation())" General configuration for OpenCV 4.12.0-dev ===================================== Extra modules: Platform: CPU/HW features: C/C++: OpenCV modules: GUI: Media I/O: Video I/O: Parallel framework: pthreads Trace: YES (with Intel ITT(3.25.4)) Other third-party libraries: NVIDIA CUDA: YES (ver 12.4, CUFFT CUBLAS) cuDNN: YES (ver 8.9.7) OpenCL: YES (no extra features) Python 3: Python (for build): /usr/bin/python3 Java: Install to: /usr/local |
Traceback (most recent call last):
File "/home/ubuntu/apurva.thakkar/video_analysis/debug.py", line 39, in
process_video_with_gpu(video_path)
File "/home/ubuntu/apurva.thakkar/video_analysis/debug.py", line 13, in process_video_with_gpu
cap = cv2.cudacodec.createVideoReader(video_path)
cv2.error: OpenCV(4.12.0-dev) /home/ubuntu/opencv/modules/core/include/opencv2/core/private.cuda.hpp:112: error: (-213:The function/feature is not implemented) The called functionality is disabled for current build or platform in function 'throw_no_cuda'
This is my code
import cv2
import time
import subprocess
Function to check GPU usage
def check_gpu_usage():
# Run nvidia-smi and capture output
result = subprocess.run(['nvidia-smi'], stdout=subprocess.PIPE)
print(result.stdout.decode())
def process_video_with_gpu(video_path):
# Use the GPU decoder
cap = cv2.cudacodec.createVideoReader(video_path)
fps = cap.get(cv2.CAP_PROP_FPS)
Run the test
if name == "main":
video_path = 'x2_rma.mp4'
process_video_with_gpu(video_path)
The text was updated successfully, but these errors were encountered: