mko
mko

Reputation: 22064

Can rails generate a thumbnail picture of a video?

How Guys I'm working on a project that need display same thing like this, I think it make sense to use some tools to automatically generate the thumbnails and save them in the database when I submit a video

I'm also want some similar rails code that do the youtube alike function, could anyone give me suggestion rails code website.

Thanks

alt text

Upvotes: 3

Views: 5486

Answers (3)

pdecarcer
pdecarcer

Reputation: 59

Its easier if you use directly ffmpeg, you have to install first ffmpeg and the you can call with this linesystem "ffmpeg -itsoffset -1 -i #{path} -s 320x240 -y -vframes 1 -f image2 -an 'app/assets/images/#{@video.title}.jpg'" -itsoffset is the time you want the thumbnail -i is the input file -an is the outpout file

I take a look for other options and this is the faster way to do.

Upvotes: 5

Omar Ali
Omar Ali

Reputation: 8617

I created a gem to ease interaction between Rails apps and FFMPEG: https://github.com/owahab/paperclip-ffmpeg

Upvotes: 5

gillyb
gillyb

Reputation: 8910

Check this out :
http://thewebfellas.com/blog/2009/2/22/video-thumbnails-with-ffmpeg-and-paperclip
hope it helps... :)

Upvotes: 2

Related Questions