public function process($inputFile, $outputFile = null)
    {
        if (!file_exists($inputFile) || !is_readable($inputFile)) {
            throw new InvalidFileArgumentException(sprintf('File %s does not exist or is not readable', $inputFile));
        }

        $arguments = array(
            '-quiet',
            '-inter',
            '0.5',
            '-tmp',
            dirname($inputFile),
            $inputFile,
        );

        if ($outputFile) {
            $arguments[] = '-out';
            $arguments[] = $outputFile;
        }

        try {
            $this->command($arguments);
        } catch (ExecutionFailureException $e) {
            throw new RuntimeException(sprintf(
                'MP4Box failed to process %s', $inputFile
            ), $e->getCode(), $e);
        }

        return $this;
    }
public function process($inputFile, $outputFile = null)
    {
        if (!file_exists($inputFile) || !is_readable($inputFile)) {
            throw new InvalidFileArgumentException(sprintf('File %s does not exist or is not readable', $inputFile));
        }

        $arguments = array(
            '-quiet',
            '-inter',
            '0.5',
            '-tmp',
            dirname($inputFile),
            $inputFile,
        );

        if ($outputFile) {
            $arguments[] = '-out';
            $arguments[] = $outputFile;
        }

        try {
            $this->command($arguments);
        } catch (ExecutionFailureException $e) {
            throw new RuntimeException(sprintf(
                'MP4Box failed to process %s', $inputFile
            ), $e->getCode(), $e);
        }

        return $this;
    }
public function process ( $ inputFile , $ outputFile = null ) { if ( ! file_exists ( $ inputFile ) || ! is_readable ( $ inputFile ) ) { throw new InvalidFileArgumentException ( sprintf ( 'File %s does not exist or is not readable' , $ inputFile ) ) ; } $ arguments = array ( '-quiet' , '-inter' , '0.5' , '-tmp' , dirname ( $ inputFile ) , $ inputFile , ) ; if ( $ outputFile ) { $ arguments [ ] = '-out' ; $ arguments [ ] = $ outputFile ; } try { $ this -> command ( $ arguments ) ; } catch ( ExecutionFailureException $ e ) { throw new RuntimeException ( sprintf ( 'MP4Box failed to process %s' , $ inputFile ) , $ e -> getCode ( ) , $ e ) ; } return $ this ; }
Processes a file

@param string      $inputFile  The file to process.
@param null|string $outputFile The output file to write. If not provided, processes the file in place.

@return MP4Box

@throws InvalidFileArgumentException In case the input file is not readable
@throws RuntimeException             In case the process failed
Processes a file