# Make jpg thumbnails from vids in database

**URL:** <https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818>\
**Category:** Rails\
**Created:** [April 2, 2007, 1:31am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818 "2007-04-02T01:31:28Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 2, 2007, 1:31am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/1 "2007-04-02T01:31:28Z")

</div>

Hey does anyone know of any resources (web, books, anything) that could  
explain how to make a rails app “read” a file in the database like a  
video file and creates a jpg thumbnail?

This would be very helpful as I am trying to create a site where users  
can uplaod video files, but I would like to have the rails app  
automatically read and create a jpg thumbnail for preview before the  
user downloads.

Thanks guys

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 2, 2007, 1:43am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/2 "2007-04-02T01:43:07Z")

</div>

Paul S. wrote:

> Hey does anyone know of any resources (web, books, anything) that could  
> explain how to make a rails app “read” a file in the database like a  
> video file and creates a jpg thumbnail?
> 
> This would be very helpful as I am trying to create a site where users  
> can uplaod video files, but I would like to have the rails app  
> automatically read and create a jpg thumbnail for preview before the  
> user downloads.
> 
> Thanks guys

I don’t knwo hwo to edit in these forums, but when I said read the file  
I meant read the location fo the file in the database like  
blank\_video.avi and then generate a thumbnail from that .avi

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 3, 2007, 11:27pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/3 "2007-04-03T23:27:52Z")

</div>

That looks VERY useful thanks! Do you know of any online articles  
explaining how to implement in Rails. Or if not would you use the code  
in the model or something?

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 2, 2007, 1:37pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/4 "2007-04-02T13:37:02Z")

</div>

I think you’re looking for RMovie. [http://rmovie.rubyforge.org/](http://rmovie.rubyforge.org/) 🙂

RSL

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 12:47am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/5 "2007-04-04T00:47:25Z")

</div>

I don’t recall an rmovie tutorial anywhere but you might want to keep  
Googling. The model’s the most logical place for it IMO. I’ve used it  
before  
but I wrote my own initialize method do, which is something most people  
don’t advocate from what I’ve read on the net. I’m reluctant to get more  
specific because of that.

RSL

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 1:50am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/6 "2007-04-04T01:50:37Z")

</div>

Any idea how to accomplish the same results (take a screenshot) from  
Flash files instead of movie files?

Thanks.

Alex W. wrote:

> Russell N. wrote:
> 
> > I think you’re looking for RMovie. [http://rmovie.rubyforge.org/](http://rmovie.rubyforge.org/) 🙂
> > 
> > RSL
> 
> Holy crap. There is already a ruby version of almost everything.
> 
> I love this community.

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 3:51am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/7 "2007-04-04T03:51:30Z")

</div>

Well if it’s flash video then rmovie can get thumbnails of it, but I  
didn’t say swf’s, but as you can see I’m not exactly an expert on rmovie  
haha

Mark wrote:

> Any idea how to accomplish the same results (take a screenshot) from  
> Flash files instead of movie files?
> 
> Thanks.
> 
> Alex W. wrote:
> 
> > Russell N. wrote:
> > 
> > > I think you’re looking for RMovie. [http://rmovie.rubyforge.org/](http://rmovie.rubyforge.org/) 🙂
> > > 
> > > RSL
> > 
> > Holy crap. There is already a ruby version of almost everything.
> > 
> > I love this community.

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 5:09am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/8 "2007-04-04T05:09:36Z")

</div>

Sorry about the double reply, but I don’t know how to edit…One more  
question on Rmovie. In order to use it ffmpeg would have to be installed  
on the server right? if that’s true do most hosting companies allow or  
have a way to install ffmpeg? I am fairly new to rails and the various  
hosting companies/methods so I’m not sure the best way to implement this  
(mostly in terms of how to host it). Thanks for any help!

PaulSmith wrote:

> Well if it’s flash video then rmovie can get thumbnails of it, but I  
> didn’t say swf’s, but as you can see I’m not exactly an expert on rmovie  
> haha
> 
> Mark wrote:
> 
> > Any idea how to accomplish the same results (take a screenshot) from  
> > Flash files instead of movie files?
> > 
> > Thanks.
> > 
> > Alex W. wrote:
> > 
> > > Russell N. wrote:
> > > 
> > > > I think you’re looking for RMovie. [http://rmovie.rubyforge.org/](http://rmovie.rubyforge.org/) 🙂
> > > > 
> > > > RSL
> > > 
> > > Holy crap. There is already a ruby version of almost everything.
> > > 
> > > I love this community.

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 12:53pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/9 "2007-04-04T12:53:05Z")

</div>

On 04 Apr 2007, at 05:09, Paul S. wrote:

> Sorry about the double reply, but I don’t know how to edit…One more  
> question on Rmovie. In order to use it ffmpeg would have to be  
> installed  
> on the server right? if that’s true do most hosting companies allow or  
> have a way to install ffmpeg? I am fairly new to rails and the various  
> hosting companies/methods so I’m not sure the best way to implement  
> this  
> (mostly in terms of how to host it). Thanks for any help!

I doubt a shared hosting company will have ffmpeg installed by  
default. However, it never hurts to ask. If you haven’t decided on  
your hosting yet, just include this question in your presales  
inquiry. If you want total control over what will be installed, go  
for a VPS instead.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/10 "2007-04-04T15:46:08Z")

</div>

You’re going to most likely need to compile it on your own server. Not a  
terribly difficult task. I’ve done it a few times. You’ll need to look  
into  
how to compile it with flv or swf support though. I’m sure there’s  
something  
out there in Google land. Dreamhost’s wiki [[http://wiki.dreamhost.com/](http://wiki.dreamhost.com/)  
]  
has excellent instructions on compiling ffmpeg from source. Even if  
you’re  
on a different host it’d probably server you well to give those docs a  
once  
over.

RSL

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 12:59am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/11 "2007-04-04T00:59:35Z")

</div>

Russell N. wrote:

> I think you’re looking for RMovie. [http://rmovie.rubyforge.org/](http://rmovie.rubyforge.org/) 🙂
> 
> RSL

Holy crap. There is already a ruby version of almost everything.

I love this community.

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 7:28pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/12 "2007-04-04T19:28:43Z")

</div>

I’ve got a few sites up on DH and I like it. They’ve had some problems  
over  
the past year but once they got them fixed it’s been smooth sailing for  
me.  
Consensus on the mailing list is [obviously] going to vary. Most people  
here, from what I gather, aren’t running on shared hosting. I’m just not  
ready or able to pop down that kind of money for a vps or whatever. DH  
does  
what I need, is incredibly customizeable, and [in my opinion] provides  
really good customer service. YMMV

RSL

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 4, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/13 "2007-04-04T16:56:10Z")

</div>

I don’t have a host yet so that’s why I asked. I was actually looking  
into dreamhost quite a bit, but is it as good as other Rails specific  
hosting? The price is really good so I wasn’t sure? Any input from  
people who have used them would be great. And how much demand would  
extracting and saving the thumbnail put on the server? Would it bog down  
the server a lot?

Russell N. wrote:

> You’re going to most likely need to compile it on your own server. Not a  
> terribly difficult task. I’ve done it a few times. You’ll need to look  
> into  
> how to compile it with flv or swf support though. I’m sure there’s  
> something  
> out there in Google land. Dreamhost’s wiki [[http://wiki.dreamhost.com/](http://wiki.dreamhost.com/)  
> ]  
> has excellent instructions on compiling ffmpeg from source. Even if  
> you’re  
> on a different host it’d probably server you well to give those docs a  
> once  
> over.
> 
> RSL

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 5, 2007, 8:18am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/14 "2007-04-05T08:18:11Z")

</div>

Hi Paul,

not everybody is so happy with Dreamhost and using Rails on it. You  
might want to check out [http://www.railshostinginfo.com](http://www.railshostinginfo.com) and read the  
comments about Dreamhost before you decide to go with them.

Kind regards,

Nick

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 5, 2007, 1:11am UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/15 "2007-04-05T01:11:49Z")

</div>

Thanks that helped a lot. I don’t have that kind of cash either so I  
think I’ll go with them. Plus their wiki is REALLY helpful.

Russell N. wrote:

> I’ve got a few sites up on DH and I like it. They’ve had some problems  
> over  
> the past year but once they got them fixed it’s been smooth sailing for  
> me.  
> Consensus on the mailing list is [obviously] going to vary. Most people  
> here, from what I gather, aren’t running on shared hosting. I’m just not  
> ready or able to pop down that kind of money for a vps or whatever. DH  
> does  
> what I need, is incredibly customizeable, and [in my opinion] provides  
> really good customer service. YMMV
> 
> RSL

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 5, 2007, 4:50pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/16 "2007-04-05T16:50:57Z")

</div>

That being said, keep in mind that forums tend to be full of complaints  
when  
things aren’t working rather than praise because things are. There are a  
lot  
of people who _are_ happy with DH and don’t post comments on random  
review  
sites because we’re busy working on projects or doing things in our  
non-job  
lives. 🙂

RSL

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 5, 2007, 5:35pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/17 "2007-04-05T17:35:07Z")

</div>

Exactly. But where there’s smoke, there’s usually fire 🙂

The problem with most of the big shared hosting companies is that  
you’re in fact rolling a dice as a customer. Your hosting can be  
great or it can be a true hell. I have experience with quite a few  
shared hosting companies and most of them really give it their best,  
but if things go wrong, you can be in for quite a wait and can’t fix  
the server yourself.

DH was good enough for my personal stuff, but it was a big mistake  
running our customers’ sites on it: one day performance of the sites  
just went down the drain, support took quite a while to answer (in  
the meanwhile we were taking heavy fire from our customers as you can  
imagine and couldn’t give them any explanation), they did “something”  
and things went well for… 2 hours, then the server just went down  
completely, for over a day. I had backups of all data from the day  
before (lucky me), because they had to restore an older backup. But  
in defence of DH, the same has happened at hostingzoom and a few  
other shared hosts we were hosting PHP apps on as well. Also, if  
you’re living in Europe, keep in mind your business hours are night  
time in the US (and that’s when most shared hosts do their server  
reboots and all the stuff I have never had to do with my VPS’s or  
dedicated servers).

Bottom line, if you’re doing commercial applications (i.e. you’re  
making money off them), either explain and advise your customer to  
take a VPS or get one yourself. We went from a single VPS at  
Rimuhosting to three dedicated servers over the last year and a half  
and up until now, none of our sites have gone down and we kept total  
control over when to upgrade the server OS and/or apps. I don’t have  
to live in fear every day over and over anymore 🙂

On 05 Apr 2007, at 16:50, Russell N. wrote:

> That being said, keep in mind that forums tend to be full of  
> complaints when things aren’t working rather than praise because  
> things are. There are a lot of people who _are_ happy with DH and  
> don’t post comments on random review sites because we’re busy  
> working on projects or doing things in our non-job lives. 🙂
> 
> not everybody is so happy with Dreamhost and using Rails on it. You  
> might want to check out [http://www.railshostinginfo.com](http://www.railshostinginfo.com) and read the  
> comments about Dreamhost before you decide to go with them.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 5, 2007, 5:48pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/18 "2007-04-05T17:48:08Z")

</div>

On thumbnailing Flash:  
See the article below - specifically the section titled “Adding a  
Video Thumbnail”. Sub in your FLV file.  
[http://blog.go4teams.com/?p=56](http://blog.go4teams.com/?p=56)

On DreamHost:  
I have several clients I work with on DreamHost - in short, when it’s  
going good, it’s going GOOD. When it’s bad… it’s BAD. They have had  
quite a few bouts with extended downtime in the past couple of years.

In short, when it comes to web hosting, you get what you pay for.

Wes

---

<div class="post-metadata">

**Author:** ![azgar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/eb8c5e/32.png) [@azgar](https://www.ruby-forum.com/u/azgar)\
**Post date:** [April 5, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/make-jpg-thumbnails-from-vids-in-database/90818/19 "2007-04-05T17:52:08Z")

</div>

I too admit there are shortcomings and if/when my app with the biggest  
potential starts outgrowing DH I’ll have to [and also be able to afford  
to]  
move to a different host but I just wanted to put out there that there  
_are_  
some happy customers and not just disgruntled ones. I’m mostly gruntled.  
Though that outage last year was particularly nasty. I’ve been lucky  
though  
since then that none of the minor problems have affected my server at  
all.

RSL
