Hello! I tried to catch video from nxp csi camera via opencv, but it works too slow. When i paste command to catch video in terminal it works fine.
Code to terminal:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, framerate=30/1,width=1920,height=1080 ! videoconvert ! waylandsink
OpenCV code:
import cv2
import numpy as np
pipeline = 'v4l2src device=/dev/video0 ! video/x-raw, framerate=30/1,width=1920,height=1080 ! videoconvert ! appsink'
camera = cv2.VideoCapture(pipeline, cv2.CAP_ANY)
data = np.zeros((1920, 1080))
while True:
success, data = camera.read()
if(success == True
cv2.imshow("Image", data)
if cv2.waitKey(1) == 27:
break
print(success)
cv2.destroyAllWindows()
camera.release()