I need help regarding crop and pip using two cameras at the USB ports

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