Replaced ProgressBar with the standard tqdm library for enhanced user experience #3

This commit is contained in:
Xavi Vinaixa
2023-06-05 09:18:23 +02:00
parent 50ab0e1fbe
commit 1c03fe3f1b

View File

@@ -58,6 +58,7 @@ class Refacer:
cap = cv2.VideoCapture(video_path)
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
print(f"Total frames: {total_frames}")
fps = cap.get(cv2.CAP_PROP_FPS)
frame_width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
@@ -70,7 +71,7 @@ class Refacer:
while cap.isOpened():
flag, frame = cap.read()
if flag and len(frame)>0:
pos_frame = cap.get(cv2.CAP_PROP_POS_FRAMES)
pos_frame = int(cap.get(cv2.CAP_PROP_POS_FRAMES))
pbar.update(pos_frame)