Home > Backend Development > PHP Tutorial > Video upload - php uses ffmpeg to transcode mp4 which takes too long

Video upload - php uses ffmpeg to transcode mp4 which takes too long

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-06 13:52:13
Original
2100 people have browsed it

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>
Copy after login
Copy after login

Reply content:

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>
Copy after login
Copy after login

Use Qiniu to transfer, or use queue to do it asynchronously

Specific command man ffmpeg

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template