There is a strange error, I do not know how there was no syntax error, but here you used quotes inside the quotes of the first argument of exec
:
... -af "volume=enable='between(t,0,30)':volume=0" ...
^ - Aqui ^ aqui
You must 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 using escapeshellarg
with the exec
(if it is Like-Unix) and use the absolute path for precaution.
Should stay 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');
William you are 10 guy... worked perfectly... thank you very much...
– wildson