How to composite a Thermalcamera and a Gopro?

I would like to composite streams of 2 USB cameras. One is a thermal camera with an USB(2) port, one is a Gopro with an HDMI to USB3 adapter. Each camera alone works, see picture from the Thermalcamera, but the pipeline with nvcompositor terminates with the shown error.

If I use two cameras with the same HDMI 2 USB3 interface the pipeline works fine.

I think it is a format problem, but I am not very versed with gstreamer. It would be very nice if someone has some suggestions.

If I use both cameras in different pipelines in Python with Gstreamer the result has a great delay and very low framerate or is pending totally.

These are the data of the cameras.

Thermalcamera

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YU12'
	Name        : Planar YUV 4:2:0
		Size: Discrete 640x512
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'Y16 '
	Name        : 16-bit Greyscale
		Size: Discrete 320x256
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)

	Index       : 2
	Type        : Video Capture
	Pixel Format: 'NV12'
	Name        : Y/CbCr 4:2:0
		Size: Discrete 640x512
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)

	Index       : 3
	Type        : Video Capture
	Pixel Format: ''
	Name        : 3132564e-0000-0010-8000-00aa003
		Size: Discrete 640x512
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)

Gopro with HDMI to USB3

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x1024
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1360x768
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1400x900
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1440x900
			Interval: Discrete 0.017s (60.000 fps)
			Interval: Discrete 0.033s (30.000 fps)

Pipeline

gst-launch-1.0 nvcompositor name=mix sink_1::xpos=0 sink_1::ypos=0 \
 sink_1::width=640 sink_1::height=512  sink_1::alpha=1 ! nv3dsink \
 \
 \
 v4l2src device=/dev/video1 ! video/x-raw, framerate=30/1, width=1280, height=720 ! \
  nvvidconv ! alpha alpha=1 ! nvvidconv ! mix.sink_2 \
 \
v4l2src device=/dev/video0 ! video/x-raw, framerate=30/1, width=640, height=512  ! \
 alpha alpha=1 ! nvvidconv ! mix.sink_1 \
 \

Error message

willi@willis:~$ 
willi@willis:~$ ./testvv_boson
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason error (-5)
Execution ended after 0:00:00.314211458
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
willi@willis:~$

Best regards,
Wilhelm

I have solved the issue. The values are not ok and one of my HDMI to USB3 adapters is defect.
Best regards,
Wilhelm

B01 in action.
Best regards,
Wilhelm


Could you describe in more detail the cause of the problem? You said that the adapter is defective, but earlier you wrote “If I use two cameras with the same HDMI 2 USB3 interface the pipeline works fine.”

Ok, I bought 4 adapters, two times two pieces. From the second batch one is defective.
Best regards,
Wilhelm

When I use your pipeline I get the same error. My cameras: Boson 640 USB and
e-CAM20_CU0230 USB 3.0

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason error (-5)
Execution ended after 0:00:00.627308938
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

My nano is off, but if I remember correctly this pipeline should work. Otherwise I will check it tomorrow.
You have to edit video0 and video1. Video1 is in my case the Boson.
You can also change all values in the nvcompositor line to adjust the overlay. Alpha=0.7 is the transparency.

I think you have the Boson App too. Please post an image of your Boson taken by this app.
I am very interested in the picture.
Best regards,
Wilhelm

gst-launch-1.0 nvcompositor name=mix sink_1::xpos=10 sink_1::ypos=10 \
 sink_1::width=640 sink_1::height=512  sink_1::alpha=0.7 ! nv3dsink \
 \
 \
 v4l2src device=/dev/video0 ! video/x-raw, framerate=30/1, width=1920, height=1080 ! \
 alpha alpha=1 ! nvvidconv ! mix.sink_2 \
 \
 v4l2src device=/dev/video1 ! video/x-raw, framerate=30/1, width=640, height=512  ! \
 alpha alpha=1 ! nvvidconv ! mix.sink_1 \
 \

It works, thanks a lot!

https://yadi.sk/i/6KF0UqhiU2dytw
https://yadi.sk/i/xppG9NNyCTwCbw