Can I call multiple FFMPEG processes on a multi-core LAMP machine with PHP?

I am using PHP to invoke the FFMPEG command using exec (). the script that initiates this command is called from another PHP script using

proc_close(proc_open('php /phpdirectory/process.php &', array(), $foo));

This works great. The ffmpeg command is called and run "in the background", leaving the first script to return to the user and in this case continue to download files. What if I use a machine with multiple cores? How can I optimize things so that I can call the ffmpeg process for each core? Or will the multi-core process of the machine still split the work between the cores and speed up the process?

Is anyone

+3
source share
2 answers

FFMPEG process scheduling is done by the kernel scheduler. You cannot explicitly run your processes in each core.

+4
source

blairyeah is right that this is not an optimization, but in fact you can bind a process to a specific processor using taskset(1).

The solution is found in ServerFault's answer .

0
source

Source: https://habr.com/ru/post/1719622/


All Articles