diff --git a/lasertrack.py b/lasertrack.py index bff74d4..5f289da 100755 --- a/lasertrack.py +++ b/lasertrack.py @@ -24,7 +24,7 @@ from piCameraPipeline.VideoSource import VideoSource # construct the argument parse and parse the arguments ap = argparse.ArgumentParser() -ap.add_argument("-n", "--seconds", type=int, default=10, +ap.add_argument("-n", "--seconds", type=int, default=0, help="# of seconds to run") ap.add_argument("-r", "--framerate", type=int, default=30, help="Framerate in frame/s") @@ -216,7 +216,12 @@ if with_ev3: print("[INFO] sampling THREADED frames from `" + videoFile + "` at " + str(framerate) + " frame/s") try: - time.sleep(seconds) + if seconds != 0: + time.sleep(seconds) + else: + while True: + time.sleep(1.0) + except(KeyboardInterrupt): print ("\nKeyboardInterrupt") @@ -230,7 +235,12 @@ else: print("[INFO] sampling THREADED frames from `" + videoFile + "` at " + str(framerate) + " frame/s") try: - time.sleep(seconds) + if seconds != 0: + time.sleep(seconds) + else: + while True: + time.sleep(1.0) + except(KeyboardInterrupt): print ("\nKeyboardInterrupt")