Update utils.py

Updated the frame extraction command, with all the colorspace information needed to keep the colors of the original mp4 without changing colorspaces and/or producing gamma shifts
This commit is contained in:
NickPittas 2023-06-19 02:03:08 +03:00 committed by GitHub
parent 70108223f9
commit 1f774cf917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ def create_video(video_name, fps, output_dir):
def extract_frames(input_path, output_dir):
hwaccel_option = '-hwaccel cuda' if roop.globals.gpu_vendor == 'nvidia' else ''
input_path, output_dir = path(input_path), path(output_dir)
run_ffmpeg(f' {hwaccel_option} -i "{input_path}" "{output_dir}{sep}%04d.png"')
run_ffmpeg(f' {hwaccel_option} -i "{input_path}" pix_fmt rgb24 -sws_flags +accurate_rnd+full_chroma_int -colorspace 1 -color_primaries 1 -color_trc 1 "{output_dir}{sep}%04d.png"')
def add_audio(output_dir, target_path, video, keep_frames, output_file):