I want to create VideoWriter with the following code:
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
video_writer = cv2.VideoWriter('out.mp4',fourcc,fps,(frame_width,frame_height))
but i get the error:
TypeError: VideoWriter() missing required argument 'frameSize' (pos 5)
when i change my code to:
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
video_writer = cv2.VideoWriter(filename='out.mp4',fourcc=fourcc,fps=fps,frameSize=(frame_width,frame_height))
i get another error:
TypeError: VideoWriter() missing required argument 'apiPreference' (pos 2)
so i change my code to :
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
video_writer = cv2.VideoWriter(filename='out.mp4',apiPreference=0,fourcc=fourcc,fps=fps,frameSize=(frame_width,frame_height))
i get error:
TypeError: VideoWriter() missing required argument 'params' (pos 6)
How could i solve it? Could anyone tell me how to use the api:VideoWriter()?Thanks a lot