Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv2.VideoWriter.write is doing nothing

Hi, I am using python 2.7 with cv2 to record the video to file. My code is creating the file but its size is not updating it is always 0KB

Below is how I am trying

while myloop:

     sec = time.time()
     status,frame = cap.read()
     cv2.imshow("My Frame", frame)
     writer = cv2.VideoWriter(vidDir, fourcc, 30, (width,height))
     writer.write(frame)

it looks like cv2.VideoWriter.write is doing nothing. Can someone please help I want to capture the camera frames into a video file.

Thank you. harvey