How do i make rails wait until an ffmpeg call is complete?

Why don’t you consider the following setup:

  • Let the user upload the movie

  • Hand the movie over to Backgroundrb for processing and render a “Movie being processed”-message and a PeriodicalUpdater to your view

  • In the PeriodicalUpdater method, query Backgroundrb to see if the processing is finished

  • If it’s finished, render it in the page

This way, you’ll avoid locking up one of your mongrels during a possible long running process (and movie processing tends to be a long running process). On top of that, the user can continue working with your application while the processing is taking place. It might require you to rethink your interface a bit, but the user experience will be substantially improved.

Best regards

Peter De Berdt

Could you post your code, as far as I know, the ´ffmpeg xxxxx´calls from ruby execute synchronically, so it should wait before going further.