import numpy as np
import cv2
cap = cv2.VideoCapture(0)
cap.set(3,2480)
cap.set(4,1960)
print(str(cap.get(3))+" "+str(cap.get(4)))
time = 0
while time<1000:
ret,frame = cap.read()
cv2.namedWindow("clip",cv2.WINDOW_NORMAL)
cv2.imshow("clip",frame)
cv2.imwrite("C:\\Users\\Administrator\\DeskTop\\jack.jpg",frame)
cv2.waitKey(100)
time+=1
cap.release()
cv2.destroyAllWindows()
import cv2
cap = cv2.VideoCapture(0)
fourCC = cv2.VideoWriter_fourcc(*'MJPG')
out = cv2.VideoWriter("jack.avi",fourCC,5,(640,480))
while(cap.isOpened()):
ret,frame = cap.read()
out.write(frame)
cv2.imshow("jack",frame)
code = cv2.waitKey(100)
if code == ord('A'):
break;
else:
continue;
cap.release()
out.release()
cv2.destroyAllWindows()