When we run this script (as the normal Pi user) in the terminal or Raspberry GUI, the result (the movie) could be viewed within OMXPlayer.
But when this script is fired trough an event in Domoticz, the result is not viewable because Domoticz makes the permissions of the movie only viewable for the root user. With a chmod 775 command the movie could be viewed but for each movie it's very complex to do this.
And every file/movie has another name (with date and time stamp).
See script below.
What's the solution for this?
Thanks for the help and kind regards,
John
Code: Select all
#!/usr/bin/python
from time import sleep
from datetime import datetime
from picamera import PiCamera
camera = PiCamera()
timestamp = datetime.now().strftime("%d-%m-%y_%H:%M:%S")
camera.start_recording("/home/pi/Videos/Motion/{}.h264".format(timestamp))
sleep(20)
camera.stop_recording()