在 Mac OS 10.13.6 上安装 opencv 后:conda install -c conda-forge ffmpegconda install -c conda-forge opencv并fourcc = cv2.VideoWriter_fourcc('h', '2', '6', '4')在视频作家中使用我得到错误:OpenCV: FFMPEG: tag 0x34363268/'h264' is not supported with codec id 27 and format 'mp4 / MP4 (MPEG-4 Part 14)'OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'如何解决?
3 回答

慕码人2483693
TA贡献1860条经验 获得超9个赞
你应该改变:
fourcc = cv2.VideoWriter_fourcc('h', '2', '6', '4')
到:
fourcc = cv2.VideoWriter_fourcc(*'avc1')
如果要使用h264
,在 Linux 中必须先安装libx264-dev
。
sudo apt-get install libx264-dev
添加回答
举报
0/150
提交
取消