PHP 使用 PHP-FFMpeg 做视频水印 遇到的keng,
关于 "Encoding failed", "Unknown encoder 'libfaac'" 的处理
使用 PHP-FFMpeg 做视频水印
demo 如下:
$ffmpeg = FFMpegFFMpeg::create(array(
'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg',
'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe',
'timeout' => 3600, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
));
$video = $ffmpeg->open('video.mpg');
$relative = array(
'position'=>'relative',
'bottom'=>50,
'right'=>50
);
$image = '/xxx/watermarkMark.png';
$video->filters()->watermark($image, $relative);
$video->save(new FFMpegFormatVideoX264(), 'export-x264.mp4