RVideo is alive - really

Posted by Jon
on Thursday, September 13

It’s been a while since I posted about RVideo. Consider this a pre-release announcement.

RVideo is a Ruby gem that makes video and audio transcoding a bit easier. The gem wraps various video transcoding tools – ffmpeg and flvtool2 upon release. But it is extensible, so that other tools (like mencoder) can be added as needed. Transcoder instructions are specified by passing a recipe to RVideo, along with custom values.

For example:

1
2
3
4
5
6
recipe = "ffmpeg -i $input_file$ -r 29.97 -vcodec xvid -s $resolution$ $output_file"

transcoder = RVideo::Transcoder.new
transcoder.execute(recipe, {:input_file => "original.mov", 
                            :output_file => "processed.mp4", 
                            :resolution => "640x360"})

The resulting transcoder object will include information about the job, including metadata for the output file, etc. The execute method raises a variety of exceptions when it doesn’t work (e.g. input file not found, unsupported formats, could not save the output file), so you’ll want to run #execute in a begin/end block and handle each exception as needed.

I’ll go into more detail in a later post, so look for more updates soon. Expect the gem to launch sometime in October.

Comments

Leave a response

  1. JulienSeptember 13, 2007 @ 01:56 PM

    Good news !

    Can’t wait to have a test run !!!! Where is the svn repository !? ;-)

  2. JonSeptember 13, 2007 @ 07:27 PM

    Julien: there is an SVN repository, but the version there is out of date. I’m using mercurial for this project now, and it is more-or-less built in to a video transcoding app I’m working on. Once I get a little further, it will move to RubyForge.

    If you’re interested in taking a look at the alpha code, and want to provide some feedback, send me an email (my name at slantwisedesign dot com).

  3. Les FreemanSeptember 13, 2007 @ 07:32 PM

    I’m super excited about this. I can’t wait to see the release!

  4. chrisfarmsSeptember 14, 2007 @ 06:42 AM

    I love you!

    stops writing his ffmpeg wrapper

  5. Jay OwackSeptember 15, 2007 @ 07:05 AM

    We are anxiously awaiting this video goodness! :-)

  6. Christian WSeptember 26, 2007 @ 06:54 AM

    Could the Transcode class be used to output the transcoded data directly to STDOUT or a stream in some way, instead of to a file?

  7. rickSeptember 27, 2007 @ 03:56 PM

    FWIW I wrote a minimal ffmpeg wrapper into my ‘jack’ gem. http://rubyforge.org/projects/activereload/. It’s something I’m using in a few places, but I haven’t had time to publicize or document it that much. But, the ffmpeg stuff is pretty simple.