definitively going somewhere.

This commit is contained in:
didier committed 2024-11-04 18:50:34 -05:00
1 parent 7179ff5fc1
commit d7017c756b
7 files changed
+139 -41

No files matched your search

+3 -14
View File
@@ -1,21 +1,10 @@
import contextlib
import time
import cv2
import logging
logger = logging.getLogger(__name__)
def create_video_writer(video_cap, output_filename):
# grab the width, height, and fps of the frames in the video stream.
frame_width = int(video_cap.get(cv2.CAP_PROP_FRAME_WIDTH))
frame_height = int(video_cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
fps = int(video_cap.get(cv2.CAP_PROP_FPS))
# initialize the FourCC and a video writer object
fourcc = cv2.VideoWriter_fourcc(*'MP4V')
writer = cv2.VideoWriter(output_filename, fourcc, fps,
(frame_width, frame_height))
return writer
def iter_frames(video_cap):
@@ -31,4 +20,4 @@ def time_tracker():
start = time.monotonic()
yield
end = time.monotonic()
print(f"Time to process 1 frame: {(end-start) * 1000:.0f} milliseconds")
logger.debug(f"Time to process 1 frame: {(end-start) * 1000:.0f} milliseconds")