Sulu\Bundle\MediaBundle\Media\Video\VideoThumbnailServiceInterface::generate PHP Method

generate() public method

Generates an image from a video frame at given time.
public generate ( string $file, string $time, string $destination ) : boolean
$file string
$time string
$destination string
return boolean
    public function generate($file, $time, $destination);

Usage Example

Ejemplo n.º 1
0
 /**
  * Converts one frame of a video to an image using FFMPEG.
  *
  * @param string $content
  *
  * @return string
  *
  * @throws OriginalFileNotFoundException
  */
 private function convertVideoToImage($content)
 {
     $temporaryFilePath = $this->createTemporaryFile($content);
     $this->videoThumbnail->generate($temporaryFilePath, '00:00:02:01', $temporaryFilePath);
     $extractedImage = file_get_contents($temporaryFilePath);
     unlink($temporaryFilePath);
     return $extractedImage;
 }
All Usage Examples Of Sulu\Bundle\MediaBundle\Media\Video\VideoThumbnailServiceInterface::generate
VideoThumbnailServiceInterface