I am using a 3G-SDI camera which is giving output in YV12 format. I can view the image when i run the following command :
gst-launch-1.0 v4l2src io-mode=2 device=/dev/video1 ! video/x-raw,width=1920,height=1080,format=YV12 ! xvimagesink sync=false&
But if i am getting error when i try to do the following :
A.
gst_str = ('v4l2src device=/dev/video1 ! ’
'video/x-raw, width=(int)1920, height=(int)1080, format=(string)YV12 ! ’
‘xvimagesink sync=false !’ ‘appsink’)
return cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)
Error Message : GStreamer warning: Error opening bin: could not link xvimagesink0 to appsink0
B. gst_str = ('v4l2src device=/dev/video1 ! ’
‘video/x-raw, width=(int)1920, height=(int)1080, format=(string)YV12 ,framerate=(fraction)30/1 ! ’
‘videoconvert ! video/x-raw !’ ’ appsink’)
return cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)
Error Message : GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory.
But the above command works for USB camera which is in UYVY format.
C. gst_str = ('v4l2src device=/dev/video1 ! ’
'video/x-raw, width=(int){},height=(int)1920,format=(string)1080,framerate=(fraction)30/1 ! ’
‘nvvidconv !’
'video/x-raw, width=(int)1920, height=(int)1080,format=(string)BGRx! ’
‘videoconvert ! appsink’)
Error: Error opening bin: could not link v4l2src0 to nvvconv0, nvvconv0 can’t handle caps video/x-raw, width=(int)1920, height=(int)1080, format=(string)YV12, framerate=(fraction)30/1
Can someone suggest what should be correct format for gst_str to read the YV12 format camera data ?
Thanks