H264编码/录像

Viewed 231

重现步骤

环境说明:
硬件:庐山派K230
固件:CanMV-K230_LCKFB_micropython_v1.2.2-0-g4b8cae1_nncase_v2.9.0.img

VENC 的 例程 1代码中:
问题1:sensor.set_framesize(width=width, height=height, alignment=12)其中的alignment=12是什么,手册中都是默认0就好为什么这里要设置为12
问题2:sensor、encoder 、link、MediaManager、streamData等创建或销毁有没有固定顺序要求,为什么我想在frame_count 计数0-400过程中,只编码存储0-100和300-400帧时,初次上电运行好用但是第二次运行就会报错:
RuntimeError: MediaManager, vb config failed(-1610317806), at now please reboot the board to fix it.

硬件:庐山派K230
固件:CanMV-K230_LCKFB_micropython_v1.2.2-0-g4b8cae1_nncase_v2.9.0.img

错误日志

尝试解决过程

补充材料

1 Answers

问题1:

alignment=12 中的 alignment 指的是图像帧数据在内存中的对齐方式,其中的 12 表示 2 的 12 次方,即 4096 字节,也就是 4K 对齐。设置为 4K 对齐的原因是编码器硬件要求:输入的图像必须 4K 对齐。这里 sensor 的输出图像会作为编码器的输入图像。

问题2:

请将 demo 中的 MediaManager.deinit() 修改为 MediaManager.deinit(True)。在下一个版本中,MediaManager.deinit 的默认参数值将为 True