Hello.
I have the quest, that is really confusing me more and more.
Short task description:
I need display 8 cameras at the same time on single screen.
In my app I am using libgst-1.0 library and NV-related API.
At first, I tried ways used the command line. I ran multiple screens using the sequence:
gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink &
gst-launch-1.0 nvv4l2camerasrc device=/dev/video1 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink &
gst-launch-1.0 nvv4l2camerasrc device=/dev/video2 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink &
gst-launch-1.0 nvv4l2camerasrc device=/dev/video3 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink &
gst-launch-1.0 nvv4l2camerasrc device=/dev/video4 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink &
gst-launch-1.0 nvv4l2camerasrc device=/dev/video5 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink &
gst-launch-1.0 nvv4l2camerasrc device=/dev/video6 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink &
gst-launch-1.0 nvv4l2camerasrc device=/dev/video7 ! ‘video/x-raw(memory:NVMM),format=UYVY’ ! nvvidconv ! ‘video/x-raw,format=UYVY’ ! xvimagesink
Above command sequence is fine. All works fast and with smooth streaming.
But when I try to use some composing approach (nvcompositor/compositor or nvstreammux and etc) the output result works always slower, than individual pipelines.
1.I tried many variations (something like this. Works well for 2 cameras. But have eye-noticeable lags for 6 cameras tile-screen. With 8 cameras situation is more bad):
gst-launch-1.0 compositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1920 sink_0::height=1080 \
sink_1::xpos=1920 sink_1::ypos=0 sink_1::width=1920 sink_1::height=1080 \
! ‘video/x-raw(memory:NVMM), width=1920, height=1080’ \
! nvvidconv ! ‘video/x-raw(memory:NVMM), format=UYVY’ \
! xvimagesink \
nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM), format=UYVY, width=1920, height=1080, framerate=30/1’ \
! nvvidconv ! ‘video/x-raw, format=UYVY’ ! comp.sink_0 \
nvv4l2camerasrc device=/dev/video1 ! ‘video/x-raw(memory:NVMM), format=UYVY, width=1920, height=1080, framerate=30/1’ \
! nvvidconv ! ‘video/x-raw, format=UYVY’ ! comp.sink_1
2.Or this (also works with some lags)
gst-launch-1.0
nvstreammux name=mux batch-size=10 width=480 height=270 !
nvmultistreamtiler rows=2 columns=2 width=960 height=540 !
nvvidconv ! ‘video/x-raw(memory:NVMM),width=1920,height=1080’ !
nv3dsink sync=0
v4l2src device=/dev/video0 !
‘video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY’ !
nvvidconv interpolation-method=0 !
‘video/x-raw(memory:NVMM),width=480,height=270’ ! mux.sink_0
v4l2src device=/dev/video1 !
‘video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY’ !
nvvidconv interpolation-method=0 !
‘video/x-raw(memory:NVMM),width=480,height=270’ ! mux.sink_1
v4l2src device=/dev/video2 !
‘video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY’ !
nvvidconv interpolation-method=0 !
‘video/x-raw(memory:NVMM),width=480,height=270’ ! mux.sink_2
v4l2src device=/dev/video3 !
‘video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY’ !
nvvidconv interpolation-method=0 !
‘video/x-raw(memory:NVMM),width=480,height=270’ ! mux.sink_3
Nothing works good like individual pipelines.
I really start think that is impossible to achieve a performance, which I have using individual call GST pipelines (through & delimiter for each camera). Compositors and similar approaches are terribly slower. ( I need the performance as with individual pipelines, but in tile mode in own window app).
I already started look inside the gstreamer source for better understanding the ‘magic’.
Trying to use compositors, the FPS is almost 30, but the images are flickering on each tile (4x2).
What can I do to achieve a fast render, but render all cameras in one common app-window.??
Note: I don’t use libargus, because our sensors are not ‘Bayer’ sensors.
That is the reason, why I cannot test some samples like 13_argus_multi_camera.
The 12_v4l2_camera_cuda works much slower even on single camera.
(sudo ./v4l2_camera_cuda -d /dev/video1 -s 1920x1080 -f UYVY -r 30 -c)
Thanks.