Example #1
0
 public static function isAvailable()
 {
     try {
         $ffmpeg = Pimcore_Video_Adapter_Ffmpeg::getFfmpegCli();
         $phpCli = Pimcore_Tool_Console::getPhpCli();
         if (!$ffmpeg || !$phpCli) {
             throw new Exception("ffmpeg is not available");
         }
         return true;
     } catch (Exception $e) {
         Logger::warning($e);
     }
     return false;
 }
Example #2
0
 /**
  * @param null $timeOffset
  */
 public function saveImage($file, $timeOffset = null)
 {
     if (!$timeOffset) {
         $timeOffset = 5;
     }
     $cmd = self::getFfmpegCli() . " -i " . realpath($this->file) . " -vcodec png -vframes 1 -ss " . $timeOffset . " " . str_replace("/", DIRECTORY_SEPARATOR, $file);
     Pimcore_Tool_Console::exec($cmd);
 }
Example #3
0
 /**
  *
  */
 public function convert()
 {
     $this->save();
     $cmd = Pimcore_Tool_Console::getPhpCli() . " " . PIMCORE_PATH . DIRECTORY_SEPARATOR . "cli" . DIRECTORY_SEPARATOR . "video-converter.php " . $this->getProcessId();
     Pimcore_Tool_Console::execInBackground($cmd);
 }
Example #4
0
 /**
  * @param null $timeOffset
  */
 public function saveImage($file, $timeOffset = null)
 {
     if (!$timeOffset) {
         $timeOffset = 5;
     }
     $cmd = self::getFfmpegCli() . " -i " . $this->file . " -vcodec png -vframes 1 -ss " . $timeOffset . " " . $file;
     Pimcore_Tool_Console::exec($cmd);
 }