opencv vpudec appsink

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

opencv vpudec appsink

1,014 次查看
coindu
Contributor IV

Hi    

           I want to use python-opecv to displayer video frame with vpudec.  but only use vpudec as appsink input,the color will be black and white;When add videoconvert after vpudec the displayer will

 be very slow.

 

          environment BSP 5.4.3 opencv version 4.2.0

          Anyone who can help me fix it?

         

···

#!/usr/bin/env python3
import cv2
if __name__ == '__main__':

mode = r'filesrc location=/home/root/qq.mp4 typefind=true ! video/quicktime ! aiurdemux ! queue ! h264parse ! vpudec ! appsink'
#mode = r'filesrc location=/home/root/qq.mp4 typefind=true ! video/quicktime ! aiurdemux ! queue ! h264parse ! vpudec ! videoconvert ! queue ! appsink'
cap = cv2.VideoCapture(mode,cv2.CAP_GSTREAMER)
while True:
ret,frame = cap.read()
a=len(frame.shape)
print(a)

if ret is False:
break

cv2.imshow('appFrame',frame)
key = cv2.waitKey(20)
if key == 49:
cv2.destroyAllWindows()
cap.release()

 ···

0 项奖励
3 回复数

1,003 次查看
joanxie
NXP TechSupport
NXP TechSupport

what board do you use? did you install phyton2 opencv successfully on yocto, right?

0 项奖励

1,000 次查看
coindu
Contributor IV

     IMX8MM and IMX8MQ board to test. 

     Of cause ,the python opecv installed sucuess. Because I have run the python script on the platform.

 

     I'm just confused about the situation now. 

0 项奖励

983 次查看
joanxie
NXP TechSupport
NXP TechSupport
0 项奖励