It has a strange error, I do not know how it did not syntax error, but here you used quotation marks inside the quotation marks of the first argument of exec
:
... -af "volume=enable='between(t,0,30)':volume=0" ...
^ - Aqui ^ aqui
You should escape them like this:
exec("ffmpeg -i musica.mp3 -af \"volume=enable='between(t,0,30)':volume=0\" result.mp3 2> log.txt");
I also recommend that you use escapeshellarg
with exec
(if it's Like-unix) and use the absolute path as a precaution.
It should look like this:
//Pega o caminho todo do script atual
define('FULL_PATH', rtrim(strtr(dirname(__FILE__), '\', '/'), '/') . '/');
$sourcePath = FULL_PATH . 'musica.mp3';
$savePath = FULL_PATH . 'result.mp3';
$params = escapeshellarg('"volume=enable=\'between(t,0,30)\':volume=0"');
exec('ffmpeg -i ' . $sourcePath . ' -af ' . $params . ' ' . $savePath . ' 2> log.txt');