From f2d19922c53c019af2cd3f7204fa987fc824dce3 Mon Sep 17 00:00:00 2001 From: Zen <46526140+master-of-zen@users.noreply.github.com> Date: Sat, 4 Jul 2020 22:57:09 +0300 Subject: [PATCH] more explicit av1an attributes --- av1an.py | 66 ++++++++++++++++++++++++++++++++++++++++++---- utils/arg_parse.py | 5 +--- 2 files changed, 62 insertions(+), 9 deletions(-) diff --git a/av1an.py b/av1an.py index b8cdbf0..44e811b 100755 --- a/av1an.py +++ b/av1an.py @@ -1,19 +1,75 @@ #!/usr/bin/env python3 -import sys -import json -import time -import subprocess import concurrent import concurrent.futures +import json +import subprocess +import sys +import time from pathlib import Path from utils import * class Av1an: - """Av1an - Python framework for AV1, VP9, VP8 encodes.""" + """Av1an - Python framework for AV1, VP9, VP8 encoding""" def __init__(self): + + # Input/Output/Temp + self.input = None + self.temp = None + self.output_file = None + + # Splitting + self.scenes = None + self.split_method = None + self.extra_split = None + self.min_scene_len = None + + # PySceneDetect split + self.threshold = None + + # AOM Keyframe split + self.reuse_first_pass = None + + # Encoding + self.passes = None + self.video_params = None + self.encoder = None + self.workers = None + self.config = None + + self.video_params = None + + # FFmpeg params + self.ffmpeg = None + self.audio_params = None + self.pix_format = None + + + # Misc + self.logging = None + self.resume = None + self.no_check = None + self.keep = None + + # Boost + self.boost = None + self.boost_range = None + self.boost_limit = None + + # Vmaf + self.vmaf = None + self.vmaf_path = None + + # Target Vmaf + self.vmaf_target = None + self.vmaf_steps = None + self.min_cq = None + self.max_cq = None + self.vmaf_plots = None + + # get all values from argparse self.__dict__.update(arg_parsing()) def conf(self): diff --git a/utils/arg_parse.py b/utils/arg_parse.py index 66edfb6..aee4b17 100755 --- a/utils/arg_parse.py +++ b/utils/arg_parse.py @@ -13,13 +13,13 @@ def arg_parsing(): parser.add_argument('--output_file', '-o', type=Path, default=None, help='Specify output file') # Splitting + parser.add_argument('--scenes', '-s', type=str, default=None, help='File location for scenes') parser.add_argument('--split_method', type=str, default='pyscene', help='Specify splitting method', choices=['pyscene', 'aom_keyframes']) parser.add_argument('--extra_split', '-xs', type=int, default=0, help='Number of frames after which make split') parser.add_argument('--min_scene_len', type=int, default=None, help='Minimum number of frames in a split') # PySceneDetect split - parser.add_argument('--scenes', '-s', type=str, default=None, help='File location for scenes') parser.add_argument('--threshold', '-tr', type=float, default=50, help='PySceneDetect Threshold') # AOM Keyframe split @@ -62,8 +62,5 @@ def arg_parsing(): parser.add_argument('--max_cq', type=int, default=50, help='Max cq for target vmaf') parser.add_argument('--vmaf_plots', help='Make plots of probes in temp folder', action='store_true') - # Server parts - parser.add_argument('--host', nargs='+', type=str, help='ips of encoders') - # Store all vars in dictionary return vars(parser.parse_args())