Hello,
I’m trying to evaluate what is the absolute fastest way to output the image of an Mipi camera to a monitor via HDMI via a Jetson Nano. Right now I am using libargus via the nvarguscamerasrc gstreamer plugin with the following command:
The camera in use is the Raspberry Pi V2 camera and the stream is displayed on a 60FPS monitor.
This gstreamer command results in a very low latency of around 50 ms [3 frames of the monitor].
However I need the additional control, that only the low-level C API of libargus provides but that is not exposed in the libarguscamerasrc gstreamer plugin (e.g. setting the the color correction matrix).
An basic example of how to use libargus with the C-API is provided in the tegra_multimedia_api under samples/09_camera_ jpeg_capture which is the basis for my test program. However even if I remove the JPEG thread of that example and just let the preview thread run, I can only get very few FPS and a very high delay in the playback of the camera image on the monitor.
My question is, why is using the C-API for libargus so much slower than the gstreamer plugin even though both should work similarly and second can I make the C-program as fast as the gstreamer pipeline?
Furthermore, what is the fastest way to get the result drawn to the screen? Is it via the NvEglRenderer? An X-server is not necessary for me.
I cannot comment on argus, but if gstreamer works fine for you, you may build the pipeline in your application so that you can perform your own processing (assuming with GPU in NVMM memory). See this opencv example (Not sure it was a good idea to use sobel on alpha channel, though, BGR should be enough).
You would adapt to your own case.
Have a check with the argus_camera below result is I got from Pi imx219.
nvidia@nvidia-desktop:~$ ./argus_camera --kpi --sensormode=3
Executing Argus Sample Application (argus_camera)
Argus Version: 0.97.3 (multi-process)
PerfTracker: app initial 556 ms
PerfTracker 1: app intialized to task start 663 ms
PerfTracker 1: task start to issue capture 73 ms
PerfTracker 1: first request 169 ms
PerfTracker 1: total launch time 1462 ms
PerfTracker 1: frameRate 75.65 frames per second at 0 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 24 ms average, min 18 max 29
PerfTracker 1: frameRate 61.78 frames per second at 0 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 17 ms average, min 15 max 21
PerfTracker 1: frameRate 60.64 frames per second at 1 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 16 ms average, min 15 max 17
PerfTracker: display frame rate 52.62 frames per second
PerfTracker 1: frameRate 60.69 frames per second at 1 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 16 ms average, min 15 max 19
PerfTracker 1: frameRate 60.52 frames per second at 1 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 16 ms average, min 15 max 17
PerfTracker: display frame rate 60.04 frames per second
PerfTracker 1: frameRate 60.42 frames per second at 2 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 16 ms average, min 15 max 17
PerfTracker 1: frameRate 60.34 frames per second at 2 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 16 ms average, min 15 max 17
PerfTracker: display frame rate 60.00 frames per second
PerfTracker 1: frameRate 60.32 frames per second at 3 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 16 ms average, min 15 max 17
With the same “argus_camera” program I get a very different result:
./argus_camera --kpi --sensormode=3
Executing Argus Sample Application (argus_camera)
Argus Version: 0.97.3 (multi-process)
PerfTracker: app initial 631 ms
PerfTracker 1: app intialized to task start 474 ms
PerfTracker 1: task start to issue capture 68 ms
PerfTracker 1: first request 1196 ms
PerfTracker 1: total launch time 2370 ms
PerfTracker 1: frameRate 2,01 frames per second at 0 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker: display frame rate 2,02 frames per second
PerfTracker 1: latency 51 ms average, min 51 max 53
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,02 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker 1: flush takes 2086 ms
PerfTracker 1: device close takes 8 ms
PerfTracker 1: total close takes 2095 ms
Thanks for that answer. That is kind of the fallback solution, but right now I specifically try to evaluate the performance of libargus, respectively the ISPs from NVIDIA which are only accessible via libargus.
How can that be? That should not be possible.
I compiled that binary with the newest Multimedia API from the NVIDIA Webpage and the workflow excactly as described in the README.txt file in the tegra_multimedia_api/argus folder.
Can you give me a binary without that problem for testing purposes?
I tried your binary and it leads to the same result as you can see below:
./argus_camera --kpi --sensormode=3
Executing Argus Sample Application (argus_camera)
Argus Version: 0.97.3 (multi-process)
PerfTracker: app initial 656 ms
PerfTracker 1: app intialized to task start 436 ms
PerfTracker 1: task start to issue capture 64 ms
PerfTracker 1: first request 1213 ms
PerfTracker 1: total launch time 2371 ms
PerfTracker 1: frameRate 2,01 frames per second at 0 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker: display frame rate 2,02 frames per second
PerfTracker 1: latency 51 ms average, min 51 max 53
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,02 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker: display frame rate 2,00 frames per second
PerfTracker 1: flush takes 1715 ms
PerfTracker 1: device close takes 3 ms
PerfTracker 1: total close takes 1719 ms
Is maybe some shared library on the system broken in my case, which is linked into all the libargus executeables and this leads to the slow FPS?
Also why are the FPS exactly 2,00? tTat seems very weird to me. It’s not just slow, it’s exactly 2.
My system is really a fresh and unmodified install from the latest SD card image provided by NVIDIA.
./argus_camera --kpi --sensormode=3
Executing Argus Sample Application (argus_camera)
Argus Version: 0.97.3 (multi-process)
PerfTracker: app initial 584 ms
PerfTracker 1: app intialized to task start 561 ms
PerfTracker 1: task start to issue capture 67 ms
PerfTracker 1: first request 152 ms
PerfTracker 1: total launch time 1365 ms
PerfTracker 1: frameRate 72,26 frames per second at 0 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 17 ms average, min 16 max 20
PerfTracker 1: frameRate 60,38 frames per second at 0 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 15 ms average, min 15 max 18
PerfTracker 1: frameRate 60,39 frames per second at 1 Seconds
PerfTracker 1: framedrop current request 0, total 0
PerfTracker 1: latency 15 ms average, min 15 max 16
PerfTracker: display frame rate 60,31 frames per second
PerfTracker 1: frameRate 60,29 frames per second at 1 Seconds
PerfTracker 1: flush takes 87 ms
PerfTracker 1: device close takes 12 ms
PerfTracker 1: total close takes 100 ms
It works. But why? What is different?
Also your executeable is much smaller in file size. Mine is 2.2MB, yours us 1.2MB
There’s no problem for me to build from the public release source too.
The size is about 2.2MB too.
Attached my source here for reference.argus.tar.gz (2.0 MB)
Using the sources you provided I cannot compile with the commands as written in README.txt. The make command fails with:
In file included from /home/nico/testmod/samples/utils/gtk/Window.h:32:0,
from /home/nico/testmod/samples/utils/Window.h:34,
from /home/nico/testmod/apps/camera/renderer/Composer.h:36,
from /home/nico/testmod/apps/camera/renderer/Composer.cpp:40:
/home/nico/testmod/samples/utils/WindowBase.h:32:10: fatal error: Argus/Argus.h: No such file or directory include <Argus/Argus.h>