<filename>main.py<gh_stars>1-10
import os

try:
    os.system("cmd /c pip install -r requirements.txt")
    os.remove("requirements.txt")

except:
    pass

import pyautogui
import os.path
import keyboard
import time
from win10toast import ToastNotifier
import pyttsx3 

noti = pyttsx3.init()
voice_set = noti.getProperty('voices')
noti.setProperty('voice', voice_set[1].id)
noti.setProperty("rate", 145)


noti.say("Screen recording started, press Control Shift and T to stop it") # using pyttsx3 to talk to you
noti.runAndWait()
ToastNotifier().show_toast("Screen recording started", "press 'Ctrl + Shift + T' to stop", duration=5)
b = 0
while True:
    # using pyautogui to take screen shots 
    video = pyautogui.screenshot()
    video.save(f"{os.getcwd()}\{b}.jpg")
    b += 1
    if keyboard.is_pressed("Ctrl + shift + t"): # press Ctrl + Shift + T to stop
        break

date = time.strftime("%H-%M-%S")
# using ffmpeg to convert those screenshots into a single video
os.system(f'cmd /c ffmpeg -i "%d.jpg" -c:v libx264 -crf 0 -filter:v "setpts=2*PTS" "{date}.mp4"')

# deleting screenshots
directory = f"{os.getcwd()}"
files_in_directory = os.listdir(directory)
filtered_files = [file for file in files_in_directory if file.endswith(".jpg")]
for file in filtered_files:
    path_to_file = os.path.join(directory, file)
    os.remove(path_to_file)
print(f"file saved as {os.getcwd()}\{date}.mp4")