Introduce Commands type
This commit is contained in:
@@ -9,14 +9,13 @@ from tqdm import tqdm
|
||||
from facefusion import logger, process_manager, state_manager, wording
|
||||
from facefusion.filesystem import get_file_format, remove_file
|
||||
from facefusion.temp_helper import get_temp_file_path, get_temp_frames_pattern, resolve_temp_frame_paths
|
||||
from facefusion.typing import AudioBuffer, Fps, OutputVideoPreset, UpdateProgress
|
||||
from facefusion.typing import AudioBuffer, Commands, Fps, OutputVideoPreset, UpdateProgress
|
||||
from facefusion.vision import count_trim_frame_total, detect_video_duration, restrict_video_fps
|
||||
|
||||
|
||||
def run_ffmpeg_with_progress(args: List[str], update_progress : UpdateProgress) -> subprocess.Popen[bytes]:
|
||||
def run_ffmpeg_with_progress(commands : Commands, update_progress : UpdateProgress) -> subprocess.Popen[bytes]:
|
||||
log_level = state_manager.get_item('log_level')
|
||||
commands = [ shutil.which('ffmpeg'), '-hide_banner', '-nostats', '-loglevel', 'error', '-progress', '-' ]
|
||||
commands.extend(args)
|
||||
commands = [ shutil.which('ffmpeg'), '-hide_banner', '-nostats', '-loglevel', 'error', '-progress', '-' ] + commands
|
||||
process = subprocess.Popen(commands, stderr = subprocess.PIPE, stdout = subprocess.PIPE)
|
||||
|
||||
while process_manager.is_processing():
|
||||
@@ -39,10 +38,9 @@ def run_ffmpeg_with_progress(args: List[str], update_progress : UpdateProgress)
|
||||
return process
|
||||
|
||||
|
||||
def run_ffmpeg(args : List[str]) -> subprocess.Popen[bytes]:
|
||||
def run_ffmpeg(commands : Commands) -> subprocess.Popen[bytes]:
|
||||
log_level = state_manager.get_item('log_level')
|
||||
commands = [ shutil.which('ffmpeg'), '-hide_banner', '-nostats', '-loglevel', 'error' ]
|
||||
commands.extend(args)
|
||||
commands = [ shutil.which('ffmpeg'), '-hide_banner', '-nostats', '-loglevel', 'error' ] + commands
|
||||
process = subprocess.Popen(commands, stderr = subprocess.PIPE, stdout = subprocess.PIPE)
|
||||
|
||||
while process_manager.is_processing():
|
||||
@@ -59,9 +57,8 @@ def run_ffmpeg(args : List[str]) -> subprocess.Popen[bytes]:
|
||||
return process
|
||||
|
||||
|
||||
def open_ffmpeg(args : List[str]) -> subprocess.Popen[bytes]:
|
||||
commands = [ shutil.which('ffmpeg'), '-loglevel', 'quiet' ]
|
||||
commands.extend(args)
|
||||
def open_ffmpeg(commands : Commands) -> subprocess.Popen[bytes]:
|
||||
commands = [ shutil.which('ffmpeg'), '-loglevel', 'quiet' ] + commands
|
||||
return subprocess.Popen(commands, stdin = subprocess.PIPE, stdout = subprocess.PIPE)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user