I use ffmpeg to convert bitrate to 128 but not working in php
exec("ffmpeg -i input.mp3 -codec:a libmp3lame -b:a 128k output().mp3 2>&1",
$output, $exit_code);
if ($exit_code!= 0) {
$data['message'][] = "Error";
}
print_r($output);
print_r($exit_code);
exit;
After running this code show error code 2. The output is an empty array and also exit_code is 2 and not create output.mp3 file.
I already study How can I find out what this ffmpeg error code means? but this isn't my problem and don't explain error code 2 or error code 2 is not defined. My problem is dont show any error and error message is empty just exit_code show 2 that means is some error happened.
empty arrayerror message when you runffmpegmanually in terminal