Can rails generate thumbnail images?

As guys I’m working on a project that should display the same thing as this, I think it makes sense to use some tools to automatically create thumbnails and save them to the database when I post the video

I also need some kind of similar rails code that performs the youtube function the same way, can anyone give me a hint on the rails code website.

thank

alt text

+3
source share
3 answers

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

I am looking for other options and this is a faster way to do.

+5
source

Source: https://habr.com/ru/post/1780475/


All Articles