diff --git a/DeepEncode.py b/DeepEncode.py index af33636..57784e6 100644 --- a/DeepEncode.py +++ b/DeepEncode.py @@ -57,10 +57,11 @@ def predict_frame(uncompressed_frame): cap = cv2.VideoCapture(UNCOMPRESSED_VIDEO_FILE) total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) height, width = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)), int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) +fps = int(cap.get(cv2.CAP_PROP_FPS)) cap.release() fourcc = cv2.VideoWriter_fourcc(*'XVID') -out = cv2.VideoWriter(COMPRESSED_VIDEO_FILE, fourcc, 24.0, (width, height), True) +out = cv2.VideoWriter(COMPRESSED_VIDEO_FILE, fourcc, fps, (width, height), True) if not out.isOpened(): print("Error: VideoWriter could not be opened.")