def do_onecam(i, offset_ms,iterator):
time.sleep(offset_ms/1000.0)
print("Time = %f ms : Capturing camera num %d" % (offset_ms, i))
# TODO: run the camera capture code
filename = "/media/ubuntu/VRcameraSSD/tmp/cam%d.%d" % (i,iterator)
p = subprocess.Popen(
["sudo", "./snapshot", filename, "--dev", ("/dev/still%d" % i), "--format", "jpg", "--size", str(4192), str(3104), "--suspend", "--resume"],
stdout=subprocess.PIPE)
try:
(output, err) = p.communicate(timeout=30)
output_str = output.decode("utf-8")
if re.search(r"\*FULL\*", output_str, flags=re.MULTILINE):
print("OK")
elif re.search(r"\*INCOMPLETE\*", output_str, flags=re.MULTILINE):
print("INCOMPLETE")
else:
print("*** FAILED ***")
print("Kernel log:")
#print(get_kern_log(10))
except subprocess.TimeoutExpired:
print("TIMEOUT")
评论列表
文章目录