From a58f11ac0e4bc7d7851e0a4c330ce33f2f1e09d0 Mon Sep 17 00:00:00 2001 From: jimmy Date: Sat, 23 Jul 2022 04:08:20 +1200 Subject: [PATCH] Remove multiprocessing --- slave/video.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/slave/video.py b/slave/video.py index 5fd7444..6b41037 100644 --- a/slave/video.py +++ b/slave/video.py @@ -45,7 +45,8 @@ class Video: cv2.imshow("window", frame) - cv2.waitKey(int(delay)) + if cv2.waitKey(int(delay)) == ord('q'): + break # Break the loop else: @@ -58,13 +59,5 @@ class Video: if __name__ == "__main__": video = Video(0, 0) - x = multiprocessing.Process(target = video.start, args=("slave/videos/sample-mp4-file.mp4",)) - x.start() - time.sleep(2) - x.terminate() - time.sleep(1) - video = Video(4000, 0) - x = multiprocessing.Process(target = video.start, args=("slave/videos/sample-mp4-file.mp4",)) - x.start() - time.sleep(1) - x.terminate() + video.start("slave/videos/sample-mp4-file.mp4") + \ No newline at end of file