videocapture_basic.cpp very slow 1920 x 1080 @0.1 YUY2

i’m testing USB3 camera with preinstalled OpenCV videocapture_basic.cpp

except i adjusted it to test different resolutions:

int width = 1920; // 1280; // 640;
int height = 1080; // 720; // 480;

if (!cap.set(CV_CAP_PROP_FRAME_WIDTH, width)) {
	return -1;
}

if (!cap.set(CV_CAP_PROP_FRAME_HEIGHT, height)) {
	return -1;
}

the sample works for 640x480 and 1280x720 but for 1920x1080 it grabs around 1 frame in 10 sec.

even if i comment out

// imshow("Live", frame);

the same camera works fine on Windows with all 3 resolutions.

are there any known limitations on frame size? or may be any parameters on Jetson Nano to tune?

Hi,
The Open CV sample looks to be CPU-based implementation. You may try max clocks

sudo jetson_clocks

You can check information through tegrastats

sudo tegrastats

It seems like your source is a v4l2 source? We suggest you also refer to tegra_multimedia_api. In the sample 12_camera_v4l2_cuda, NvBuffer is used to capture frames and can be accessed by GPU directly. You can save CPU to GPU memory copy. In the sample v4l2cuda, it calls cudaMallocManaged() to allocate buffers.