use a shell script to avoid cli mess

workspace
Brendan Howell 8 years ago
parent a5bf35cfe4
commit bfdf637012

@ -65,14 +65,15 @@ class Photography(Bureau):
#subprocess.check_output(cmd1.split())
modpath = os.path.dirname(__file__)
mjpg = os.path.join(modpath, "..", "..", "lib", "mjpg-streamer",
"mjpg-streamer-experimental", "mjpg_streamer")
"mjpg-streamer-experimental", "run.sh")
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 2"]
print(cmd)
proc = subprocess.Popen(cmd, shell=True, env={"LD_LIBRARY_PATH": mjpg_dir})
#proc = subprocess.Popen(cmd, shell=True, env={"LD_LIBRARY_PATH": mjpg_dir})
proc = subprocess.Popen(cmd)
time.sleep(2)
proc.kill()
proc.terminate()
time.sleep(1)
# copy last image to the tmpfile

Loading…
Cancel
Save