Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Voyeur is a ruby gem that converts almost any video format into the common formats you need to display HTML5 video
Ruby
branch: gh-pages

This branch is even with gh-pages

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
css
images
README.md
index.html

README.md

Voyeur

Voyeur is a ruby library that will take your video files and convert them to common HTML5 formats exposing an easy to use API. Seriously it's like falling out of a tree then climbing back.

Installation

The gem is easily installed by including the following line in your Gemfile (if you role that way)

gem 'voyeur'

or on the command line

gem install voyeur
require 'voyeur'

Setup

This gem requires ffmpeg to be installed. If you require assistance there is a basic guide included in the wiki page. Feel free to add more!
You can also try out automated setup scripts (at the moment we only have for ubuntu):

Usage

Simple conversions may be done by simply:

Voyeur::Video.new( filename: path_to_file ).convert( to: :mp4 )

This will convert the video into Mp4 and save it in the same directory as the original video.

Alternatively you can convert to all 3 types at once:

Voyeur::Video.new( filename: path_to_file ).convert_to_html5

This will convert the video into 3 formats. Mp4, Ogv and Webm and place them in the same folder as the parent.

I have allowed the user to specify an output filename. (Note: if no output filename the file is just named after the original file):

Voyeur::Video.new( filename: path_to_file ).convert( to: :mp4, output_filename: "my_cool_video" )

This will give you a converted video called "my_cool_video.mp4".

You can also convert to all with the following:

Voyeur::Video.new( filename: path_to_file ).convert_to_html5( output_filename: "my_cool_video" )

It is also possible to place the formatted video in a custom folder:

Voyeur::Video.new( filename: path_to_file ).convert( to: :mp4, output_path: "my/cool/file/path" )

or

Voyeur::Video.new( filename: path_to_file ).convert_to_html5( output_path: "my/cool/file/path" )

Extendibility

I've designed this in the hopes that others will be able to add other formats / conversion options (haven't quite gone that far yet). Right now it's as simple as creating a file similar to this:

module Voyeur
  class Mp4 < Converter

    def file_extension
      "mp4"
    end

    def convert_options
      "-b 1500k -vcodec libx264 -g 30"
    end
  end
end

The two methods file_extension and convert options are mandatory.

Todo

  1. Spawn processes simultaniously so more than one video can be converted at once.
  2. Add functionality so that users can use more specific convert options

Authors

Peter Garbers

Hendrik Louw

Sources

Links

Something went wrong with that request. Please try again.