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 frien开发者_StackOverflow社区dly..
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:
- Whats the easiest way of converting videos from ruby (i've heard some buzz about FFMPEG)
- 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)
- Is there a "nice" way of doing it? (a clean API as apposed to shelling out using system("convert ma videoze") )
Thanks :)
Daniel
FFMPEG is really what you need here.
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.
I have never used gems for it but you can look this list:
- http://rubygems.org/gems/ffmpeg-ruby ( https://github.com/hackerdude/ffmpeg-ruby )
- or this fork http://github.com/gwik/ffmpeg-ruby
- http://rvideo.rubyforge.org/
streamio-ffmpeg seems to me more active gem
https://github.com/streamio/streamio-ffmpeg
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.
精彩评论