mirror of
https://github.com/facefusion/facefusion.git
synced 2026-07-28 21:08:54 +02:00
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
import itertools
|
|
import shutil
|
|
from typing import List
|
|
|
|
from facefusion.types import Command
|
|
|
|
|
|
#todo: no review needed - [probing] 100% copy of v4 ffprobe_builder except select_video_stream and show_format_entries
|
|
def run(commands : List[Command]) -> List[Command]:
|
|
return [ shutil.which('ffprobe'), '-loglevel', 'error' ] + commands
|
|
|
|
|
|
def chain(*commands : List[Command]) -> List[Command]:
|
|
return list(itertools.chain(*commands))
|
|
|
|
|
|
#todo: needs review - [probing] [critical: low] new against v4, selects the first video stream
|
|
def select_video_stream() -> List[Command]:
|
|
return [ '-select_streams', 'v:0' ]
|
|
|
|
|
|
def show_entries(entries : List[str]) -> List[Command]:
|
|
return [ '-show_entries', 'stream=' + ','.join(entries) ]
|
|
|
|
|
|
#todo: needs review - [probing] [critical: low] new against v4, container format entries
|
|
def show_format_entries(entries : List[str]) -> List[Command]:
|
|
return [ '-show_entries', 'format=' + ','.join(entries) ]
|
|
|
|
|
|
def format_to_value() -> List[Command]:
|
|
return [ '-of', 'default=noprint_wrappers=1:nokey=1' ]
|
|
|
|
|
|
def format_to_key_value() -> List[Command]:
|
|
return [ '-of', 'default=noprint_wrappers=1' ]
|
|
|
|
|
|
def set_input(input_path : str) -> List[Command]:
|
|
return [ '-i', input_path ]
|