TF2 Automatic Clip Sorter Python Script

Описание к видео TF2 Automatic Clip Sorter Python Script

Obs for some reason shits itself when it is recording and clipping at the same time. So the fps of the video is absolute dogshit and I can't be bothered to do anything about it, I'm tired. Like my script works perfectly but obs wasn't lol. For example I test it on a video of me playing tf2 instead of just playing tf2 because for some reason the hotkey to clip stops working specifically when I am both recording and playing a game??? No idea why.

Anyway...

I press my hotkey to start recording clips, This activates obs and a autohotkey script that activates a batchfile running the python script. Once the python script starts, it starts importing all of the libraries (which takes a couple seconds), then opens up the last cached screenshot (The picture that pops up on the left). After that, it starts a new thread that runs the function that continuously checks for new recorded clips and if detected, it renames it and organizes it accordingly (It automatically generates a new formatted directory if it doesn't exist). Then in the main thread, it runs the meat of the script. When I'm playing tf2, if I hit my map info bind, then it automatically captures the map info screen as a png, displays it so I can see, then runs an ocr algorithm to detect what map is displayed there. Once it detects it, it displays what is detected on the cmd window, then updates the cache. Now, if you record a clip, it will use the new map info to organize it. This all continuously runs in the background seamlessly and doesn't affect the performance at all (despite what it seems in the video, the low fps was again caused by obs recording and clipping at the same time. The fps is totally fine if I'm just clipping). Finally, if I press my hotkey to stop recording clips, it stops obs and closes the batch file/python script.

I'll probably tinker with it more but I'm really tired because the keylogger tool i used from the pynput library thought that 'z' was not 'z'. Don't ask. Took me hours to fix that shit.

Python libraries used:
pyautogui
os
pynput
cv2
time
easyocr
threading
datetime

Комментарии

Информация по комментариям в разработке