fix: UnboundLocalError

This commit is contained in:
soumik12345 committed 2025-04-25 02:29:08 +05:30
1 parent 49d5505efa
commit 00df1cbb04
1 file changed
+5 -7
+5 -7
View File
@@ -234,13 +234,11 @@ def process_video(
source_path=source_path, end=max_frames
)
with VideoSink(target_path=target_path, video_info=source_video_info) as sink:
if show_progress:
# Calculate total_frames only when needed for tqdm
total_frames = (
min(source_video_info.total_frames, max_frames)
if max_frames is not None
else source_video_info.total_frames
)
total_frames = (
min(source_video_info.total_frames, max_frames)
if max_frames is not None
else source_video_info.total_frames
)
for index, frame in enumerate(
tqdm(
video_frames_generator,