public function transcodeFile(File $inFile, Preset $preset, $outFilePath)
    {
        //get assembled process instance from extending class
        $builder = $this->buildProcess($inFile, $preset, $outFilePath);

        //check the return
        if (!$builder instanceof ProcessBuilder) {
            throw new \InvalidArgumentException(sprintf("%s must return an instance of Symfony\Component\Process\ProcessBuilder", get_class($this)."::buildProcess"));
        }

        //get the assembled process
        $process = $builder->getProcess();

        //set the dynamic callback, if interactive is enabled
        $adapter = $this;
        $processBufferCallback = (!$this->stream_buffer) ? null : function($type, $buffer) use ($adapter) {
            if ($type == 'err') {
                $adapter->warn($buffer);
            } else {
                $adapter->info($buffer);
            }
        };

        //run the process, pass feedback as messages to the adapter
        $this->info(sprintf('Running command <info>[%s]</info> from <info>[%s]</info>', $process->getCommandLine(), get_class($this)));
        $process->run($processBufferCallback);

        //check for error status return
        if (!$process->isSuccessful()) {
            throw new \RuntimeException(sprintf("Command failure (%s)[%s]: %s", $process->getExitCode(), $process->getCommandLine(), $process->getErrorOutput()));
        }

        //return newly created file
        return new File($outFilePath);
    }
public function transcodeFile(File $inFile, Preset $preset, $outFilePath)
    {
        //get assembled process instance from extending class
        $builder = $this->buildProcess($inFile, $preset, $outFilePath);

        //check the return
        if (!$builder instanceof ProcessBuilder) {
            throw new \InvalidArgumentException(sprintf("%s must return an instance of Symfony\Component\Process\ProcessBuilder", get_class($this)."::buildProcess"));
        }

        //get the assembled process
        $process = $builder->getProcess();

        //set the dynamic callback, if interactive is enabled
        $adapter = $this;
        $processBufferCallback = (!$this->stream_buffer) ? null : function($type, $buffer) use ($adapter) {
            if ($type == 'err') {
                $adapter->warn($buffer);
            } else {
                $adapter->info($buffer);
            }
        };

        //run the process, pass feedback as messages to the adapter
        $this->info(sprintf('Running command <info>[%s]</info> from <info>[%s]</info>', $process->getCommandLine(), get_class($this)));
        $process->run($processBufferCallback);

        //check for error status return
        if (!$process->isSuccessful()) {
            throw new \RuntimeException(sprintf("Command failure (%s)[%s]: %s", $process->getExitCode(), $process->getCommandLine(), $process->getErrorOutput()));
        }

        //return newly created file
        return new File($outFilePath);
    }
public function transcodeFile ( File $ inFile , Preset $ preset , $ outFilePath ) { //get assembled process instance from extending class $ builder = $ this -> buildProcess ( $ inFile , $ preset , $ outFilePath ) ; //check the return if ( ! $ builder instanceof ProcessBuilder ) { throw new \ InvalidArgumentException ( sprintf ( "%s must return an instance of Symfony\Component\Process\ProcessBuilder" , get_class ( $ this ) . "::buildProcess" ) ) ; } //get the assembled process $ process = $ builder -> getProcess ( ) ; //set the dynamic callback, if interactive is enabled $ adapter = $ this ; $ processBufferCallback = ( ! $ this -> stream_buffer ) ? null : function ( $ type , $ buffer ) use ( $ adapter ) { if ( $ type == 'err' ) { $ adapter -> warn ( $ buffer ) ; } else { $ adapter -> info ( $ buffer ) ; } } ; //run the process, pass feedback as messages to the adapter $ this -> info ( sprintf ( 'Running command <info>[%s]</info> from <info>[%s]</info>' , $ process -> getCommandLine ( ) , get_class ( $ this ) ) ) ; $ process -> run ( $ processBufferCallback ) ; //check for error status return if ( ! $ process -> isSuccessful ( ) ) { throw new \ RuntimeException ( sprintf ( "Command failure (%s)[%s]: %s" , $ process -> getExitCode ( ) , $ process -> getCommandLine ( ) , $ process -> getErrorOutput ( ) ) ) ; } //return newly created file return new File ( $ outFilePath ) ; }
Runs a transcode process by wrapping a command-line process.

{@inheritdoc}
Runs a transcode process by wrapping a command - line process .