代码:
fourcc = cv2.VideoWriter_fourcc('M', 'P', '4', 'V')
问题描述:
利用python 的opencv包把图片合并为视频(mp4格式)时出现如下报错:
OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
解决办法:
将'M', 'P', '4', 'V'改成小写即可