This commit is contained in:
Zen 2020-09-02 04:11:01 +03:00
parent a25bd106be
commit ffb6e4b175
2 changed files with 4 additions and 7 deletions

View file

@ -39,7 +39,7 @@ class Counter:
self.tqdm_bar.reset(self.left)
self.first_update = False
self.tqdm_bar.update(value)
def close(self):
self.tqdm_bar.close()
@ -66,8 +66,6 @@ def process_pipe(pipe):
def process_encoding_pipe(pipe, encoder, counter):
encoder_history = deque(maxlen=20)
frame = 0
pass_1_check = True
skip_1_pass = False
enc = ENCODERS[encoder]
while True:
line = pipe.stdout.readline().strip()

View file

@ -43,10 +43,6 @@ def call_vmaf(chunk: Chunk, encoded: Path, n_threads, model, res,
if fl_path is None:
fl_path = chunk.fake_input_path.with_name(encoded.stem).with_suffix('.json')
fl = fl_path.as_posix()
# Change framerate of comparison to framerate of probe
select_frames = f"select=not(mod(n\\,{vmaf_rate}))," if vmaf_rate != 0 else ''
# For vmaf calculation both source and encoded segment scaled to 1080
# Also it's required to use -r before both files of vmaf calculation to avoid errors
@ -55,6 +51,9 @@ def call_vmaf(chunk: Chunk, encoded: Path, n_threads, model, res,
filter_complex = ('-filter_complex',)
# Change framerate of comparison to framerate of probe
select_frames = f"select=not(mod(n\\,{vmaf_rate}))," if vmaf_rate != 0 else ''
distorted = f'[0:v]{select_frames}scale={res}:flags=bicubic:\
force_original_aspect_ratio=decrease,setpts=PTS-STARTPTS[distorted];'