帧的尺寸和保存为视频的设定尺寸不一致会保存失败
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('/home/guojf/Documents/lightweight-human-pose-estimation-3d-demo.pytorch-master/output/demo.avi',fourcc, 20.0, (576,1280)
在使用OpenCV将frame保存为视频时,若帧的尺寸与设定的视频尺寸不符,会导致保存失败。解决方法是检查并确保frame的尺寸与保存参数匹配,或者在保存时动态调整尺寸。
帧的尺寸和保存为视频的设定尺寸不一致会保存失败
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('/home/guojf/Documents/lightweight-human-pose-estimation-3d-demo.pytorch-master/output/demo.avi',fourcc, 20.0, (576,1280)
1万+
1850
852
271
6855

被折叠的 条评论
为什么被折叠?
