- run forever if --seconds==0
git-svn-id: http://moon:8086/svn/software/trunk/projects/opencv@348 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+13
-3
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user