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()
···
what board do you use? did you install phyton2 opencv successfully on yocto, right?
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.
one can refer to the command from the link as below:
https://community.nxp.com/t5/i-MX-Processors/OpenCV-and-GStreamer-on-iMX8QM-MEK/m-p/1179587