dear all. we try to capture raw pictures with motioneye. therefor we wrote a script that works in the terminal but not when it is triggered by motioneeye. any suggestions. could it be done within the motioneye software itself?
from picamera2 import Picamera2, Preview
from libcamera import controls
import subprocess
import time
from datetime import datetime
from datetime import date
subprocess.run(["sudo", "systemctl", "stop", "motioneye"])
time.sleep(1)
print("now")
dt = datetime.now().strftime("%Y-%m-%d_%H-%M-00Z")
date= date.today()
print(str(dt))
picam2 = Picamera2()
camera_config = picam2.create_still_configuration(main={"size": (1920, 1080)}, lores={"size": (640, 480)}, display="lores")
picam2.configure(camera_config)
picam2.start_preview(Preview.NULL)
picam2.start()
picam2.set_controls({"AfMode": controls.AfModeEnum.Auto})
time.sleep(1)
picam2.capture_file("/home/pi/Desktop/cam1/"+str(date)+"/"+str(dt)+".jpg")
time.sleep(1)
subprocess.run(["sudo", "systemctl", "start", "motioneye"])
quit()