kill with sigterm. larger ring-buffer.

workspace
Brendan Howell 8 years ago
parent 664461f304
commit 21a9f8740c

@ -1,6 +1,7 @@
import os
import subprocess
import shutil
import signal
import tempfile
import time
@ -34,6 +35,7 @@ class Photography(Bureau):
# set up the gpios for lamp & knobs
gpio.init()
gpio.setcfg(self.doc_light_pin, gpio.OUTPUT)
gpio.output(self.doc_light_pin, gpio.LOW)
def _doc_light_on(self):
@ -65,12 +67,12 @@ class Photography(Bureau):
mjpg = os.path.join(modpath, "..", "..", "lib", "mjpg-streamer",
"mjpg-streamer-experimental", "mjpg_streamer")
mjpg_dir = os.path.dirname(mjpg)
cmd = mjpg.split() + ["-i", "input_uvc.so -r 3264x2448 -n", "-o", "output_file.so -f /tmp/webcam -d 500 -s 1"]
cmd = mjpg.split() + ["-i", "input_uvc.so -r 3264x2448 -n", "-o", "output_file.so -f /tmp/webcam -d 500 -s 2"]
print(cmd)
proc = subprocess.Popen(cmd, shell=True, env={"LD_LIBRARY_PATH": mjpg_dir})
time.sleep(2)
proc.terminate()
proc.kill(signal.SIGTERM)
time.sleep(1)
# copy last image to the tmpfile

Loading…
Cancel
Save