How to make a queue in php with mysql

oh

in my script, I run the exec () function to make a movie file with ffmpeg.

the problem is that ffmpeg can only work once on the server,

if 2 people are online on the server and the first one is already running ffmpeg, I want the second to wait for the first end of the process

how to encode it?

Thank you

+3
source share
4 answers

Set the lock somewhere.

ffmpeg, , . , ffmpeg, , "1", , 5 10 . , , "0". , , script , "0".

ffmpeg .

+3

. , .

+3
  • (), , youtube/vimeo, - . Youtube API .
  • exec ? , , , CPU . Http ( 30 ). , .
  • , ( linux box ), :

, . java, . github.

+2

You can use an asynchronous queue. Each new request is added to the queue as a message. Your process reads one message at a time and processes the conversion request.

For the PHP queue, you can try Dropr or similar.

0
source

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


All Articles