IP Camera to Jetson Nano to HDMI Display

I need to connect an IP Camera (2MP, outputting H.264) to a Jetson Nano RJ45 Ethernet Port, displaying the live stream on a local display connected to the Jetson Nano HDMI port.
Once this is solved I will ultimately connect 4 IP Cameras to the network and display the streams simultaneously in various window sizes on the HDMI display.

To date I have successfully connected a RPi Camera Module V2-8 and a Logitech C920 webcam at the same time using cv2.VideoCapture to display their streams on a HDMI TV.
The latency is very low and acceptable to me.

I also have successfully used cv2.VideoCapture to display 1 IP Camera however the latency is 2 to 3 seconds. Unacceptable.

I’m using:
import cv2
while True:
ret, frame=cap.read()
if cv2.waitKey(1)==ord(‘q’):

Please advise your suggestions to achieve low latency with the IP Camera(s)

Thank you!

good afternoon. when I connect ip cameras to jetson nano I have to reduce the framerate on the camera, otherwise jetson nano and opencv do not have time to process. You can also try to start image capture in a separate stream.

Thank you azainullin,

Before detailing my observations I provide current IP Cam settings.
The camera outputs 2 streams.
-Stream0 is set for H.264 1280x720 20 fps
-Stream1 is set for Mpeg 1280x720 20 fps

While I observed the IP Cam performance I was simultaneously displaying a RaspPi Cam in a separate window on the same display for comparison of latency.

1st: Before I started adjusting fps I followed a hunch. I had been working with Stream0, the H.264 stream. I tried Stream1, the Mpeg, and viola! Low latency performance!

2nd: I tested Stream0, H.264 with various fps.
30 fps resulted in 4.0 second delay behind RaspPi Cam
25 fps resulted in 3.0 second delay behind RaspPi Cam
20 fps resulted in 0.8 second delay behind RaspPi Cam
15 fps resulted in the same as 20fps

3rd: Now back to Stream0, Mpeg.
It is configured at 1280x720 20 fps
When the windows first appear on the display the Mpeg is 1.5 seconds behind the RaspPi Cam.
The delay stops at 19 seconds. From that point on, the Mpeg is the same as the RaspPi Cam. No delay.
I’ve run this test several times and the 19 seconds (at 20 fps) is repeatable.
At 25 fps the delay doesn’t stop (or at least I didn’t wait long enough to see it) I waited 3 minutes.
At 15 fps the delay stops at 3 seconds.

What’s next:
My application requires two cameras. The streams will come to the Nano in H.264 because they will be transmitted over a radio link. The H.264 will minimize the bandwidth needed. Mpeg is too large.
Question 1: Can the delay on Stream0 H.264 be further minimized?
Question 2: What is the cause of the initial delay when using the Stream1 Mpeg stream?

Thank you!

Mjpeg (not related to mpeg) is not a temporal codec. Frame 2 doesn’t depend on frame 1, so you’re getting a sequence of stills, rather than a keyframe and a bunch of deltas (what h26* does).

The reason is, (and I and simplifying here) because mjpeg is easier to send with low latency. With a different IP camera you might get better performance but I know of none off-hand. The ones I use for most own home security have a second or two delay.

I don’t think the problem is the decoder, but you could test it with a fake video stream.