How to eliminate gstreamer camera buffer?

Hello Everyone,

I want to quickly read data from the camera so I want to set the internal bufer size of the camera to 1.

In opencv

cap.set(cv2.CAP_PROP_BUFFERSIZE, 3)

method change the camera buffer size but in jetson nano this did not work(returned false statement) therefore I decided to use gstreamer pipeline to change buffer size. I inspected forum and create below pipeline. This pipeline work but I am not sure that Is this correct?

cap=cv2.VideoCapture("v4l2src device=/dev/video0 ! jpegdec ! video/x-raw,framerate=30/1,width=1920,height=1080 ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)BGRx, width=(int)640, height=(int)480 ! nvvidconv ! video/x-raw ! videoconvert ! video/x-raw, format=BGR ! appsink max-buffers=1 drop=True",cv2.CAP_GSTREAMER)

In forum I also saw using queue like this;

! queue max-size-buffers=1 leaky=downstream !

Where should I put this queue? (I looked in forum It is recommendable to put them before and after computation intensive elements that operate on CPU ) Should I use this and where put I am ?

Also this is my camera properties. Can someone check this above pipeline?


Thanks for helping, Best regards

Check below doc for camera pipeline for CSI camera.

I inspected but I didn’t find about queue size.

You may check the queue element