opencv vpudec appsink

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

opencv vpudec appsink

934 Views
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 Kudos
3 Replies

923 Views
joanxie
NXP TechSupport
NXP TechSupport

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

0 Kudos

920 Views
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 Kudos

903 Views
joanxie
NXP TechSupport
NXP TechSupport
0 Kudos