WIP fix some typing stuff
This commit is contained in:
parent
4436528512
commit
bd241c3b6f
@ -14,8 +14,10 @@ from collections import OrderedDict
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from typing import Union, Any
|
||||||
|
|
||||||
# encoding options used
|
# encoding options used
|
||||||
encoding = {
|
encoding: dict[str, Any] = {
|
||||||
"libx264": {
|
"libx264": {
|
||||||
"crf": [10, 14, 16, 18, 20, 22, 25],
|
"crf": [10, 14, 16, 18, 20, 22, 25],
|
||||||
"presets": [
|
"presets": [
|
||||||
@ -57,8 +59,8 @@ def now():
|
|||||||
|
|
||||||
def write_line(
|
def write_line(
|
||||||
codec: str,
|
codec: str,
|
||||||
crf: str,
|
crf: int,
|
||||||
preset: str,
|
preset: Union[str, int],
|
||||||
infile: str,
|
infile: str,
|
||||||
outfilesize: float,
|
outfilesize: float,
|
||||||
enctime: int,
|
enctime: int,
|
||||||
@ -70,8 +72,8 @@ def write_line(
|
|||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
codec (str): Codec used
|
codec (str): Codec used
|
||||||
crf (str): CRF used
|
crf (int): CRF used
|
||||||
preset (str): Preset used
|
preset (str/int): Preset used
|
||||||
infile (str): Input file name
|
infile (str): Input file name
|
||||||
outfilesize (float): Size of output file
|
outfilesize (float): Size of output file
|
||||||
enctime (int): Time to encode
|
enctime (int): Time to encode
|
||||||
@ -94,7 +96,9 @@ def write_line(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def encode_general(inputfile: str, outputfile: str, codec: str, crf: str, preset: str):
|
def encode_general(
|
||||||
|
inputfile: str, outputfile: str, codec: str, crf: int, preset: Union[str, int]
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
General encoding function
|
General encoding function
|
||||||
|
|
||||||
@ -102,8 +106,8 @@ def encode_general(inputfile: str, outputfile: str, codec: str, crf: str, preset
|
|||||||
inputfile (str): Path to input file
|
inputfile (str): Path to input file
|
||||||
outputfile (str): Path to output file
|
outputfile (str): Path to output file
|
||||||
codec (str): Codec used
|
codec (str): Codec used
|
||||||
crf (str): CRF value
|
crf (int): CRF value
|
||||||
preset (str): Choosen preset
|
preset (str/int): Choosen preset
|
||||||
"""
|
"""
|
||||||
ff = ffmpy.FFmpeg(
|
ff = ffmpy.FFmpeg(
|
||||||
inputs={inputfile: None},
|
inputs={inputfile: None},
|
||||||
@ -119,15 +123,15 @@ def encode_general(inputfile: str, outputfile: str, codec: str, crf: str, preset
|
|||||||
return ff
|
return ff
|
||||||
|
|
||||||
|
|
||||||
def encode_libaom(inputfile: str, outputfile: str, crf: str, preset: str):
|
def encode_libaom(inputfile: str, outputfile: str, crf: int, preset: Union[str, int]):
|
||||||
"""
|
"""
|
||||||
Encoding with libaom
|
Encoding with libaom
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
inputfile (str): Path to input file
|
inputfile (str): Path to input file
|
||||||
outputfile (str): Path to output file
|
outputfile (str): Path to output file
|
||||||
crf (str): CRF value
|
crf (int): CRF value
|
||||||
preset (str): Choosen preset
|
preset (str/int): Choosen preset
|
||||||
"""
|
"""
|
||||||
ff = ffmpy.FFmpeg(
|
ff = ffmpy.FFmpeg(
|
||||||
inputs={inputfile: None},
|
inputs={inputfile: None},
|
||||||
|
Loading…
Reference in New Issue
Block a user