Что за ошибка и как ее исправить? Использую библиотеку
https://github.com/aminyazdanpanah/PHP-FFmpeg-vide... И установил FFmpeg на сервер.
Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-i' '/var/www/www-root/data/www/site.ru/converter/input/video.mp4' '-c:v' 'libx264' '-c:a' 'aac' '-bf' '1' '-keyint_min' '25' '-g' '250' '-sc_threshold' '40' '-use_timeline' '1' '-use_template' '1' '-init_seg_name' 'video_init_$RepresentationID$.$ext$' '-media_seg_name' 'video_chunk_$RepresentationID$_$Number%05d$.$ext$' '-seg_duration' '10' '-hls_playlist' '0' '-f' 'dash' '-map' '0' '-s:v:0' '256x144' '-b:v:0' '6852k' '-map' '0' '-s:v:1' '426x240' '-b:v:1' '7994k' '-map' '0' '-s:v:2' '640x360' '-b:v:2' '9593k' '-map' '0' '-s:v:3' '854x480' '-b:v:3' '11992k' '-map' '0' '-s:v:4' '1280x720' '-b:v:4' '15989k' '-map' '0' '-s:v:5' '1920x1080' '-b:v:5' '23984k' '-strict' '-2' '-threads' '3' '/var/www/www-root/data/www/site.ru/converter/input/video.mpd': Error Output: ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubu in /var/www/www-root/data/www/site.ru/converter/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php on line 95
Код PHP:
require_once __DIR__ . '/vendor/autoload.php';
use Streaming\Representation;
$config = [
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe',
'timeout' => 3600,
'ffmpeg.threads' => 3,
];
$ffmpeg = Streaming\FFMpeg::create($config);
$video = $ffmpeg->open(__DIR__ . '/input/video.mp4');
$format = new Streaming\Format\X264();
$format->on('progress', function ($video, $format, $percentage){
// You can update a field in your database or can log it to a file
// You can also create a socket connection and show a progress bar to users
echo sprintf("\rTranscoding...(%s%%) [%s%s]", $percentage, str_repeat('#', $percentage), str_repeat('-', (100 - $percentage)));
});
$video->dash()
->setFormat($format)
->autoGenerateRepresentations()
->save();