35         "video/3pgg" => array(
    39         "video/x-flv" => array(
    46             "parameters" => 
"-vcodec libx264 -strict experimental -acodec aac -sameq -ab 56k -ar 48000",
    49         "video/webm" => array(
    52             "parameters" => 
"-strict experimental -vcodec libvpx -acodec vorbis -ac 2 -sameq -ab 56k -ar 48000",
    63         if (defined(
"PATH_TO_FFMPEG") && PATH_TO_FFMPEG != 
"") {
    75         foreach (self::$formats as $k => 
$f) {
    76             if (
$f[
"source"] == 
true) {
    89         if (in_array($a_mime, self::getSourceMimeTypes(), 
true)) {
    99     private static function getCmd(): string
   101         return PATH_TO_FFMPEG;
   104     protected static function exec(
string $args): array
   106         $win = (stripos(php_uname(), 
"win") === 0);
   107         $cmd = self::getCmd();
   108         if ($win && str_contains($cmd, 
" ") && $cmd[0] !== 
'"') {
   109             $cmd = 
'"' . $cmd . 
'"';
   129         return escapeshellarg($a_arg);
   138         return self::$last_return;
   153         string $a_target_filename,
   154         string $a_target_dir = 
"",
   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) . 
".");
   185         $zip = self::escapeShellArg($zip);
   186         $path = self::escapeShellArg(
"/" . $path);
   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 getLastReturnValues()
Get last return values. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static escapeShellArg(string $a_arg)
 
static getSourceMimeTypes()
 
static exec(string $args)
 
static escapeShellArg(string $a_arg)
 
static getCmd()
Get ffmpeg command. 
 
static extractImage(string $a_file, string $a_target_filename, string $a_target_dir="", int $a_sec=1)
Extract image from video file. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static extractPNGFromVideoInZip(string $zip, string $path, int $sec=1)
 
static supportsImageExtraction(string $a_mime)
Check if mime type supports image extraction. 
 
static array $last_return
 
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory. 
 
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)