chrisc0015 Posted July 24, 2007 Share Posted July 24, 2007 Hi, I'm relatively new to PHP and am creating a website which will take uploaded files and convert them to FLV files for quick viewing using an FLV player. It is similar to YouTube. After a successful upload I hope to first convert the video file to FLV, and then create a thumbnail from the FLV file. In my upload script, the two commands follow eachother: exec("Video to FLV Conversion"); exec("Thumbnail creation"); The video converts always, and on very small videos (below 500k) the thumbnail creation works as well... but for larger files, the thumbnail creation does not execute. But if I run only the "exec('Thumbnail creation');" after the FLV has already been converted, it creates the thumbnail. My thoughts are that the Thumbnail exec() starts before the FLV Conversion exec() is completed. Is there a way to ensure the first exec() finishes before continuing through the script? I could also try merely taking the thumbnail from the initial video file (non-FLV) and it may work fine... but I thought I'd ask here first as I've read some complications creating thumbnails from several types of video files. Any help is appreciated, thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted July 24, 2007 Share Posted July 24, 2007 My thoughts are that the Thumbnail exec() starts before the FLV Conversion exec() is completed. That is not the case. Only one function can be executed at a time in php, the second exec call can obnly begin after the first is complete. My theory is that your server is timing out. running commands like that probably isn't too wise within a web environment unless you have a dedicated server, and even then, your clients will be left waiting for the conversion. You'd be best to look into ways of letting this all happen in the background. 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.