Reputation: 31
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
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