i am creating a screen recorder for desktop in python. and i have already completed the coding part but when i record the screen why it is not recording in high defination. problem......... 1> i want to record the screen in high quality what should i do. 2> i am also trying to capute my cursor with the help on cv2.circle() but i want to create the circle with less opacity or more transparent
my code
import cv2
import numpy as np
import pyautogui
import datetime
import win32api
date=datetime.datetime.now()
SCREEN_SIZE = (960,540) #std res 1366, 768
framerate=12
# define the codec
fourcc = cv2.VideoWriter_fourcc(*'XVID')
filename='E:/project/videos/rec_%s%s%s%s%s%s.avi' %(date.year,date.month,date.day,date.hour,date.minute,date.second)
out = cv2.VideoWriter(filename, fourcc,framerate, SCREEN_SIZE)
while True:
img = pyautogui.screenshot()
frame = np.array(img)
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
_xs,_ys = win32api.GetCursorPos()
image=cv2.circle(frame,(_xs,_ys),20,(0,255,255,0.3),-1)
frame = cv2.resize(frame,(960,540)) #resize window
out.write(frame)
cv2.imshow('screenshot', frame)
if cv2.waitKey(1) == ord("q"):
break
cv2.destroyAllWindows()
out.release()