def start_server(self): if SHOW_SSL: ssl = '-s' if self.sslCheckbox.isChecked() else '' else: ssl = '' if self.serverOn: self.kill_server() if DEBUG: args = ['python', APP_SCRIPT_PATH, '-d', self.directory, '-p', str(self.port), ssl] else: args = [APP_PATH, '-d', self.directory, '-p', str(self.port), ssl] args += ['-f', FFMPEG_PATH, '-t', SEGMENTER_PATH] self.app = subprocess.Popen(args, startupinfo=helper.noCmd()) self.serverOn = True
def inspect(self): proc = subprocess.Popen([self.transcoder.ffmpeg.path, '-i', self.videoPath], stderr=subprocess.PIPE, startupinfo=helper.noCmd()) proc.wait() stderr = proc.stderr.read() return stderr
def call_ffmpeg(self, **kwargs): self.killProcessing() cmd = self.transcoder.ffmpeg.cmd_tmpl.substitute( startTime=int(kwargs['start_segment'])*self.segment_duration, videoPath=self.videoPath, # FIXME last change monday 9:04 aM #duration=kwargs['num_segments']*self.segment_duration, frameWidth=self.frame_size[0], frameHeight=self.frame_size[1], bitrate=int(kwargs['bitrate'])*1000, ) segmenter_cmd = self.transcoder.segmenter.cmd_tmpl.substitute( tmpDir=helper.shellquote(self.transcoder.tmp_dir), # and this ughhh shellex? or what nib startSegment=kwargs['start_segment'], segmentPrefix=self.md5+"-"+kwargs['bitrate'], ) with open(os.devnull, 'w') as fp: self.current_ffmpeg_process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=fp, startupinfo=helper.noCmd()) self.current_segmenter_process = subprocess.Popen(shlex.split(segmenter_cmd), stdin=self.current_ffmpeg_process.stdout, stdout=fp, stderr=fp, startupinfo=helper.noCmd())