1、ffmpeg下载地址:http://ffmpeg.org/download.html。
2、静态版本包可在linux下载,其地址为https://johnvansickle.com/ffmpeg/,根据cpuversion,可下载相应的包。举例来说,https://cloud.tencent.com/product/cvm?from=20065&from_column=20065 cpu是intel,下载ffmpeg-release-i686-static.tar.xz包。
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-i686-static.tar.xz
tar -Jxvf ffmpeg-release-i686-static.tar.xz
#解压后目录为:/root/ffmpeg-4.2.2-i686-static
cd /root/ffmpeg-4.2.2-i686-static
./ffmpeg #查看ffmpeg 命令配置及配置参数
#配置环境变量
vi etc/profile
export FFMPEG_HOME=/root/ffmpeg-4.2.2-i686-static/
export PATH=$FFMPEG_HOME:$PATH
保存并退出
source etc/profile
3、可以通过执行命令ffmpeg-ifrom.amrto.mp3来操作php代码。
system("ffmpeg -i $file $filemp3");
if(filesize($filemp3) > 0){
@unlink($file);//删除原文件
echo $filemp3;
}else{
echo 'error';
}