From d1ead35a10dbc587868ff3bcded45d76f4b695a1 Mon Sep 17 00:00:00 2001 From: Mostafa Elsaadouny Date: Tue, 15 Aug 2023 20:43:38 +0200 Subject: [PATCH] png frames extraction --- inference.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inference.py b/inference.py index 3c457a6..3670078 100644 --- a/inference.py +++ b/inference.py @@ -45,7 +45,7 @@ def extract_frames_from_video(video_path, save_dir): os.makedirs(save_dir, exist_ok=True) # Construct the ffmpeg command ffmpeg_command = ["ffmpeg", "-i", video_path, - os.path.join(save_dir, "%06d.jpg")] + os.path.join(save_dir, "%06d.png")] # Run the ffmpeg command subprocess.run( @@ -114,7 +114,7 @@ def extract_frames_from_video(video_path, save_dir): # align frame with driving audio logging.info("aligning frames with driving audio") - video_frame_path_list = glob.glob(os.path.join(video_frame_dir, "*.jpg")) + video_frame_path_list = glob.glob(os.path.join(video_frame_dir, "*.png")) if len(video_frame_path_list) != video_landmark_data.shape[0]: raise ValueError("video frames are misaligned with detected landmarks") video_frame_path_list.sort()