Capture videos form multi-GMSL cameras caises CPU High load problem

A question about the Jetson Linux API Reference MultiMedia APIs’ sample program.

After connected 4 GMSL-camera through the MIPI-connector, Using the selfmade program which based on the MultiMedia API’s sample program to capture images form 4 cameras by 1 process, “vi-output ar0” makes the cpu loads very high.
I also tried to use the MultiMedia API’s sample program to capture images form 4 cameras by each different process, and it did not cause the cpu run high load.

I would like to know is there any way to make the AGX Xavier capture images form multi cameras by 1 process and can run by a lower cpu load.

Environment:
Jetson AGX Xavier
Camera Sensor ar0230
Sample Program : capture-cuda

hello JudeLyn,

may I also confirm what’s 1 process you’re mentioned here. did you meant single CPU core?

Sorry about that, I was just tried to say that inside this single process.
The problem is after i did multi-thread to the capture-cuda and run the capture process for 4 cameras at the same time,
the cpu load went extremely high, but if I run the original capture-cuda separately for 4 cameras the total cpu load will be virtually zero.
I could not understand this, and I would like to know how to fix this.

hello JudeLyn,

do you have pseudo code to demonstrate your multi-thread implementation of the capture process.

capture.edit.cpp (25.9 KB)
Here is the code, please give it a look.