Create video from list of images using ruby on rai

2020-07-29 09:00发布

Hi I want to create a video from list of images on ruby on rails. I have searched alot and all i found out was ffmeg, but i guess that's a command line tool. How do i create it using pure ruby on rails. Is there any gem or tutorial. Please Help.

4条回答
我只想做你的唯一
2楼-- · 2020-07-29 09:08

Thanks to LordNeckbeard, i found this single command to convert images into video here ffmpeg .

ffmpeg -framerate 1/3 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp4
查看更多
混吃等死
3楼-- · 2020-07-29 09:16

It seems like i will have to use commandline tool as i did'nt find any gem that does all this stuff for me. install image magick install ffmpeg first convert all the jpg images into a gif file

convert -delay 250 -dispose Background *.jpg images.gif then convert that gif file into mp4 format ffmpeg -f gif -i images.gif outfile.mp4

I would love to have a better answer than this.

查看更多
\"骚年 ilove
4楼-- · 2020-07-29 09:21

there are some gems that work as an interface between ruby and ffmpeg like https://github.com/streamio/streamio-ffmpeg. There are some other few, try them out!

查看更多
SAY GOODBYE
5楼-- · 2020-07-29 09:33

You can access command line through RoR.

result = %x[some command line call here]

What you would have to do is be sure you have the names path to your end result and confirm the return code from the command line call.

查看更多
登录 后发表回答