# How To Use BackgrounDRb

**URL:** <https://www.ruby-forum.com/t/how-to-use-backgroundrb/127405>\
**Category:** Rails\
**Created:** [January 28, 2008, 11:10pm UTC](https://www.ruby-forum.com/t/how-to-use-backgroundrb/127405 "2008-01-28T23:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercury](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@mercury](https://www.ruby-forum.com/u/mercury)\
**Post date:** [January 28, 2008, 11:10pm UTC](https://www.ruby-forum.com/t/how-to-use-backgroundrb/127405/1 "2008-01-28T23:10:46Z")

</div>

I’m trying to use BackgrounDRb to take care of video encoding using  
ffmpeg. I would love it if this tutorial ([http://escapegoat.org/](http://escapegoat.org/)  
2007/8/26/video-conversion) was more complete, however the code links  
are all broken.

I have run the following commands:  
$ script/plugin install svn://rubyforge.org//var/svn/backgroundrb  
$ rake backgroundrb:setup  
$ script/generate worker transcode\_video

Then in lib/workers/transcode\_video\_worker.rb I’ve added my code to  
call ffmpeg in do\_work(args).  
Ultimately, I’m having trouble calling MiddleMan… where can I call  
it from? What includes do I need? Must I use MiddleMan? Basically:  
How to I execute do\_work? I’d prefer to call it from the video model  
(app/models/video.rb) in the after\_save callback. Can I do that?

Basically I need a quick little how-to because the README for  
BackgrounDRb is confusing and frustrating with it’s lack of details in  
some places, and too many in others. Not to mention my generated code  
doesn’t look like the files they show… _sigh_ I’ve spent most of my  
work day trying to understand this: [http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/)  
and it’s not helping.

Thank you in advance for your help in getting me squared away with  
this popular plugin.

---

<div class="post-metadata">

**Author:** ![mercury](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@mercury](https://www.ruby-forum.com/u/mercury)\
**Post date:** [January 28, 2008, 11:15pm UTC](https://www.ruby-forum.com/t/how-to-use-backgroundrb/127405/2 "2008-01-28T23:15:28Z")

</div>

Hey there,

You might try a tutorial-ish type thing I wrote a long while ago:  
[http://warpspire.com/tipsresources/programming/long-running-tasks-in-rails-backgroundrb/](http://warpspire.com/tipsresources/programming/long-running-tasks-in-rails-backgroundrb/)

Good luck getting going with backgroundrb! I’ve found the bigger pain  
point is ffmpeg and the ridiculous build requirements/methods to get  
fully functional video encoding working 🙂

- Kyle
