From d9cb5986ee7d09ca86dc9f23bda4b32306127430 Mon Sep 17 00:00:00 2001 From: devdesk Date: Thu, 15 Feb 2024 00:30:29 +0200 Subject: [PATCH] live working with image --- decode.py | 3 ++- run_live.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 run_live.sh diff --git a/decode.py b/decode.py index 7bacb89..7a1e0e2 100644 --- a/decode.py +++ b/decode.py @@ -179,4 +179,5 @@ else: for frame in frames: print('.') - Image.fromarray(np.frombuffer(frame, dtype='>H').reshape(WIDTH, HEIGHT)).save(f'live.png') + Image.fromarray(np.frombuffer(frame, dtype='>H').reshape(WIDTH, HEIGHT)).save(f'live.new.png') + os.rename('live.new.png', 'live.png') diff --git a/run_live.sh b/run_live.sh new file mode 100755 index 0000000..5974e66 --- /dev/null +++ b/run_live.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd $(dirname $0) +sudo ./venv/bin/python ./decode.py --live