From 9027d6fd1ede225b8b37ad59299569f72130e7ef Mon Sep 17 00:00:00 2001 From: Fuchs Date: Thu, 20 Aug 2020 12:31:54 +0200 Subject: [PATCH] Remove pass_cmds from chunk --- Av1an/chunk.py | 14 -------------- Av1an/target_vmaf.py | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Av1an/chunk.py b/Av1an/chunk.py index 308743b..25531f9 100644 --- a/Av1an/chunk.py +++ b/Av1an/chunk.py @@ -34,21 +34,10 @@ class Chunk: self.ffmpeg_gen_cmd: Command = ffmpeg_gen_cmd self.size: int = size self.temp: Path = temp - self.pass_cmds: MPCommands = [] self.frames: int = frames self.output_ext: str = output_ext self.vmaf_target_cq = None - def generate_pass_cmds(self, args: Args) -> None: - """ - Generates and sets the encoding commands for this chunk - - :param args: the Args - :return: None - """ - encoder = Av1an.ENCODERS[args.encoder] - self.pass_cmds = encoder.compose_1_pass(args, self) if args.passes == 1 else encoder.compose_2_pass(args, self) - def to_dict(self) -> Dict[str, Any]: """ Converts this chunk to a dictionary for easy json serialization @@ -59,7 +48,6 @@ class Chunk: 'index': self.index, 'ffmpeg_gen_cmd': self.ffmpeg_gen_cmd, 'size': self.size, - 'pass_cmds': self.pass_cmds, 'frames': self.frames, 'output_ext': self.output_ext, } @@ -127,6 +115,4 @@ class Chunk: :return: A Chunk from the dictionary """ chunk = Chunk(temp, d['index'], d['ffmpeg_gen_cmd'], d['output_ext'], d['size'], d['frames']) - pass_cmds = [CommandPair(f, e) for f, e in d['pass_cmds']] - chunk.pass_cmds = pass_cmds return chunk diff --git a/Av1an/target_vmaf.py b/Av1an/target_vmaf.py index bb573a2..e1bf762 100644 --- a/Av1an/target_vmaf.py +++ b/Av1an/target_vmaf.py @@ -21,8 +21,8 @@ from .encoders import ENCODERS def target_vmaf_routine(args: Args, chunk: Chunk): """ - Applies target vmaf to this chunk. Determines what the cq value should be and adjusts the pass_cmds - to match + Applies target vmaf to this chunk. Determines what the cq value should be and sets the + vmaf_target_cq for this chunk :param args: the Args :param chunk: the Chunk