How to display multiple cameras?

Hi,
I have tested single camera on display using the below command:
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nvoverlaysink -ev

gst-launch-1.0 v4l2src device=/dev/video1 ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nvoverlaysink -ev

gst-launch-1.0 v4l2src device=/dev/video2 ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nvoverlaysink -ev

gst-launch-1.0 v4l2src device=/dev/video3 ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nvoverlaysink -ev

Now i want to display the four cameras at the same time, Could you tell me which command i should use?
Thanks

Hello @zhaocuiqin ,

There is related subject in the below link.I didnt try whether it is working or not. It might be helpful for you.

Regards.

1 Like

You may use nvcompositor.
Be sure the final resolution doesn’t exceed your monitor resolution.
Try :

gst-launch-1.0 -v \
nvcompositor name=mix \
sink_0::xpos=0    sink_0::ypos=0   sink_0::width=1280 sink_0::height=720 \
sink_1::xpos=1280 sink_1::ypos=0   sink_1::width=1280 sink_1::height=720 \
sink_2::xpos=0    sink_2::ypos=720 sink_2::width=1280 sink_2::height=720 \
sink_3::xpos=1280 sink_3::ypos=720 sink_3::width=1280 sink_3::height=720 \
! 'video/x-raw(memory:NVMM),format=RGBA,width=2560,height=1440,framerate=30/1' ! nvvidconv ! nvoverlaysink \
videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=1280,height=720,pixel-aspect-ratio=1/1' ! queue ! mix.sink_0 \
videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=1280,height=720,pixel-aspect-ratio=1/1' ! queue ! mix.sink_1 \
videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=1280,height=720,pixel-aspect-ratio=1/1' ! queue ! mix.sink_2 \
videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=1280,height=720,pixel-aspect-ratio=1/1' ! queue ! mix.sink_3

and when it works, just change the sources to your cams instead of videotestsrc.
Since you’re using UYVY sensors, you may use nvv4l2camerasrc:

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1' ! ...