helloworlder Posted November 20, 2009 Share Posted November 20, 2009 I'm using PHP's shell_exec() function to call the ffmpeg audio visual library to convert small sound files (about 200kb or less) in a variety of formats to MP3. I don't know much about performance with PHP or ffmpeg so does anyone know if it is a must to do this as a background process, or can I get away with it not executing it as a bg process? I don't think I understand how PHP works in the background. Let's have a hypothetical situation where 50 people are trying to upload a file at the same time, and the conversion is happening at the same time. If it takes 2 seconds to do each conversion, does this mean someone has to wait for 100 seconds? Link to comment https://forums.phpfreaks.com/topic/182263-php-and-ffmpeg-performance/ Share on other sites More sharing options...
rarebit Posted November 20, 2009 Share Posted November 20, 2009 The delay issue is probably to do with your server, most web servers don't alot much ram (esp for basic packages). FFMPEG requires a fair bit of ram and processor, but it is best av package around. I think guidence is to use the php-ffmpeg api, see here: http://ffmpeg-php.sourceforge.net/ Link to comment https://forums.phpfreaks.com/topic/182263-php-and-ffmpeg-performance/#findComment-961952 Share on other sites More sharing options...
oopholic Posted November 20, 2009 Share Posted November 20, 2009 FFMPEG is started on the system, not on the web server so this is not a concern. You really should put your ffmpeg proccesses in the background(Image in the future what will happen when people start uploading <10 Mb sounds). One more thing is to create a queue for the processes because ffmpeg is a uniprocessor one(Use one core at time), so the best thung to do if you have a server with four cores put them in a queue and execute four at a time. In this way you will gain the best performance. Do not start them at once. Moreover think about your web server. If it runs on the same server you really must leave one free core because you may face a big lag in your site. Link to comment https://forums.phpfreaks.com/topic/182263-php-and-ffmpeg-performance/#findComment-962153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.