在Python上将分辨率更改为300x300后,我试图保存一个视频,但我的视频在保存后无法播放
0xc10100be error: "This file isn't playable. That might be because the file type is unsupported, the file extension is incorrect, or the file is corrupt."
这是我的节目:
import numpy as np
import cv2
cap = cv2.VideoCapture("F:\\mi\\Camera\\2b7d9eccaddffffe3c9ba70b7fe6c12e(0).mp4")
cv2.namedWindow("vid1", 0)
cv2.resizeWindow("vid1", 300,300)
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi', fourcc, 20.0, (300,300))
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('vid1',frame)
out.write(frame)
if cv2.waitKey(25) & 0xFF == ord('q'):
break
cap.release()
out.release()
cv2.destroyAllWindows()
怎么了
在我看来,你没有用“out”做任何事情
您应该添加:
在循环内部
在向我的老师询问这个问题后,他修改了我的程序:
谢谢你关注我的问题
相关问题 更多 >
编程相关推荐