This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.  
 More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning FFmpeg wrapper 
- Author
 - Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de 
 
Definition at line 23 of file class.ilFFmpeg.php.
 
◆ enabled()
  
  
      
        
          | static ilFFmpeg::enabled  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ escapeShellArg()
  
  
      
        
          | static ilFFmpeg::escapeShellArg  | 
          ( | 
          string  | 
          $a_arg | ) | 
           | 
         
       
   | 
  
staticprotected   | 
  
 
 
◆ exec()
  
  
      
        
          | static ilFFmpeg::exec  | 
          ( | 
          string  | 
          $args | ) | 
           | 
         
       
   | 
  
staticprotected   | 
  
 
Definition at line 104 of file class.ilFFmpeg.php.
  106         $win = (stripos(php_uname(), 
"win") === 0);
   107         $cmd = self::getCmd();
   108         if ($win && str_contains($cmd, 
" ") && $cmd[0] !== 
'"') {
   109             $cmd = 
'"' . $cmd . 
'"';
 static exec(string $args)
 
 
 
 
◆ extractImage()
  
  
      
        
          | static ilFFmpeg::extractImage  | 
          ( | 
          string  | 
          $a_file,  | 
         
        
           | 
           | 
          string  | 
          $a_target_filename,  | 
         
        
           | 
           | 
          string  | 
          $a_target_dir = "",  | 
         
        
           | 
           | 
          int  | 
          $a_sec = 1  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Extract image from video file. 
- Parameters
 - 
  
    | string | $a_file | source file (full path included)  | 
    | string | $a_target_dir | target directory (no trailing "/")  | 
    | string | $a_target_filename | target file name (no path!)  | 
    | int | $a_sec |  | 
  
   
- Returns
 - string new file (full path) 
 
- Exceptions
 - 
  
  
 
Definition at line 151 of file class.ilFFmpeg.php.
References ilShellUtil\escapeShellArg().
Referenced by ilDclMobRecordFieldModel\parseValue().
  157         $spi = pathinfo($a_file);
   160         $target_dir = ($a_target_dir != 
"")
   164         $target_file = $target_dir . 
"/" . $a_target_filename;
   170         $ret = self::exec($cmd . 
" 2>&1");
   171         self::$last_return = $ret;
   173         if (is_file($target_file)) {
   176             throw new ilFFmpegException(
"It was not possible to extract an image from " . basename($a_file) . 
".");
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static escapeShellArg(string $a_arg)
 
 
 
 
◆ extractPNGFromVideoInZip()
  
  
      
        
          | static ilFFmpeg::extractPNGFromVideoInZip  | 
          ( | 
          string  | 
          $zip,  | 
         
        
           | 
           | 
          string  | 
          $path,  | 
         
        
           | 
           | 
          int  | 
          $sec = 1  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Definition at line 180 of file class.ilFFmpeg.php.
References ilFileUtils\ilTempnam().
Referenced by ILIAS\MediaObjects\MediaObjectManager\generatePreview().
  185         $zip = self::escapeShellArg($zip);
   188         $tmp_file = self::escapeShellArg($tfile);
   190         $command1 = 
"unzip -p $zip $path > $tmp_file";
   191         shell_exec($command1);
   192         $command2 = 
"ffmpeg -i $tmp_file -f image2 -vframes 1 -ss $sec -vcodec png pipe:1";
   194         $ret = (string) shell_exec($command2);
 
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory. 
 
 
 
 
◆ getCmd()
  
  
      
        
          | static ilFFmpeg::getCmd  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
staticprivate   | 
  
 
 
◆ getLastReturnValues()
  
  
      
        
          | static ilFFmpeg::getLastReturnValues  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ getSourceMimeTypes()
  
  
      
        
          | static ilFFmpeg::getSourceMimeTypes  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ supportsImageExtraction()
  
  
      
        
          | static ilFFmpeg::supportsImageExtraction  | 
          ( | 
          string  | 
          $a_mime | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ $formats
Initial value:= array(
        "video/3pgg" => array(
            "source" => true,
            "target" => false
            ),
        "video/x-flv" => array(
            "source" => true,
            "target" => false
            ),
        "video/mp4" => array(
            "source" => true,
            "target" => true,
            "parameters" => "-vcodec libx264 -strict experimental -acodec aac -sameq -ab 56k -ar 48000",
            "suffix" => "mp4"
            ),
        "video/webm" => array(
            "source" => true,
            "target" => true,
            "parameters" => "-strict experimental -vcodec libvpx -acodec vorbis -ac 2 -sameq -ab 56k -ar 48000",
            "suffix" => "webm"
            )
        )
 
Definition at line 34 of file class.ilFFmpeg.php.
 
 
◆ $last_return
  
  
      
        
          | array ilFFmpeg::$last_return = array() | 
         
       
   | 
  
static   | 
  
 
 
The documentation for this class was generated from the following file: