def get_last_frame(self): if self.cap is None: return -1 else: return int(self.cap.get(cv2.CAP_PROP_FRAME_COUNT) - self.global_video_offset) - 1