# Upload AVI convert to quicktime/flash

**URL:** <https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770>\
**Category:** Rails\
**Created:** [May 27, 2006, 12:57am UTC](https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770 "2006-05-27T00:57:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [May 27, 2006, 12:57am UTC](https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770/1 "2006-05-27T00:57:03Z")

</div>

Is there a way to upload an AVI and convert it into quicktime, or flash,  
and generate an output in those format(s).

Like YouTube…

I have no idea how that is done. I am fascinated and was wondering if it  
was possible.

Cheers.

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [May 27, 2006, 1:15am UTC](https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770/2 "2006-05-27T01:15:12Z")

</div>

Unless there’s something already written, I assume you’ll have to find  
a program which does this and has a command line interface (Google(avi  
mov command line)). That’s how I used to handle zip files in the ASP  
3.0 days. I expect Ruby, like most languages, has a way of doing  
things from the command line. I don’t know if there’s another way, but  
I hope this has pointed you in the right direction. You’ll have to do  
a bit of research yourself into what program to use and the Ruby  
syntax, unless someone else here already knows.  
-Nathan

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [May 27, 2006, 1:15am UTC](https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770/3 "2006-05-27T01:15:26Z")

</div>

On 5/26/06, Ken [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there a way to upload an AVI and convert it into quicktime, or flash,  
> and generate an output in those format(s).
> 
> Like YouTube…
> 
> I have no idea how that is done. I am fascinated and was wondering if it  
> was possible.

Sure.

1. Accept a file upload (preferably via a small cluster of Mongrels,  
so you don’t lock up the app during the long process)
2. Tell the user their upload completed
3. Send a message to, say, BackgrounDRb containing the file path you  
want to convert.
4. Have the background process do a system() call to some external  
tool that converts the video for you. There are numerous good choices,  
depending on your OS.
5. Mark the content as being converted in your app’s DB when the  
process completes.
6. Buy more servers as you start getting popular.

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [May 27, 2006, 2:42am UTC](https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770/4 "2006-05-27T02:42:03Z")

</div>

Wilson B. wrote:

> On 5/26/06, Ken [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Is there a way to upload an AVI and convert it into quicktime, or flash,  
> > and generate an output in those format(s).
> > 
> > Like YouTube…
> > 
> > I have no idea how that is done. I am fascinated and was wondering if it  
> > was possible.
> 
> Sure.
> 
> 1. Accept a file upload (preferably via a small cluster of Mongrels,  
> so you don’t lock up the app during the long process)
> 2. Tell the user their upload completed
> 3. Send a message to, say, BackgrounDRb containing the file path you  
> want to convert.
> 4. Have the background process do a system() call to some external  
> tool that converts the video for you. There are numerous good choices,  
> depending on your OS.
> 5. Mark the content as being converted in your app’s DB when the  
> process completes.
> 6. Buy more servers as you start getting popular.

Wow

Thanks for pointing me to BackgrounDRb. This thing looks very promising.

Just a quick question. Can I use fcgi instead of mongrel? What’s the  
difference?

And I look the last point of your list. Ha ha.

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [May 27, 2006, 3:46am UTC](https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770/5 "2006-05-27T03:46:06Z")

</div>

On 5/26/06, Ken K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > process completes.

You could use FCGI, but Mongrel has a much easier and cooler way to  
set up clusters, which you will quickly need to keep your sanity.  
Might as well start off right.  
It’s also about 100 times easier to install than FastCGI.

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [May 27, 2006, 2:42am UTC](https://www.ruby-forum.com/t/upload-avi-convert-to-quicktime-flash/61770/6 "2006-05-27T02:42:09Z")

</div>

Wilson B. wrote:

> On 5/26/06, Ken [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Is there a way to upload an AVI and convert it into quicktime, or flash,  
> > and generate an output in those format(s).
> > 
> > Like YouTube…
> > 
> > I have no idea how that is done. I am fascinated and was wondering if it  
> > was possible.
> 
> Sure.
> 
> 1. Accept a file upload (preferably via a small cluster of Mongrels,  
> so you don’t lock up the app during the long process)
> 2. Tell the user their upload completed
> 3. Send a message to, say, BackgrounDRb containing the file path you  
> want to convert.
> 4. Have the background process do a system() call to some external  
> tool that converts the video for you. There are numerous good choices,  
> depending on your OS.
> 5. Mark the content as being converted in your app’s DB when the  
> process completes.
> 6. Buy more servers as you start getting popular.

Wow

Thanks for pointing me to BackgrounDRb. This thing looks very promising.

Just a quick question. Can I use fcgi instead of mongrel? What’s the  
difference?

And I like the last point of your list. Ha ha.
