I used the AGX and Xavier NX to get the video from two Logitech Webcam usb cameras and detect the objects in the videos with opencv using yolov5 model ,then I want to display the two streams in the same hdmi device.
I know I can use the nvdrmvideosink to playback one usb stream(I not work in desktop environment, I want show the video directly after the machine boot), but how to display two usb videos in one hdmi screen? Is there one way to split the screen , such as some parameters to control the display positions for any one stream?
I’m afraid what you want will not be easy because of that. You may consider redesigning in multi-thread using the same process memory space.
If you can’t do this, I see 2 possible workarounds without a GUI.
If your monitor supports PIP mode and has both a HDMI and a DP inputs, you may split monitor into 2 displays (one for HDMI and one for DP, Xavier-NX devkit has both connectors, use 2 cables), then use nvdrmvideosink property conn-id for displaying frames into the wanted display. Not sure if the monitor will properly keep that PIP/inputs config upon wake up, though.
Second workaround would be using shmsink/shmsrc for interprocess. You would do something like:
Be aware that this may cost CPU usage… and you may have to manage the deletion of sockets (producer would only clean if the consumer no longer uses it…May be better creating your named sockets beforehand, not tested though).