Hello,
I have recently integrated e-CAM130_CUXVR with Jetson Xavier and I am trying to open the camera and start the video using OpenCV. Below are some of the pipeline’s that I have tried:
1. cap = cv2.VideoCapture("nvarguscamerasrc ! video/x-raw(memory:NVMM), width=2592, height=1944, "
"format=NV12, framerate=30/1 ! nvvidconv ! video/x-raw,format=(string)BGRx ! "
"videoconvert! appsink", cv2.CAP_GSTREAMER)
2. cap = cv2.VideoCapture("v4l2src device=/dev/video1 !"
"video/x-raw, format=(string)UYVY, width=(int)3840, height=(int)2160 ! nvvidconv !"
"video/x-raw(memory:NVMM), format=(string)I420, width=(int)1920, height=(int)1080 !"
"videoconvert! appsink overlay-w=1920 overlay-h=1080 sync=false",
cv2.CAP_GSTREAMER)
3. cap = cv2.VideoCapture('nvarguscamerasrc sensor-id=0 ! '
'format=(string)NV12, framerate=(fraction)120/1 ! '
'nvvidconv flip-method=0 ! '
'video/x-raw, width=(int)1920, height=(int)1080, format=(string)BGRx ! '
'videoconvert ! '
'video/x-raw, format=(string)BGR ! appsink', cv2.CAP_GSTREAMER)
4. cap = cv2.VideoCapture("gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)24/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")
Basically, I have tried a mix-match of different arguments that go into the GStreamer pipeline according to the document and other online hacks but nothing seems to work.
I have also checked the pipeline according to the document (The 4th one in the list but directly on terminal as a gst-launch-1.0 command and not opencv) and the gst-launch-1.0 command by itself works well, and the camera opens and I can see the live feed. But when I use OpenCV most of the times I get “GStreamer: unable to start pipeline in function cvCaptureFromCAM_GStreamer” error. I am using dual camera and video0 and video1 work for me from the terminal.
I have compiled OpenCV 3.4.0 from source.
Can someone please help me and let me know what could possibly be wrong in the pipeline and how I can start capturing the video?
Thank you in advance!
Cheers,
T