summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpy/tests/cam.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/py/tests/cam.py b/py/tests/cam.py
index c813b2f..b7294ed 100755
--- a/py/tests/cam.py
+++ b/py/tests/cam.py
@@ -3,11 +3,20 @@
import sys
import selectors
import pykms
+import argparse
+import time
-w = 640
-h = 480
+parser = argparse.ArgumentParser()
+parser.add_argument("width", type=int)
+parser.add_argument("height", type=int)
+args = parser.parse_args()
+
+w = args.width
+h = args.height
fmt = pykms.PixelFormat.YUYV
+print("Capturing in {}x{}".format(w, h))
+
card = pykms.Card()
res = pykms.ResourceManager(card)
conn = res.reserve_connector()