解决:报错cv2.error: OpenCV(4.1.2) error: (-215:Assertion failed) _img.empty() in function ‘cv::imwrite
frame=cv2.resize(frame,(960,540))百度查看一篇博客这样写都检查一篇发现没问题,折腾了半天,才明白视频取到最后一帧了,frame为None,只需要加上一行代码即可:ifframeisNone:breakelse:frame=cv2.resize(frame,(960,540))