Пример #1
0
    def _launch_render(self, clip, range_in, range_out, clip_start_offset):
        self.create_data_dirs_if_needed()
        self.render_range_in = range_in
        self.render_range_out = range_out
        self.clip_start_offset = clip_start_offset
 
        mltxmlheadless.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)
            
        mltxmlheadless.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(), 
                "clip_path:" + str(self.container_data.unrendered_media),
                "range_in:" + str(range_in),
                "range_out:"+ str(range_out),
                "profile_desc:" + PROJECT().profile.description().replace(" ", "_"),
                "xml_file_path:" + str(self.container_data.unrendered_media))

        # Create command list and launch process.
        command_list = [sys.executable]
        command_list.append(respaths.LAUNCH_DIR + "flowblademltxmlheadless")
        for arg in args:
            command_list.append(arg)

        subprocess.Popen(command_list)
Пример #2
0
    def _launch_render(self, clip, range_in, range_out, clip_start_offset):
        self.create_data_dirs_if_needed()
        self.render_range_in = range_in
        self.render_range_out = range_out
        self.clip_start_offset = clip_start_offset

        mltxmlheadless.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)

        mltxmlheadless.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(),
            "clip_path:" + str(self.container_data.unrendered_media).replace(
                " ", "\ "
            ),  # This is going through Popen shell=True and needs escaped spaces.
            "range_in:" + str(range_in),
            "range_out:" + str(range_out),
            "profile_desc:" +
            PROJECT().profile.description().replace(" ", "_"),
            "xml_file_path:" +
            str(self.container_data.unrendered_media).replace(" ", "\ ")
        )  # This is going through Popen shell=True and needs escaped spaces.

        # Run with nice to lower priority if requested (currently hard coded to lower)
        nice_command = "nice -n " + str(10) + " " + str(
            respaths.LAUNCH_DIR + "flowblademltxmlheadless").replace(
                " ", "\ ")
        for arg in args:
            nice_command += " "
            nice_command += arg

        subprocess.Popen([nice_command], shell=True)