awesomie
awesomie

Reputation: 31

Generate a video from many images using RMagick in RoR

I am trying to generate a video from multiple images using RMagick. The images are saved into ActiveStorage and what I am trying to do is

images = Magick::ImageList.new(*["#{url_for(Post.first.image)}"," 
{url_for(Post.last.image)}"]) 
images.write("new_video.avi")

but that way seems not really working so basically all I want is calling images from activestorage and display them like a video. Any ideas?

Upvotes: 0

Views: 138

Answers (1)

Radil Radenkov
Radil Radenkov

Reputation: 21

Rmagick doesn't support video formats. You can generate a gif using the ImageList class with some time between each image. Here you can find a lot of good examples. Alternatively if you really need an AVI file you can switch to other libraries for example ffmpeg. Example here

Upvotes: 2

Related Questions