what should i do, to make videoWriter could record video per 30second
hi,guy, i want to record a video per 30 seconds, but it's fail, only record about 14-16s video(about half time) how can i change my code, this is my code:
if liveWriter.isOpened() is False: # record live video
live_path = live_path + os.sep + str(recordTime).replace("-", "_").replace(" ", "_").replace(":", "_")\
+ '.avi'
liveWriter.open(live_path, fourcc, int(cap.get(cv2.CAP_PROP_FPS)),
(int(frame.shape[1]), int(frame.shape[0])))
livePathList.append(live_path)
liveWriter.write(frame)
if recordTime > live_range_end: # if now time is over the range_end time, start a new video
live_range_start, live_range_end = mod.get_time_range(datetime.datetime.now(), interval_hour=0,
interval_minute=0, interval_second=30) # get the time range
liveWriter.release()
by the way, i have 3 videoWriter in this .py file