Create v4l2loopback device for nvarguscamerasrc

I’m trying to create a video loopback device for the NVIDIA nvarguscamerasrc device using gstreamer. I’ve had limited success but have hit a wall. I can create the loopback device and view it, but I can’t access the virtual device like I’d expect. My goal is to ultimately be able to access the CSI camera from motion or zoneminder as if it were a local camera device (/dev/video3). However, it seems these packages are expecting the video to be in a different format than what the loopback device is providing and I’m not sure where I’m going wrong. Here is the code to create the loopback device:

gst-launch-1.0 -v nvarguscamerasrc
! ‘video/x-raw(memory:NVMM),width=3264, height=2464, framerate=21/1, format=NV12’
! nvvidconv flip-method=0
! ‘video/x-raw, width=320, height=240, format=BGRx’
! videoconvert
! ‘video/x-raw, format=I420’
! v4l2sink device=/dev/video3

and here is the command I can use to view it:

gst-launch-1.0 v4l2src device=/dev/video3 ! videoconvert ! ximagesink

However, zoneminder and motion dont’ recognize /dev/video3 as a valid camera source. What am I doing wrong? Additionally, I tried creating an RTSP source and using that. I’ve been able to get that to work with motion, but not zoneminder. I’m using the test-launch.c project as a starting point for this:

./gst-rtsp-launch1 -p 8765 “nvarguscamerasrc maxperf=true sensor-id=0
! video/x-raw(memory:NVMM), format=NV12, width=3264, height=2464, framerate=21/1
! nvvidconv
! video/x-raw, width=640, height=480, format=NV12, framerate=21/1
! omxh264enc
! rtph264pay name=pay0 pt=96 config-interval=1”

Any help would be greatly appreciated, I’ve been hacking away at this for the past 2 1/2 weeks.

NOTE: the /dev/video3 device does seem to be working actually for motion. I just can’t figure out why it isn’t working in zoneminder.

Have a reference to below link for the v4l2sink

Have a reference to below link for the rtsp