Ask Your Question

Read video from usb/onboard camera using cv::cudacodec::VideoReader

asked 2020-11-03 06:40:05 -0500

Sanju gravatar image

Hi, How can we read video from an onboard/usb camera using opencv cv::cudacodec::VideoReader?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-11-03 10:14:43 -0500

For this to work you would need to be able to read from the onboard/usb camera using VideoCapture with FFmpeg. That is the following would need to work on your system

VideoCapture cap(0, CAP_FFMPEG);

on my laptop this fails with the inbuilt web cam.

The reason this needs to work is that cv::cudacodec uses FFmpeg to read video streams which don't come from files.

Out of interest what codec is the video encoded with?

edit flag offensive delete link more


Hello, The main reason for this question is that our OpenCV application we are already getting around 15 FPS with UVUV, but the camera supports 30 FPS with MJPEG. We are trying to make use of it.

There are two ways we think, 1. Using hardware video decoder 2.Using graphics card to decode frames.

Sanju gravatar imageSanju ( 2020-11-04 01:48:09 -0500 )edit

Question Tools

1 follower


Asked: 2020-11-03 06:40:05 -0500

Seen: 76 times

Last updated: Nov 03 '20