def man_q(self, command: Command, q: int) -> Command: """Return command with new cq value""" adjusted_command = command.copy() i = list_index_of_regex(adjusted_command, r"--cq-level=.+") adjusted_command[i] = f"--cq-level={q}" return adjusted_command
def man_q(self, command: Command, q: int) -> Command: """Return command with new cq value :param command: old command :param q: new cq value :return: command with new cq value""" adjusted_command = command.copy() i = list_index_of_regex(adjusted_command, r"(--qp|-q|--crf)") adjusted_command[i + 1] = f"{q}" return adjusted_command
def man_q(self, command: Command, q: int) -> Command: """Return command with new cq value :param command: old command :param q: new cq value :return: command with new cq value""" adjusted_command = command.copy() i = list_index_of_regex(adjusted_command, r"--quantizer") adjusted_command[i + 1] = f'{q}' return adjusted_command