File size: 827 Bytes
773f76d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import itertools
import shutil
from typing import List

from facefusion.types import Command


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))


def select_stream(stream : str) -> List[Command]:
	return [ '-select_streams', stream ]


def show_stream_entries(entries : List[str]) -> List[Command]:
	return [ '-show_entries', 'stream=' + ','.join(entries) ]


def show_format_entries(entries : List[str]) -> List[Command]:
	return [ '-show_entries', 'format=' + ','.join(entries) ]


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 ]