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 !=
"") {
76 if (
$f[
"target"] ==
true) {
90 if (
$f[
"source"] ==
true) {
103 if (in_array($a_mime, self::getSourceMimeTypes(),
true)) {
115 return PATH_TO_FFMPEG;
121 public static function exec(
string $args): array
131 return self::$last_return;
146 string $a_target_filename,
147 string $a_target_dir =
"",
150 $spi = pathinfo($a_file);
153 $target_dir = ($a_target_dir !=
"")
157 $target_file = $target_dir .
"/" . $a_target_filename;
163 $ret = self::exec($cmd .
" 2>&1");
164 self::$last_return = $ret;
166 if (is_file($target_file)) {
169 throw new ilFFmpegException(
"It was not possible to extract an image from " . basename($a_file) .
".");
static getTargetMimeTypes()
Get desired target mime types.
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 getSourceMimeTypes()
static exec(string $args)
Execute ffmpeg.
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 supportsImageExtraction(string $a_mime)
Check if mime type supports image extraction.
static execQuoted(string $cmd, ?string $args=null)
static array $last_return
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)