run_parallel_capture.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:OverviewOne 作者: SpaceVR-O1 项目源码 文件源码
def do_onecam(i, offset_ms):
    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.yuyv" % (i)
    p = subprocess.Popen(
            ["sudo", "./snapshot", filename, "--dev", ("/dev/still%d" % i), "--format", "yuyv", "--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")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号