def startup(self, project: Project, chunk_queue: List[Chunk]): clips = len(chunk_queue) project.workers = min(project.workers, clips) print( f"\rQueue: {clips} Workers: {project.workers} Passes: {project.passes}\n" f'Params: {" ".join(project.video_params)}') BaseManager.register("Counter", Counter) counter = Manager().Counter(project.get_frames(), self.initial_frames, not project.quiet) project.counter = counter
def done_file(self, project: Project, chunk_queue: List[Chunk]): done_path = project.temp / "done.json" if project.resume and done_path.exists(): log("Resuming...") with open(done_path) as done_file: data = json.load(done_file) project.set_frames(data["frames"]) done = len(data["done"]) self.initial_frames = sum(data["done"].values()) log(f"Resumed with {done} encoded clips done") else: self.initial_frames = 0 total = project.get_frames() d = {"frames": total, "done": {}} with open(done_path, "w") as done_file: json.dump(d, done_file)
def done_file(self, project: Project, chunk_queue: List[Chunk]): done_path = project.temp / 'done.json' if project.resume and done_path.exists(): log('Resuming...\n') with open(done_path) as done_file: data = json.load(done_file) project.set_frames(data['frames']) done = len(data['done']) self.initial_frames = sum(data['done'].values()) log(f'Resumed with {done} encoded clips done\n\n') else: self.initial_frames = 0 total = project.get_frames() d = {'frames': total, 'done': {}} with open(done_path, 'w') as done_file: json.dump(d, done_file)