Shayka
Shayka

Reputation: 49

FFMPEG makes my server crash

I have a youtube mp3 converter site, and to do this I am using FFMPEG.

The problem is that the FFMPEG is using 100% CPU when there are some converting process together, so users can't access my site until the processes are finished.

How can I limit the CPU usage of FFMPEG? Is there another solution to solve my problem?

Upvotes: 1

Views: 977

Answers (2)

Adam Fowler
Adam Fowler

Reputation: 1751

Are you running windows? or Linux? your question was very vague.

I suggest adding a process queue to make sure that only one youtube video is converting at a time. this can be done with simple unix timestamps (for timeout) and a database.

Upvotes: 0

mario
mario

Reputation: 145512

You could make it execute with a lower process scheduling priority:

 exec("nice nice ffmpeg -i video.mp4 output.mp3");

http://linuxmanpages.com/man1/nice.1.php

Upvotes: -1

Related Questions