Rtsp input jitter (not stable 33.33ms frames)

Hi our opencv (with gstreamer backend) is capturing 30fps h.264 rtsp video from a pretty decent axis camera in a LAN.

For our use case we need rock solid frame intervals of 33.33ms +/- 5% max. But on nx and agx, we get various intervals around 33.33 up to 50% either side.

On our front end we display the input fps and it’s usually fluctuates between 30 and 29.

This is our pipeline:

rtspsrc location=" … " latency=0 ! rtph264depay ! queue ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw,format=BGRx ! queue ! videoconvert ! queue ! video/x-raw, format=BGR ! appsink

What might we be doing wrong that would make our capture fluctuate ? Is it possible to lock the timing or perhaps synchronise with system time? Perhaps then an ntp time server for the camera and Jetson may help?

It seems unexpected to me that this pipeline works on Jetson (may work on host with a NVIDIA dGPU, though).
Did you build and install these plugins ? I’d be curious if you can share how you did that.

Apologies, I was given the wrong pipeline. I’ve updated above with the following for Jetson.

rtspsrc location=" … " latency=0 ! rtph264depay ! queue ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw,format=BGRx ! queue ! videoconvert ! queue ! video/x-raw, format=BGR ! appsink

You may try :

  • using nvv4l2decoder instead of omxh264dec getting deprecated.
  • setting rtspsrc latency property to a greater value such as 500 ms and then try decreasing. 0 may not be the best latency for your case.
  • using TCP instead of UDP : add protocols=tcp into rtspsrc properties

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