def _launch_render(self, clip, range_in, range_out, gmic_frame_offset): self.create_data_dirs_if_needed() self.render_range_in = range_in self.render_range_out = range_out self.gmic_frame_offset = gmic_frame_offset gmicheadless.clear_flag_files(self.get_container_program_id()) # We need data to be available for render process, # create video_render_data object with default values if not available. if self.container_data.render_data == None: self.container_data.render_data = toolsencoding.create_container_clip_default_render_data_object(current_sequence().profile) gmicheadless.set_render_data(self.get_container_program_id(), self.container_data.render_data) job_msg = self.get_job_queue_message() job_msg.text = _("Render Starting...") job_msg.status = jobs.RENDERING jobs.update_job_queue(job_msg) args = ("session_id:" + self.get_container_program_id(), "script:" + str(self.container_data.program), "clip_path:" + str(self.container_data.unrendered_media), "range_in:" + str(range_in), "range_out:"+ str(range_out), "profile_desc:" + PROJECT().profile.description().replace(" ", "_"), # Here we have our own string space handling, maybe change later.. "gmic_frame_offset:" + str(gmic_frame_offset)) # Create command list and launch process. command_list = [sys.executable] command_list.append(respaths.LAUNCH_DIR + "flowbladegmicheadless") for arg in args: command_list.append(arg) subprocess.Popen(command_list)
def _launch_render(self, clip, range_in, range_out, gmic_frame_offset): self.create_data_dirs_if_needed() self.render_range_in = range_in self.render_range_out = range_out self.gmic_frame_offset = gmic_frame_offset gmicheadless.clear_flag_files(self.get_container_program_id()) # We need data to be available for render process, # create video_render_data object with default values if not available. if self.container_data.render_data == None: self.container_data.render_data = toolsencoding.create_container_clip_default_render_data_object( current_sequence().profile) gmicheadless.set_render_data(self.get_container_program_id(), self.container_data.render_data) job_msg = self.get_job_queue_message() job_msg.text = _("Render Starting...") job_msg.status = jobs.RENDERING jobs.update_job_queue(job_msg) args = ( "session_id:" + self.get_container_program_id(), "script:" + utils.escape_shell_path(self.container_data.program), "clip_path:" + utils.escape_shell_path( self.container_data.unrendered_media ), # This is going through Popen shell=True and needs escaped spaces etc.. "range_in:" + str(range_in), "range_out:" + str(range_out), "profile_desc:" + PROJECT().profile.description().replace( " ", "_" ), # Here we have our own string space handling, maybe change later.. "gmic_frame_offset:" + str(gmic_frame_offset)) # Run with nice to lower priority if requested (currently hard coded to lower) nice_command = "nice -n " + str(10) + " " + str( respaths.LAUNCH_DIR + "flowbladegmicheadless").replace(" ", "\ ") for arg in args: nice_command += " " nice_command += arg subprocess.Popen([nice_command], shell=True)
def _launch_render(self, range_in, range_out): print("rendering gmic container clip:", self.get_container_program_id(), range_in, range_out) gmicheadless.clear_flag_files(self.get_container_program_id()) args = ("session_id:" + self.get_container_program_id(), "script:" + self.container_data.program, "clip_path:" + self.container_data.unrendered_media, "range_in:" + str(range_in), "range_out:" + str(range_out), "profile_desc:" + PROJECT().profile.description().replace(" ", "_")) # Run with nice to lower priority if requested nice_command = "nice -n " + str( 10) + " " + respaths.LAUNCH_DIR + "flowbladegmicheadless" for arg in args: nice_command += " " nice_command += arg subprocess.Popen([nice_command], shell=True)