def addFrame(self, frame, width=600):
frame = imutils.resize(frame, width)
# check if the writer is None
if self.writer is None:
# store the image dimensions, initialzie the video writer,
(self.h, self.w) = frame.shape[:2]
self.writer = cv2.VideoWriter(self.output, self.fourcc, self.fps,
(self.w, self.h), True)
# write the output frame to file
self.writer.write(frame)
评论列表
文章目录