Если использую формат X264 - FFMpeg\Exception\RuntimeException Encoding Failed
c другими нормально
$ffmpeg = FFMpeg::create([
'ffmpeg.binaries' => exec('which ffmpeg'),
'ffprobe.binaries' => exec('which ffprobe'),
]);
$format = new X264();
$watermarkPath = Yii::getAlias('@frontend/web/default/watermark.jpg');
foreach ($videos as $video) {
if(!file_exists($video->serverPath) || !file_exists($video->serverPath)) {
continue;
}
$ffVideo = $ffmpeg->open($video->serverPath);
$ffVideo->filters()
->watermark($watermarkPath, array(
'position' => 'relative',
'bottom' => 50,
'right' => 50
));
$ffVideo->save($format, $video->serverPath);
}