DeepEncode.py FPS fix
This commit is contained in:
parent
f06d3ae504
commit
a8acf220b2
1 changed files with 2 additions and 1 deletions
|
@ -57,10 +57,11 @@ def predict_frame(uncompressed_frame):
|
||||||
cap = cv2.VideoCapture(UNCOMPRESSED_VIDEO_FILE)
|
cap = cv2.VideoCapture(UNCOMPRESSED_VIDEO_FILE)
|
||||||
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
|
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))
|
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()
|
cap.release()
|
||||||
|
|
||||||
fourcc = cv2.VideoWriter_fourcc(*'XVID')
|
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():
|
if not out.isOpened():
|
||||||
print("Error: VideoWriter could not be opened.")
|
print("Error: VideoWriter could not be opened.")
|
||||||
|
|
Reference in a new issue