Skip to content

Commit

Permalink
png frames extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
loky-op committed Aug 15, 2023
1 parent 8060824 commit d1ead35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit d1ead35

Please sign in to comment.