src/Service/Ffmpeg.php
public function createImagesFromVideos($source, $target = 'step-%03d.jpg')
    {
        try {
            $this->serviceLocator->setShared('playgroundcore_phpvideotoolkit', false);

            $this->serviceLocator->get('playgroundcore_phpvideotoolkit')
            ->addPreInputCommand('-y')
            ->addCommand('-i', $source)
            ->setOutputPath($target)
            ->execute();
        } catch (FfmpegProcessOutputException $e) {
            throw new \PHPVideoToolkit\InvalidArgumentException('Error when merging videos');
        } catch (\PHPVideoToolkit\Exception $e) {
            throw new \PHPVideoToolkit\InvalidArgumentException('Error when merging videos');
        }

        return $target;
    }
public function createImagesFromVideos($source, $target = 'step-%03d.jpg')
    {
        try {
            $this->serviceLocator->setShared('playgroundcore_phpvideotoolkit', false);

            $this->serviceLocator->get('playgroundcore_phpvideotoolkit')
            ->addPreInputCommand('-y')
            ->addCommand('-i', $source)
            ->setOutputPath($target)
            ->execute();
        } catch (FfmpegProcessOutputException $e) {
            throw new \PHPVideoToolkit\InvalidArgumentException('Error when merging videos');
        } catch (\PHPVideoToolkit\Exception $e) {
            throw new \PHPVideoToolkit\InvalidArgumentException('Error when merging videos');
        }

        return $target;
    }
public function createImagesFromVideos ( $ source , $ target = 'step-%03d.jpg' ) { try { $ this -> serviceLocator -> setShared ( 'playgroundcore_phpvideotoolkit' , false ) ; $ this -> serviceLocator -> get ( 'playgroundcore_phpvideotoolkit' ) -> addPreInputCommand ( '-y' ) -> addCommand ( '-i' , $ source ) -> setOutputPath ( $ target ) -> execute ( ) ; } catch ( FfmpegProcessOutputException $ e ) { throw new \ PHPVideoToolkit \ InvalidArgumentException ( 'Error when merging videos' ) ; } catch ( \ PHPVideoToolkit \ Exception $ e ) { throw new \ PHPVideoToolkit \ InvalidArgumentException ( 'Error when merging videos' ) ; } return $ target ; }
This method create images from a video.
ffmpeg -i input.mov output_%03d.png
This method create images from a video . ffmpeg - i input . mov output_%03d . png