I have a batch flash upload script, that uploads video files to a dir. Simple. After the upload completes, it creates a mysql record for that file, and moves on to the next file in the queue.
Just before it does that, I want it invoke a background process that will convert the uploaded avi avi file to an ipod compatible mp4 file, as well as generate some preview thumbs. As you can imagine, it takes some time...... I can simply put the conversion code in the file uploader... but it would hang for every file for a good 10-20 minutes, which is a nono (even thou its an admin-only function).
So I want it to fork the conversion process in the background, and move onto the next upload, while it converts the file.
Would something like this do the job, or will I actually have to use the php fork functions?
exec("/usr/bin/php ./convert.php?id=123 > /dev/null 2>&1 &");