Efficient Video Sharing Between Processes on Jetson Xavier NX (Zero Copy or GPU-based Methods

I have Process 1 reading the camera using the following pipeline:

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 name=src1 ! ‘video/x-raw(memory:NVMM),width=3840,height=2160,format=UYVY,framerate=30/1’ ! nvvidconv interpolation-method=4 ! ‘video/x-raw(memory:NVMM),width=1920,height=1080,format=UYVY,framerate=30/1’ ! nvvidconv interpolation-method=4 ! ‘video/x-raw,format=BGRx,width=1920,height=1080’ ! videoconvert ! ‘video/x-raw, format=(string)xRGB’ ! identity drop-allocation=true ! v4l2sink device=/dev/video4 sync=false

Process 2 then receives this video stream by using:

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 name=src1 ! ‘video/x-raw(memory:NVMM),width=3840,height=2160,format=UYVY,framerate=30/1’ ! nvvidconv interpolation-method=4 ! ‘video/x-raw(memory:NVMM),width=1920,height=1080,format=UYVY,framerate=30/1’ ! nvvidconv interpolation-method=4 ! ‘video/x-raw,format=BGRx,width=1920,height=1080’ ! videoconvert ! ‘video/x-raw, format=(string)xRGB’ ! identity drop-allocation=true ! v4l2sink device=/dev/video4 sync=false

I am using v4l2loopback, but it consumes a lot of CPU when video node 4 is accessed by multiple processes. My question is: Is there a more efficient way to share video between processes with minimal resource consumption? For example, methods like zero copy, using Jetson multiple API libraries, or leveraging GPU or hardware engines? I am currently using Jetson Xavier NX

Hi,
Yo may consider use sharing NVBufSurface between processes. We have a sample in jetson_multimedia_api. Please install Jetpack 5.1.4 and check

/usr/src/jetson_multimedia_api/samples/13_argus_multi_camera/

@DaneLLL How can I read the camera nvv4l2camerasrc device=/dev/video0 using the Argus library in the execute() function in 13_argus_multi_camera ?"

Hi,
You would need to check 13 sample to know how to share NvBufSurface between processes, and do the porting. Please try

  1. Make sure your camera can be launched in running 12_camera_v4l2_cuda
  2. Port the mechanism of sharing NvBufSurface from 13 sample to 12 sample
1 Like

Thanks I will try it and give you feedback @DaneLLL

Is there a similar example on jetpack 4.6.0?

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