Home >Backend Development >PHP Tutorial >Video upload - php uses ffmpeg to transcode mp4 which takes too long
I found an ffmpeg that supports h264 encoding. It takes too long for PHP to call exec to use ffmpeg to transcode, and the CPU usage exceeds 80%. I want to ask how to solve it.
Transcoding command Also, I don’t know what the meaning of the parameters here is?
<code>$command='..\ffmpeg\bin\ffmpeg.exe -i ' . $file . '.' . $ext . ' -vcodec libx264 -vprofile main -preset slow -b:v 400k -maxrate 400k -bufsize 800k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -ab 128k ' .$file . '.mp4';</code>
I found an ffmpeg that supports h264 encoding. It takes too long for PHP to call exec to use ffmpeg to transcode, and the CPU usage exceeds 80%. I want to ask how to solve it.
Transcoding command Also, I don’t know what the meaning of the parameters here is?
<code>$command='..\ffmpeg\bin\ffmpeg.exe -i ' . $file . '.' . $ext . ' -vcodec libx264 -vprofile main -preset slow -b:v 400k -maxrate 400k -bufsize 800k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -ab 128k ' .$file . '.mp4';</code>
Use Qiniu to transfer, or use queue to do it asynchronously
Specific command man ffmpeg