Mar-27-2018, 07:54 AM
I am using python 3.5 on Windows 10
I use a simple script to capture from the WebCam
It produces an avi file called output.avi
This works well
However
Using pyinstaller the exe works but the resulting avi is a blank file ie zero bytes
Can anyone help me
I use a simple script to capture from the WebCam
It produces an avi file called output.avi
This works well
However
Using pyinstaller the exe works but the resulting avi is a blank file ie zero bytes
Can anyone help me
import numpy as np import cv2 import time cap = cv2.VideoCapture(1) # Define the codec and create VideoWriter object fourcc = cv2.VideoWriter_fourcc(*'XVID') #give camera time to awaken and focus time.sleep(3) out = cv2.VideoWriter('output.avi',fourcc, 20.0, (640,480)) while(cap.isOpened()): ret, frame = cap.read() if ret==True: #frame = cv2.flip(frame,0) # write the flipped frame out.write(frame) cv2.imshow('frame',frame) #QUIT by hitting Q if cv2.waitKey(1) & 0xFF == ord('q'): break else: break # Release everything if job is finished cap.release() out.release() cv2.destroyAllWindows()