uvc 4k 应用

Viewed 21

问题描述


uvc的4k应用,跑几秒钟就卡死了,UVC有没有DMA的API操作,或者能不能提供一个方案,让k230可以跑通UVC的4K 应用

硬件板卡


01studio

软件版本


CanMV_K230_01Studio_micropython_local_nncase_v2.9.0.img

1 Answers

你好,方便贴一下程序吗?

MediaManager.init()
mode = UVC.video_mode(3840, 2160, UVC.FORMAT_MJPEG, 30)
succ, mode = UVC.select_video_mode(mode)
print(f"select mode success: {succ}, mode: {mode}")

UVC.start(cvt = True)
while True:
clock.tick()

img = None
while img is None:
    try:
        img = UVC.snapshot()

    except:
        print("drop frame")
        continue
img = csc.convert(img)
img.__del__()
gc.collect()

print(f"fps: {clock.fps()}")

有600个字符限制,去掉了无关的代码。我现在把帧率设置成10,程序才能跑的起来

方便看一下串口0的日志吗?115200的波特率

初始化GPIO按键...
vb common pool count 3
detect USB Camera XIFT#4k Camera
select mode success: True, mode: {"width":3840, "height":2160, "format":mjpeg, "fps":30.00}
fps: 9.144701
fps: 9.379885
fps: 9.600808
fps: 9.80873
fps: 10.00476
fps: 10.18519
fps: 10.36036
fps: 10.5217
fps: 10.6792
fps: 10.82882
fps: 10.96669
fps: 11.0979
fps: 11.22726
fps: 11.34645
fps: 11.4645
fps: 11.57324
fps: 11.68142
fps: 11.7851
fps: 11.88052
fps: 11.97605
fps: 12.06784
fps: 12.15611
现在在办公室,比现场好一点,能执行30次,因为字数限制,删掉了一部分,执行到这里就卡死了