Gstreamer first occurence of filled buffer

Hello,

I am having an fpga connected to xavier nx via CSI. I put timestamp into the first pixels of each frame and I would like to read it out as close to the start of pipeline as possible. My goal is to determine how much latency is adding the source element.

I am using this simple pipeline to measure the latencies. I have a timestamp in the start of frame as well as on the end of frame, so I know how much of latency is created by CSI (the actual transfer) itself. I customized to rtpvrawpay plugin to extract the timestamps from frame and to read out actual time from fpga. What I know so far is:

  • CSI latency is approximately 20 ms (video runs on 50fps)
  • Latency from the second timestamp (which is in the end of the frame) to the start of the buffer handler function of rtpvrawpay is approximately 40 ms.
WIDTH=1920
HEIGHT=1080

gst-launch-1.0 -e nvv4l2camerasrc device=/dev/video1 ! \
        "video/x-raw(memory:NVMM), format=UYVY, width=${WIDTH}, height=${HEIGHT},framerate=30/1" ! \
        nvvidconv ! \
        "video/x-raw" ! \
        queue ! \
        rtpvrawpay ! \
        queue ! \
        udpsink host=192.168.137.209 port=5010

My question is - where is the closest spot to the start of the pipeline I can read data from filled buffer? I looked on the
nvv4l2camerasrc plugin but it seems to me it’s purpose is only to allocate the right memory. I can understand that it takes some time to deliver the data to the plugin but 40 ms seems like quite a lot to me.

Thanks

Hi,
The filled buffers are got in this function call:

if (-1 == ioctl(pool->video_fd, VIDIOC_DQBUF, nv_mem->nvcam_buf->buffer))
    goto dqbuf_error;

Please use NvBuffer APIs to access the buffer.

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