How to capure multi-camera in one progress

Hi community:
Now I have 4 cameras, how could I capture 4 cameras(/dev/video0 - video3) in one progress like this:

I can capture only one camera using gst-launch like below:

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! videoconvert ! video/x-raw,format=I420 ! xvimagesink sync=0 

Hi,
You can use nvcompositor plugin to composite the 4 sources into single video plane. Please refer to the topic:
Gst for merging 4 webcams sometimes works, and sometimes it doesn't

Hello, @DaneLLL, please, read it.

Hi DaneLLL:
Thanks for your reply. I have tried like below:

gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=480 sink_0::height=270 \
sink_1::xpos=480 sink_1::ypos=0 sink_1::width=480 sink_1::height=270 \
! nvvidconv ! 'video/x-raw,width=960,height=270,format=I420' ! \
device=/dev/video3 ! video/x-raw,width=1280,height=720,format=UYVY ! nvvidconv ! video/x-raw,format=I420 ! queue ! comp.sink_0 \
device=/dev/video0 ! video/x-raw,width=1280,height=720,format=UYVY ! nvvidconv ! video/x-raw,format=I420 ! queue ! comp.sink_1

then I got error:

WARNING: erroneous pipeline: syntax error

Is there any example for nvcompositor using v4l2src? I just find nvcompositor using nvarguscamerasrc in Developer Guide.

Hi,
Please try this command:

gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=480 sink_0::height=270 \
sink_1::xpos=480 sink_1::ypos=0 sink_1::width=480 sink_1::height=270 \
! nvvidconv ! 'video/x-raw(memory:NVMM),width=960,height=270,format=I420' ! nv3dsink \
v4l2src device=/dev/video3 ! video/x-raw,width=1280,height=720,format=UYVY ! nvvidconv ! 'video/x-rawvideo/x-raw(memory:NVMM),format=I420' ! queue ! comp.sink_0 \
v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,format=UYVY ! nvvidconv ! 'video/x-rawvideo/x-raw(memory:NVMM),format=I420' ! queue ! comp.sink_1

For test purpose you can try with videotestsrc:

gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=480 sink_0::height=270 \
sink_1::xpos=480 sink_1::ypos=0 sink_1::width=480 sink_1::height=270 \
! nvvidconv ! 'video/x-raw(memory:NVMM),width=960,height=270,format=I420' ! nv3dsink \
videotestsrc ! video/x-raw,width=1280,height=720,format=UYVY ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! queue ! comp.sink_0 \
videotestsrc ! video/x-raw,width=1280,height=720,format=UYVY ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! queue ! comp.sink_1

Hi DaneLLL:
Thanks so much! I have tried, it works fine.

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