http://www.kuitao8.com/20150916/4055.shtml
php利用安装ffmpeg-php扩展来获取对视频信息操作
http://www.cnblogs.com/zox2011/archive/2013/03/20/2971724.html
FFmpegPHP的安装使用详解
https://github.com/PHP-FFMpeg/PHP-FFMpeg/
PHP FFmpeg
录音文件识别
https://help.aliyun.com/document_detail/32378.html?spm=5176.doc52787.6.558.DTwmrC
先用composer下载 ffmpeg
(在homestead环境下安装较容易)
vagrant 安装 ffmpeg (apt-get install ffmpeg)(采用网易镜像)
例:转成8k采样率
$ffmpeg = FFMpegFFMpeg::create(
[
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe',
]
);
$dir = resource_path('20170609171458.mp3');
$audio = $ffmpeg->open( $dir );
$audio->filters()->resample(8000);
$format = new FFMpegFormatAudioMp3();
// $format->on('progress', function ($audio, $format, $percentage) {
// echo "$percentage % transcoded";
// });
$format
->setAudioChannels(2);
$audio->save($format, resource_path('convert.mp3'));