Converting video to flash and mp4 ruby on rails?

2020-07-23 06:06发布

I'm currently the lead dev (read only dev!) on a website for our youth church called base..

http://mybase.co

At the moment i'm working on a "2.0" style iteration of the site hoping to make it more content rich and more mobile friendly..

We have been using Vimeo to host our videos but would like to start hosting our own videos so that when we wanna do an iphone app for streaming the latest content we've got a big catalog of videos on our own server ready to go, plus it gives us a lot of other flexibility..

I'm looking for a way of converting videos when we upload them to both a flash version and an iOS ready version.

The site is built on ruby on rails and hosted on a Ubuntu 10.04 server i have full root access to the server and can install anything necessary..

Basically what i'm asking is:

  1. Whats the easiest way of converting videos from ruby (i've heard some buzz about FFMPEG)
  2. Is it gonna totally hog the resources? (its a virtualized server with 1.5GB of ram hosting 2 other sites so anyway to keep resource usage down would be awesome even if it takes a few hours to convert)
  3. Is there a "nice" way of doing it? (a clean API as apposed to shelling out using system("convert ma videoze") )

Thanks :)

Daniel

3条回答
Viruses.
2楼-- · 2020-07-23 06:23

streamio-ffmpeg seems to me more active gem

https://github.com/streamio/streamio-ffmpeg

查看更多
何必那么认真
3楼-- · 2020-07-23 06:35

I'm a programmer of Japanese photo & video hosting service.

In my project, I chose FFmpeg::Command (written by Perl, available on CPAN) for converting video.

I also chose RVideo gem for taking capture thumbnail image of video and inspecting video meta information.

There is many forks of RVideo gem, but I chose https://github.com/newbamboo/rvideo because this is one of the most active repos.

Converting video is very heavy job for CPU. I recommend you to separate job servers from app servers.

查看更多
劳资没心,怎么记你
4楼-- · 2020-07-23 06:42
  1. FFMPEG is really what you need here.

  2. As more jobs you'll send to it, as more it will eat of your RAM. But you can organize simple queue and background job for converting video.

  3. I have never used gems for it but you can look this list:

查看更多
登录 后发表回答