BoarderLine Posted September 24, 2010 Share Posted September 24, 2010 Hi all. I have a video upload page utilizing ffmpeg to convert to .flv format via ajax with progress bar. Currently I am having an issue where the user uploads the video however the same upload script also converts to .flv format (exec("ffmpeg -i etc..")) after the file is uploaded. This is working fine however if the user selects to move away from the page after the video is uploaded it is causing the users browser to lockup (and sometimes crash). How can I make the exec() command to convert the video format strictly run server side and allow the user to move away from the page even though the conversion is still processing? Thanks for any advise on how to handle this issue. Quote Link to comment Share on other sites More sharing options...
milesap Posted September 24, 2010 Share Posted September 24, 2010 Page requests are 'stateless' meaning that any actions are only performed when the user requests them. The script starts and ends with each page request, and therefore the short answer is no you cannot easily have the server process a file while the user leaves the page. However, there are ways around this and in your case I would suggest setting up a cron job that runs a conversion script for uploaded files. That way the user can leave the page without affecting the conversion process (since the cron job is making the request). Quote Link to comment Share on other sites More sharing options...
BoarderLine Posted September 24, 2010 Author Share Posted September 24, 2010 Cheers Milesap, this I will do I think. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.