|
本帖最后由 woyehua 于 2025-1-16 09:38 编辑
使用python sdk编写hdmi rx的应用,只能显示几秒的画面就会报错
- [01/15 21:03:16.297] E/: (fGetstream in :256): V4l2Capture: cannot dequeue new buf ...
而且无法捕获异常,这里是什么原因?
使用的测试代码如下
- import toybrick as toy
- import time
- if __name__ == '__main__':
- count = 0
- begintime = time.time()
- hdmi = toy.HdmiCapture(1920, 1080)
- disp = toy.Display('', 1920, 1080, True)
- print("Connect display width = " + str(disp.width()) + " ; height = " + str(disp.height()))
- while True:
- #尝试在这里(hdmi.read)捕获异常,无效,应该是c代码直接error终止了进程
- ret, frame = hdmi.read(1920, 1080)
- if frame is not None:
- ret = disp.imshow(frame)
- if ret == toy.RET_TERMINATED:
- break
- count += 1
- if time.time() - begintime >= 10:
- fps = count / (time.time() - begintime)
- print('fps = ' + str(fps))
- count = 0
- begintime = time.time()
|
|