diff --git a/Av1an/bar.py b/Av1an/bar.py index 4661103..59e3cdf 100755 --- a/Av1an/bar.py +++ b/Av1an/bar.py @@ -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() diff --git a/Av1an/vmaf.py b/Av1an/vmaf.py index d299f01..628b6f5 100755 --- a/Av1an/vmaf.py +++ b/Av1an/vmaf.py @@ -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];'