$input->getFilename(), 'uoutput' => $output->getFilename(), 'frames' => $input->getVideoDuration()->frames, 'seconds' => $input->getVideoDuration()->seconds, ]; $env['input'] = escapeshellarg($env['uinput']); $env['output'] = escapeshellarg($env['uoutput']); $script = $this->loadScript($preset); $script->setPlugin($this); $script->execute($env); } private function loadScript(Preset $preset) { $script = new Script(); foreach ((array)$preset->get('set') as $k=>$v) { $script->set($k,$v); } foreach ((array)$preset->get('script') as $name=>$step) { $op = new Operation($name, $step); $script->addOperation($op); } foreach ((array)$preset->get('helpers') as $name=>$helper) { $hs = new Helper($helper); $script->addHelper($name, $hs); } return $script; } } return new ExecutorPlugin();