forked from amark720/Python_Projects
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenRecorder_App.py
More file actions
Latest commit
30 lines (24 loc) · 809 Bytes
/
Copy pathScreenRecorder_App.py
File metadata and controls
30 lines (24 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'''
minimize the ScreenRecorder popup window that opens after running the program so that it can capture the screen without
giving any multiple window popups recording.
'''
importcv2
importnumpyasnp
fromPILimportImageGrab
importtime
defscreenRecorder():
time.sleep(5)
fourcc=cv2.VideoWriter_fourcc(*'XVID')
out=cv2.VideoWriter("output.avi", fourcc, 5.0, (1366, 768))
# Here 5.0 is the frame rate and 1366,768 is the screen size
while (1):
img=ImageGrab.grab()
img_np=np.array(img)
frame=cv2.cvtColor(img_np, cv2.COLOR_BGR2RGB)
cv2.imshow("Screen Recorder", frame)
out.write(frame)
ifcv2.waitKey(1) ==27:
break
out.release()
cv2.destroyAllWindows()
screenRecorder()