仍未解决。

python中videoCapture = cv2.VideoCapture(“video.avi”)出错

错误原因

[ERROR:0] global /build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (1071) open Could not find decoder for codec_id=56
[ERROR:0] global /build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (1103) open VIDEOIO/FFMPEG: Failed to initialize VideoCapture
[ WARN:0] global C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-1y7gm6kn\opencv\modules\videoio\src\cap_msmf.cpp (691) CvCapture_MSMF::initStream Failed to set mediaType (stream 0, (1280x720 @ 5) MFVideoFormat_RGB32(codec not found)

解决方法

修改代码为
videoCapture = cv2.VideoCapture(“video.avi”,cv2.CAP_DSHOW)
换了个电脑就可以了,感觉是因为我电脑没有摄像头的缘故?

你可能感兴趣的:(python)