I’m trying to convert an .avi file to .flv using ffmpeg-php on a centos 5.4 server.
This is my code:
exec("ffmpeg -y -i " . $srcFile . " -ab 32 -ar 22050 -b " . $newBitrate . "k -vframes 2500 -qscale 7 -f flv -s " . $newWidth . "x" . $newHeight ." " . $destFile);
For some reason the video length in the new .flv file is corrupt or missing for online players unless I disable audio (with -an). The video plays but players do not show the progress correctly.
Plus I cannot change the audio bit rate and sample rate – it just will not work then – for instance when I replace the numbers with 128 / 48000 (from original .avi).
According to this bug report, it’s because ffmpeg does not include an mp3 encoder due to legalities. Apparently, updating to the latest version will fix the problem.