def _writevideoframe(self):
if not self.is_writingvideo:
return
if self._videoWriter is None:
fps = self._capture.get(cv2.CAP_PROP_FPS)
if fps == 0.0:
# FPS???????
if self._frameElapsed < 20:
# wait until more frame elapse so that the estimate is more stable.
return
else:
fps = self._fpsEstimate
# print fps
size = (int(self._capture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(self._capture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
self._videoWriter = cv2.VideoWriter(self._videoFilename, self._videoEncoding, fps, size)
self._videoWriter.write(self._frame)
评论列表
文章目录