Changes between Version 4 and Version 5 of Using FFmpeg from PHP scripts
- 11/13/2012 07:48:54 AM (6 months ago)
v4 v5 13 13 What you want to do is to separate the command-line tool's long processing from your web script execution, to make your script more responsive. So, you have at least 2 options: 14 14 1. Run the command-line tool (using [http://php.net/manual/en/function.shell-exec.php shell_exec()] for example) in the background and continue with the web script execution, periodically refreshing the status page, showing the current progress 15 15 16 2. Create a new "job" (usually a new row in a table of your database) and have some background "worker" process (cron job, shell script, batch script) that will monitor that "job list" to see if there are any new jobs that need processing 17 16 18 17 19 These two methods might seem like the same thing, but they are not. The most important difference is that the 2nd approach scales better with higher web site traffic, because it allows the "worker" process to be running on the completely separate machine. Also, there can be several "worker" machines, working together, splitting the workload, with a trivial synchronization involved.