【发布时间】:2019-03-26 16:40:09
【问题描述】:
在 Mac OS 10.13.6 上安装 opencv 后:
conda install -c conda-forge ffmpeg
conda install -c conda-forge opencv
在 videowriter 中使用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'
如何解决?
【问题讨论】:
-
据我所知,您需要 libx264 来编码 h264,默认情况下您只能解码该格式。我不确定安装 libx264 是否能解决您的问题。
-
如果OpenCV是用ffmpeg写的,那么avc1就是mp4中h264的正确标签
标签: python macos opencv ffmpeg h.264