Skip to content

Commit eeec2b1

Browse files
committed
Exit cleanly on non-RPi picam dry runs
1 parent 555ab4c commit eeec2b1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/ac_training_lab/picam/device.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ def call_lambda(action, CAM_NAME, WORKFLOW_NAME, privacy_status="private"):
177177

178178
print(f"Streaming to: {ffmpeg_url}")
179179

180+
if not shutil.which("rpicam-vid") and not shutil.which("libcamera-vid"):
181+
print("No Raspberry Pi camera command found; exiting after Lambda dry-run")
182+
raise SystemExit(0)
183+
180184
while True:
181185
print("Starting stream..")
182186
p1, p2 = start_stream(ffmpeg_url)

0 commit comments

Comments
 (0)