I’m going to install the nano and two cameras at a multicopter, a vis-camera like the Gopro and a thermal camera, see photo. I will report in jetson projects.
The streaming via two HDMI-USB3 adapters from /dev/video0 and 1 works fine and very fast. However there is a black frame around the thermal image, see the screenshot. I would like remove the boarder and tried to crop the video.
This command line for instance works fine to get the images:
What is the mistake?
Are there other/better solutions to remove the boarder?
Is nvvidconv a better choise?
The best solution would be a PIP presentation (picture in picture). Does someone have a gstreamer command line for me, which displays two USB cams simultaneously?
Honey_Patouceul, thank you.
The typo is only in my post. Sorry!
I made 2 new screenshots (without internet connection and the time is wrong).
The crop basically works, but there is no (thermal)image, only a green screen.
Best regards,
Wilhelm
Glad to see you’ve got further. It’s hard to give the right command because I don’t know your camera and you give no format in caps, so it may be a bad format output from videocrop, so you may try to add videoconvert after it. It might be slow for high resolutions/framerates, however.
Since you’re already using nvvidconv, you can do the cropping with ISP. The thing is that the parameters are not the margins, but the X or Y coordinates. For top and left it is the same as videocrop, but you would set: right = width - rightMargin and bottom = height - bottomMargin,
[EDIT: For clarification, it should be:
right = left + output_width - 1
bottom = top + output_height - 1
]
so for your case:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv top=4 bottom=320 left=4 right=480 ! nvegltransform ! nveglglessink -e
#Or use a second nvvidconv for copying to CPU memory if needed:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv top=4 bottom=320 left=4 right=480 ! nvvidconv ! xvimagesink
Honey_Patouceul, thank you very much.
I’m new to gstreamer. What do mean with “you give no format in caps”
The camera was in this case a Gopro with 1920x1080 pixel. I think “width=1280,height=720” are the output pixel.
Your first line works fine, the second with the “xvimagesink” does not.
I will take your first line for further experiments. Now I try to combine two lines with two cameras for PIP.
Best regard
Wilhelm
I mean that you may have caps like: ‘video/x-raw,framerate=30/1,width=1280,height=720,format=YUY2’
You may get your camera supported modes with:
#v4l2-ctl command is provided by apt package v4l-utils, you may install it with:
sudo apt-get update
sudo apt-get install v4l-utils
#Now, get your camera formats/resolutions/framerates with:
v4l2-ctl -d /dev/video0 --list-formats-ext
Pick a supported format/resolution/framerate, or post the output of this command for further advice.
You may also try to specify I420 format as output of nvvidconv, it is supported by xvimagesink:
Honey_Patouceul, thank you again,
but that is not what I’m looking for. The margins above are only for test purpose. I want to cut to any size, not to a fixed video format, see picture.
So I’m using this line…
Since a few hours the overlay of two videofeeds with transparency works. Thank you all together for your help.
The full screen image is from a Sony RX0, the thermal camera is a Flir Vue. The alignment is not perfect at the moment.
The picture in the left bottom corner is from the r-pi V2 camera started as an extra task. This camera is very light sensitive (compared with the Sony).
Best regards,
Wilhelm