Is there a way to drop frames instead of just calling jetson.utils.videoSource.Capture()

I’m trying to use the Jetson nano to Monitor 4 Camera Streams i get via RTSP simulatneously but don’t need every frame from the stream. I’d be totally fine with 2 FPS per stream.
Is there any way to only get the latest frame instead of the next one inside the buffer? Right now I’m calling jetson.utils.videoSource.Capture() without allocation to drop frames which is really wasteful of resources and results in a noticable latency. I’d also be fine to reduce the Buffer size so I don’t have to flush too many frames but couldn’t find it inside the repo I’ve only seen that (mOptions->numBuffers) in gstBufferManager.cpp could be interesting for me, but I don’t find the place in the code where it gets allocated (It get’s allocated by the camera module?).
Is there another way?

Hi,
Please check if you can run this and see video preview:

gst-launch-1.0 rtspsrc locatio=_RTSP_URI_ ! rtph264depay ! h264parse ! nvv4l2decoder ! nvoverlaysink

If yes, you can set the property to nvv4l2decoder to drop frames:

  drop-frame-interval : Interval to drop the frames,ex: value of 5 means every 5
th frame will be given by decoder, rest all dropped
                        flags: readable, writable, changeable only in NULL or RE
ADY state
                        Unsigned Integer. Range: 0 - 30 Default: 0
1 Like

when i try to run
gst-launch-1.0 rtspsrc locatio=rtsp://usr:pass@192.168.40.251/axis-media/media.amp ! rtph264depay ! h264parse ! nvv4l2decoder ! nvoverlaysink I get the following error:

nvbuf_utils: Could not get EGL display connection
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Resource not found.
Additional debug info:
gstrtspsrc.c(7460): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
No valid RTSP URL was provided
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

The url is definitely right, since it’s already running with my object detection program on this device.

How do i set the property to nvv4l2decoder? Do I rebuild the repository with differnt settings? Do i enter the options to the constructor of my jetson.utils.videoCapure? Do i initialize the Decoder and give it to the constructor of videocapture?Sorry I’m rather new to this.

Hi,
It looks like the URI is not read correctly. Please try this:
Deepstream 5.1 Test 3 RTSP Camera INPUT - #3 by DaneLLL

How do i set the property to nvv4l2decoder ? Do I rebuild the repository with differnt settings? Do i enter the options to the constructor of my jetson.utils.videoCapure? Do i initialize the Decoder and give it to the constructor of videocapture?Sorry I’m rather new to this.

Hi,
The suggestion is to add " " to URI string like:

gst-launch-1.0 rtspsrc locatio="rtsp://usr:pass@192.168.40.251/axis-media/media.amp" ! ...

Please give it a try.

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