From 4091a630137400dfac389215a7ec8c43b191ec5f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 11 Mar 2020 09:48:10 +0200 Subject: py/cam.py: get w & h from cmdline --- py/tests/cam.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'py/tests') 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() -- cgit v1.2.3