0

I'm trying to capture video from a source using gstreamer pipeline and opencv. Source has properties as follows: ioctl:VIDIOC_ENUM_FMT index : 0 Type : Video capture Pixel Format : 'YUYV' Name : YUYV 4:2:2 My receiving pipeline is : ''' pipeAnalog = 'v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,interlace-mode=interleaved ! videoconvert ! video/x-raw, format=(string)BGR ! videoconvert ! appsink'''' using this pipeline, im reading the image with: '''self.currentCam = cv2.VideoCapture(self.pipeAnalog, cv2.CAP_GSTREAMER)''' After these commands, regardless of how i resize the frame using cv2.resize my frame has a black bar above it as follows : Output frame Any idea how can i get rid of this black bar? Any help would be appreciated. (I'm working on Nvidia Jetson Nano with Gstreamer Core Library version 1.14.5 and OpenCV version 4.3.0)

Thanks,

myigitgul
  • 1
  • 1
  • Does this only happen with opencv or with gstreamer only as well ? Try to get it with X display with something like: `gst-launch-1.0 videotestsrc ! video/x-raw,format=YUY2,interlace-mode=interleaved ! videoconvert ! video/x-raw,format=BGR ! videoconvert ! xvimagesink` when working remove the last videoconvert with xvimagesink and send BGR into appsink for opencv. – SeB Mar 23 '22 at 20:54
  • I've tried your pipeline and it still has the black bar. So, i'm assuming it's related to the gstreamer itself. – myigitgul Mar 24 '22 at 08:33
  • This would rule opencv out for now. You may precise if the black bar happens with videotestsrc or only with your camera. Assuming the later, try to specify a video mode (resolution + framerate). You would pick one from `v4l2-ctl -d0 --list-formats-ext`. You may also use v4l2-ctl for reading one frame and check (you may also try qv4l2). – SeB Mar 24 '22 at 11:16

0 Answers0