1. 程式人生 > >ffmpeg任意格式轉碼為M4A

ffmpeg任意格式轉碼為M4A

$ffmpeg = 'bin/ffmpeg-2.8-64bit-static/ffmpeg';
$neroAacEnc = 'bin/NeroAACCodec-1.5.1/linux/neroAacEnc';
$input = "a.mp3";
$rate = 320000;
$output = "{$input}.m4a";
$command = "{$ffmpeg} -vn -loglevel error -i {$input} -f wav - | {$neroAacEnc} -br {$rate} -ignorelength -if - -of {$output}";
exec($command
, $message); if (empty($message)) { //邏輯 }