Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Video Converter

Video Converter

The idea of VideoConverter is to create a plugin that you can attach to a model that allows the model to automatically re-encode the video in different formats and sizes using Amazon services.

The model should manage its original video file however it wants to.

The plugin should manage a VideoConversions table that tracks each conversion created from the original video file (e.g. tracks a unique format name, where each name maps to some set of options sent to ffmpeg), and where that converted video file is stored in S3. The plugin would add a habtm from the original video model to the video conversions, and add accessors to get the URL of the converted video file.

The general flow is this:

The video model initiates the plugin with something like: has_video_conversions :original_url => :url, # Method to get full the url of the original :formats => { [:format1_name => ‘ffmpeg options’, :format2_name => ‘ffmpeg options’]}

When it’s time to run a conversion, the following happens: * Video is pulled from location defined by original_url method to some expected place in S3 (and is kept there for the life of that video model) * AWS instance runs the conversion, and places the output in some expected place in S3 (and is kept there for the life of that video model) * After conversion is done, the entry for this format is updated in VideoConversions to mark as completed.

There are two great resources that will help with this, that I know about at least.

Converting Videos with a state machine - the VideoConversions table will likely have this state machine
http://jimneath.org/2008/06/03/converting-videos-with-rails-converting-the-video/
Converting videos with AWS, S3, and (sadly) Python
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1404&categoryID=152

Also, there’s probably some Ruby/Rails libraries you can use for interacting with the Amazon services as evidenced by the following plugin. I’m sure you’ll have to find some equally good libraries for AWS and S3 – I’m not even sure if you’ll use SimpleDB.

Rails ActiveResource and SimpleDB
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1242

Also, please take a look at the following which may or may not be useful. They’ve integrated that app with all the amazon services you’ll likely need. http://github.com/auser/pool-party/tree/master

Deliverables: * Plugin, which interacts with Amazon and manages the Video Conversions Table * Example rails project using the Plugin, which should define a Video.rb and VideosController (preferably uses SQLLite). Video.rb can use Paperclip.

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'