diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2020-03-11 09:48:10 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2020-04-21 11:44:35 +0300 |
commit | 4091a630137400dfac389215a7ec8c43b191ec5f (patch) | |
tree | 8c35dc97de8860c96c8f6826ce339c666a44901d /py/tests | |
parent | 50b2b57ba6df5b0ef327e219390cac8aae8e28fe (diff) |
py/cam.py: get w & h from cmdline
Diffstat (limited to 'py/tests')
-rwxr-xr-x | py/tests/cam.py | 13 |
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() |