Remove pass_cmds from chunk

This commit is contained in:
Fuchs 2020-08-20 12:31:54 +02:00
parent 2f92d88a81
commit 9027d6fd1e
2 changed files with 2 additions and 16 deletions

View file

@ -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

View file

@ -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