From e1fe76407b5ca0daaf0ec93086b4a22c59c05b6d Mon Sep 17 00:00:00 2001 From: mr-d-luffy Date: Tue, 16 Dec 2025 00:07:34 +0530 Subject: [PATCH 1/3] comments --- encrypter_decrypter_gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/encrypter_decrypter_gui.py b/encrypter_decrypter_gui.py index 75d10d37839..48504895408 100644 --- a/encrypter_decrypter_gui.py +++ b/encrypter_decrypter_gui.py @@ -257,6 +257,7 @@ def backend_work(self, todo, text_coming): # ==================== Classes End Here ... ! ================= +# this code runes only in this file if __name__ == "__main__": run = Main() Notebook(run) From 4565548ffca2c86598eaf5f1bf1aa3621a07e448 Mon Sep 17 00:00:00 2001 From: mr-d-luffy Date: Wed, 17 Dec 2025 00:00:46 +0530 Subject: [PATCH 2/3] increased video Frame rate 20 to 60 and changed Video output Color format grey to color BGRA. --- webcam.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/webcam.py b/webcam.py index 30a89df27f4..f9f6a66be26 100644 --- a/webcam.py +++ b/webcam.py @@ -6,6 +6,7 @@ # Improve this program and make it suitable for general module like use in another programs import cv2 +from colorama import Fore cap = cv2.VideoCapture(0) @@ -17,8 +18,13 @@ # FourCC is platform dependent; however, MJPG is a safe choice. fourcc = cv2.VideoWriter_fourcc(*"MJPG") -# Create video writer object. Save file to recording.avi -out = cv2.VideoWriter("recording.avi", fourcc, 20.0, (frames_width, frames_height)) +# exception Handling for captured video +try: + # 60 FPS video capture + # Create video writer object. Save file to recording.avi + out = cv2.VideoWriter("recording.avi", fourcc, 60.0, (frames_width, frames_height)) +except(Exception) as e: + print(Fore.RED, e, Fore.RESET) while True: # Capture frame-by-frame @@ -27,9 +33,10 @@ if ret == True: # Write frame to recording.avi out.write(frame) - + + # color video output # Our operations on the frame come here - gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) + gray = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA) # Display the resulting frame cv2.imshow("frame", gray) @@ -40,3 +47,4 @@ cap.release() out.release() cv2.destroyAllWindows() + From b19f69e795f5d3c697d0c30780a22fa4688f5dab Mon Sep 17 00:00:00 2001 From: mr-d-luffy Date: Wed, 17 Dec 2025 00:05:45 +0530 Subject: [PATCH 3/3] press space to quit video window --- webcam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webcam.py b/webcam.py index f9f6a66be26..d1aa682caac 100644 --- a/webcam.py +++ b/webcam.py @@ -40,7 +40,7 @@ # Display the resulting frame cv2.imshow("frame", gray) - if cv2.waitKey(1) & 0xFF == ord("q"): + if cv2.waitKey(1) & 0xFF == ord(" "): break # When everything is done, release the capture and video writer