lags of the live stream from camera Onboard

Hello,everyone.
I have a jetbot nano and I want to used it to do the realtime detection, but when I test the camera Onboard I saw the video streaming has about 400ms lag than my actions, when i changed the resolution to 320240 it become better, but when I use 640480 or more bigger resolutions it shows the lag,Is there anybody meet this problem or anybody know what remains this situations.

Thanks for the reply!

Hi,
We have a jetbot reference from community. Please check
https://developer.nvidia.com/embedded/community/jetson-projects

For max performance, please execute ‘sudo jetson_clocks’.
You can check system loading through tegrastats

Hi.
I have executed the ‘sudo jetson_clocks’. I test the https://github.com/NVIDIA-AI-IOT/jetbot/blob/master/jetbot/camera.py code and show the frame with cv2.imshow from the ssh or the Nano terminal the stream lag of my actions. but the video shows normal from the jupyterLab. I even adjust the gstpipeline of the framerate\flip_method\width\height but it doesn’t work,so I really dont know what’s wrong.

Hi,
Probably CPU loading achieves 100%. You may run tegrastats to get system status.
It might help to set maxperf in nvarguscamerasrc.

maxperf             : set or unset the max performace
                      flags: readable, writable
                      Boolean. Default: false

Hi.
jetbot@jetbot:~/TFdir$ tegrastats
RAM 1935/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [26%@1428,20%@1428,20%@1428,13%@1428] EMC_FREQ 0% GR3D_FREQ 5% PLL@21C CPU@24C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal@2
3.5C POM_5V_IN 2472/2472 POM_5V_GPU 159/159 POM_5V_CPU 757/757RAM 1937/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [22%@1428,16%@1428,17%@1428,18%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21C CPU@23.5C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal
@23.5C POM_5V_IN 2436/2454 POM_5V_GPU 119/139 POM_5V_CPU 797/777RAM 1929/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [24%@1428,15%@1428,13%@1428,15%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21C CPU@23.5C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal
@23.25C POM_5V_IN 2396/2434 POM_5V_GPU 119/132 POM_5V_CPU 798/784RAM 1938/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [27%@1428,21%@1428,15%@1428,17%@1428] EMC_FREQ 0% GR3D_FREQ 5% PLL@21C CPU@23.5C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal
@23.75C POM_5V_IN 2200/2376 POM_5V_GPU 160/139 POM_5V_CPU 560/728RAM 1936/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [25%@1428,13%@1428,15%@1428,16%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21C CPU@24C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal@2
3.5C POM_5V_IN 2436/2388 POM_5V_GPU 119/135 POM_5V_CPU 757/733RAM 1933/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [23%@1428,17%@1428,15%@1428,20%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21C CPU@24C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal@2
3.75C POM_5V_IN 2160/2350 POM_5V_GPU 120/132 POM_5V_CPU 560/704RAM 1936/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [24%@1428,21%@1428,17%@1428,18%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21C CPU@23.5C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal
@23.5C POM_5V_IN 2083/2311 POM_5V_GPU 120/130 POM_5V_CPU 520/678RAM 1928/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [30%@1428,15%@1428,17%@1428,16%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21C CPU@24C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal@2
3.5C POM_5V_IN 2160/2292 POM_5V_GPU 120/129 POM_5V_CPU 560/663RAM 1936/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [23%@1428,20%@1428,20%@1428,19%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21C CPU@23.5C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal
@23.5C POM_5V_IN 2236/2286 POM_5V_GPU 120/128 POM_5V_CPU 640/661RAM 1937/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [26%@1428,16%@1428,21%@1428,16%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21.5C CPU@24.5C iwlwifi@29C PMIC@100C GPU@23.5C AO@29C thermal
@24C POM_5V_IN 3139/2371 POM_5V_GPU 119/127 POM_5V_CPU 1349/729RAM 1932/3965MB (lfb 13x4MB) SWAP 40/4096MB (cached 17MB) CPU [25%@1428,15%@1428,18%@1428,22%@1428] EMC_FREQ 0% GR3D_FREQ 0% PLL@21.5C CPU@24C iwlwifi@29C PMIC@100C GPU@23.5C AO@29.5C thermal
@23.5C POM_5V_IN 2746/2405 POM_5V_GPU 119/126 POM_5V_CPU 1035/757

I see the usage of cpu is not high

SOC family:tegra210 Machine:jetson-nano
Online CPUs: 0-3
CPU Cluster Switching: Disabled
cpu0: Online=1 Governor=schedutil MinFreq=1428000 MaxFreq=1428000 CurrentFreq=1428000 IdleStates: WFI=0 c7=0
cpu1: Online=1 Governor=schedutil MinFreq=1428000 MaxFreq=1428000 CurrentFreq=1428000 IdleStates: WFI=0 c7=0
cpu2: Online=1 Governor=schedutil MinFreq=1428000 MaxFreq=1428000 CurrentFreq=1428000 IdleStates: WFI=0 c7=0
cpu3: Online=1 Governor=schedutil MinFreq=1428000 MaxFreq=1428000 CurrentFreq=1428000 IdleStates: WFI=0 c7=0
GPU MinFreq=921600000 MaxFreq=921600000 CurrentFreq=921600000
EMC MinFreq=204000000 MaxFreq=1600000000 CurrentFreq=1600000000 FreqOverride=1
Fan: speed=255
NV Power Mode: MAXN

and do you have any other suggestions, Thansk for your help.

Hi,DaneLLL

I find that if I use ssh connect to the jetson system and run my camera.py the video will have lag. If connect from the HDMI screen it will not, so I think the enthernet will hanve more influence on the video streaming of opencv with gstreamer.

Hi mistest163,

Thanks for reaching out!

JetBot was tested against relatively low resolution images: 224x224, 300x300. It’s possible that the simple JPEG streaming would slow down significantly for larger images.

Do you mind sharing your use case for streaming 640x480 images? Perhaps there are optimizations that could be done to improve the latency.

Please let me know if you have any questions.

Best,
John

Hello jaybdub.

First if you don’t have an extra screen for the jetson Nano, you may find this problem?

I used the jetbot board as a Gesture control endpoint,when you wave your hand left the page on the monitor screen goes to the previous when right the page goes to next,so I want a bigger video windows to see if I am at the right place to do these actions ~~.

But now I find .when you dont have an screen for jetson, The jupyter can be a good choice.