Closed ramnamaqsood776 closed 5 years ago
You need to give image frames in numpy or PIL fotmat. So you need to extract frames form video of format .mp4 first.
import cv2 def load_video(video_path):
cap = cv2.VideoCapture(video_path)
ret, frame = cap.read()
frame_list=[]
while ret == True:
ret, frame = cap.read()
frame_list.append(frame)
#cap.release()
print(len(frame_list))
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH) # float
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT) # float
cap.release()
return frame_list, width,height
Hello Can you please guide me that why this code is not running for .mp4 format? Thank you