1

I am in the process of creating a site which enables users to upload audio. I just figured our how to use ffmpeg with PHP to convert audio files (from WAV to MP3) on the fly.

I don't have any real experience with ffmpeg and I wanted to know what's the best way to convert the files. I'm not going to convert them upon page load, I will put the conversions in a queue and process them separately.

I have queries about how best to process the queue. What is a suitable interval to convert these files without overloading the server? Should I process files simultaneously or one by one? How many files should I convert at each interval to allow the server to function efficiently?

Server specs

  • Core i3 2.93GHz
  • 4GB RAM
  • CentOS 64-bit

I know these questions are very vague but if anyone has any experience with a similar concept, I would really love to hear what works for them and what common problems I could face in the road ahead.

Really appreciate all the help!

Wasim
  • 4,953
  • 10
  • 52
  • 87

1 Answers1

1

I suggest you use a work queue like beanstalkd. When there is a new file to convert simply place a message into the queue (the filename maybe). A daemon that works as beanstalkd client fetches the message and converts the audio file properly (the daemon can be written in any language that has a beanstalkd library).

halfdan
  • 33,545
  • 8
  • 78
  • 87
  • Thanks very much, i've looked into beanstalk but i'm having a slight problem with it. I've started a new thread, would be grateful if you could take a look - http://stackoverflow.com/questions/5592211/using-ffmpeg-php-and-beanstalk – Wasim Apr 08 '11 at 08:06