Jetson nano - opencv webcam low fps

Hi,
my aim is to apply some cuda kernels on an image coming from my usb webcam and to show the result. The problem is that I need to do that using images that are full HD. Actually what I am try to do is to get some decent FPS with a base application using opencv, something like

while 1:
  capture >> frame
  imshow(frame)

Doing something like this I obtain around 15 fps. Doing something more complicated like

thread1:
   capture
   write(thread2)

thread2:
  // elaborating thread. Does nothing, only read from thread1 and write to thread3
  read(thread1)
  write(thread3)

thread3:
 imshow(frame)

I get around 24 fps but they are pretty unstable. What can I do to reach 30 stable FPS?

The “videocapture” object configuration is:

    VideoCapture cap;
    if (!cap.open(0, CAP_V4L2)) return 1;
    auto codec = cv::VideoWriter::fourcc('M','J','P','G');
    cap.set(cv::CAP_PROP_FOURCC, codec);
    cap.set(3, 1920);
    cap.set(4, 1080);

    Mat base;
    cap >> base;

The output from v4l2-ctl list-formats-ext is

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'MJPG' (compressed)
	Name        : Motion-JPEG
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x320
			Interval: Discrete 0.033s (30.000 fps)

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 1920x1080
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x320
			Interval: Discrete 0.033s (30.000 fps)

	Index       : 2
	Type        : Video Capture
	Pixel Format: 'H264' (compressed)
	Name        : H.264
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x320
			Interval: Discrete 0.033s (30.000 fps)

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

It’s USB3 camera? Have you check with smaller size?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.