Slow capture video from camera via OpenCV IMX 8 Mini EVK

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Slow capture video from camera via OpenCV IMX 8 Mini EVK

1,500 次查看
SYakubson
Contributor II

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()
标记 (1)
0 项奖励
回复
2 回复数

1,491 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello SYakubson,

You are using /dev/video1 this is for USB or remove the data np.zeros.

 

Regards

0 项奖励
回复

1,486 次查看
SYakubson
Contributor II

@Bio_TICFSL in my code everywhere video0
I try to use it without numpy arrays, work similar

0 项奖励
回复