Make jpg thumbnails from vids in database


#1

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


#2

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


#3

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?


#4

I think you’re looking for RMovie. http://rmovie.rubyforge.org/ :slight_smile:

RSL


#5

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


#6

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/ :slight_smile:

RSL

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

I love this community.


#7

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/ :slight_smile:

RSL

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

I love this community.


#8

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/ :slight_smile:

RSL

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

I love this community.


#9

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


#10

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/
]
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


#11

Russell N. wrote:

I think you’re looking for RMovie. http://rmovie.rubyforge.org/ :slight_smile:

RSL

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

I love this community.


#12

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


#13

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/
]
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


#14

Hi Paul,

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

Kind regards,

Nick


#15

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


#16

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. :slight_smile:

RSL


#17

Exactly. But where there’s smoke, there’s usually fire :slight_smile:

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 :slight_smile:

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. :slight_smile:

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

Best regards

Peter De Berdt


#18

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

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


#19

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