Take the 2-minute tour ×

I am using ffmpeg to convert a audio file to .ogg, .m4a and .mp3 with the code below.

shell_exec("cd {$targetDir}/ && /usr/local/bin/ffmpeg -i {$fileName} temp.wav && /usr/local/bin/ffmpeg -i temp.wav -c:a libfaac converted.m4a && /usr/local/bin/ffmpeg -i temp.wav -c:a libvorbis converted.ogg && /usr/local/bin/ffmpeg -i temp.wav converted.mp3 2>&1")

Ok so the above works fine with any files up to 30mb but anything above it just cant handle it, i have my server pushed to the limits.

What i am asking, is there a quick way to do this with the code i am using above, is there anything i dont know about that could help me out on performance.

Any tips would be great thanks

share|improve this question
What exactly do you mean by, "it just cant handle it"? –  LordNeckbeard Jan 29 at 20:21
Basically the server is boosted to max settings but it will time out i just need to try and get the process to run quicker or rethink how it is doing the process –  user1503606 Jan 29 at 20:36
so some shared server is "killing" your process or something? What if you do them separately, does the process get killed? Anyway you may be able to go multi core by either spawning and joining background bash processes or trac.ffmpeg.org/wiki/Creating%20multiple%20outputs (but still, you'd be limited at 90 MB probably, time-wise...) –  rogerdpack Jan 29 at 20:47
nice might be worth a look. –  LordNeckbeard Jan 29 at 21:55

Your Answer



Browse other questions tagged or ask your own question.