Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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()

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()

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

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

click to hide/show revision 5
None

updated 2018-09-29 03:31:06 -0500

berak gravatar image

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: 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()

liveWriter.release()

by the way, i have 3 videoWriter in this .py file