• Stars
    star
    121
  • Rank 293,032 (Top 6 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 16 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official home of the RVideo project, a Ruby gem for video and audio transcoding.
RVideo

RVideo allows you to inspect and process video files.


Installation is a little involved. First, install the gem:

  sudo gem install rvideo
  
Next, install ffmpeg and (possibly) other related libraries. This is
documented elsewhere on the web, and can be a headache. If you are on OS X,
the Darwinports build is reasonably good (though not perfect). Install with:

  sudo port install ffmpeg

Or, for a better build (recommended), add additional video- and audio-related
libraries, like this:

  sudo port install ffmpeg +lame +libogg +vorbis +faac +faad +xvid +x264 +a52
  
Most package management systems include a build of ffmpeg, but many include a
poor build. So you may need to compile from scratch.

If you want to create Flash Video files, also install flvtool2:

  sudo gem install flvtool2

Once ffmpeg and RVideo are installed, you're set. 

To inspect a file, initialize an RVideo file inspector object. See the 
documentation for details.

A few examples:

  file = RVideo::Inspector.new(:file => "#{APP_ROOT}/files/input.mp4")
  
  file = RVideo::Inspector.new(:raw_response => @existing_response)
  
  file = RVideo::Inspector.new(:file => "#{APP_ROOT}/files/input.mp4",
                                :ffmpeg_binary => "#{APP_ROOT}/bin/ffmpeg")

  file.fps        # "29.97"
  file.duration   # "00:05:23.4"

To transcode a video, initialize a Transcoder object.

  transcoder = RVideo::Transcoder.new

Then pass a command and valid options to the execute method

  recipe = "ffmpeg -i $input_file$ -ar 22050 -ab 64 -f flv -r 29.97 -s"
  recipe += " $resolution$ -y $output_file$"
  recipe += "\nflvtool2 -U $output_file$"
  begin
    transcoder.execute(recipe, {:input_file => "/path/to/input.mp4",
      :output_file => "/path/to/output.flv", :resolution => "640x360"})
  rescue TranscoderError => e
    puts "Unable to transcode file: #{e.class} - #{e.message}"
  end

If the job succeeds, you can access the metadata of the input and output
files with:

  transcoder.original     # RVideo::Inspector object
  transcoder.processed    # RVideo::Inspector object

If the transcoding succeeds, the file may still have problems. RVideo
will populate an errors array if the duration of the processed video
differs from the duration of the original video, or if the processed
file is unreadable.

Thanks to Peter Boling for early work on RVideo.

Contribute to RVideo! If you want to help out, there are a few things you can 
do.

- Use, test, and submit bugs/patches
- We need a RVideo::Tools::Mencoder class to add mencoder support.
- Other tool classes would be great - On2, mp4box, Quicktime (?), etc.
- Submit other fixes, features, optimizations, and refactorings

If RVideo is useful to you, you may also be interested in RMovie, another Ruby
video library. See http://rmovie.rubyforge.org/ for more.

Finally, watch for Zencoder, a commercial video transcoder built by Slantwise 
Design. Zencoder uses RVideo for its video processing, but adds file queuing,  
distributed transcoding, a web-based transcoder dashboard, and more. See 
http://zencoder.tv or http://slantwisedesign.com for more.

Copyright (c) 2007 Jonathan Dahl and Slantwise Design. Released under the MIT 
license.

More Repositories

1

html5-boilerplate-for-wordpress

The HTML5 Boilerplate adapted into a WordPress template, including Bruce Lawson's HTML5 blog markup.
PHP
633
star
2

go-dash

A Go library for generating MPEG-DASH manifests.
Go
216
star
3

zencoder-php

Zencoder integration library for PHP.
PHP
110
star
4

zencoder-rb

Zencoder integration gem.
Ruby
105
star
5

zencoder-py

Zencoder integration library for Python
Python
63
star
6

disque-go

Go client for the Disque server
Go
47
star
7

video-js-for-wordpress

The VideoJS HTML5 video player library in plugin form for
JavaScript
40
star
8

zencoder-node

Node integration library for Zencoder
JavaScript
35
star
9

recurrent

Scheduled tasks.
Ruby
32
star
10

zencoder-fetcher

Notification retrieval.
Ruby
25
star
11

m3uzi

Read/write M3U8 files with (relative) ease.
Ruby
24
star
12

net-ntp

Read time from NTP
Ruby
23
star
13

gokay

Code generated struct validation tool for go.
Go
23
star
14

zenflow

Development workflow helper
Ruby
22
star
15

messenger

Send messages to email, http(s), sms, jabber, twitter, slack, and campfire.
Ruby
18
star
16

go-remote-config

A Go library for configuration management with JSON files in remote storage.
Go
14
star
17

VideoBooth

Simple app to record a user's webcam and transcode it through Zencoder. http://videobooth.herokuapp.com/
JavaScript
14
star
18

index-tanked

Ruby
13
star
19

zencoder-java

Zencoder Java client library
Java
10
star
20

go-smile

A Golang implementation of the Jackson-Smile data format
Go
9
star
21

locker

A locking mechanism for limiting the concurrency of ruby code using the database
Ruby
9
star
22

redis-queue

A Go implementation of a FIFO queue backed by Redis
Go
7
star
23

zpv

Stick that in your pipe and view it.
C
7
star
24

filepicker-zencoder

JavaScript
7
star
25

zencoder-dotnet

Zencoder integration app for .NET.
C#
6
star
26

ceiling-cat

...is watching you.
Ruby
6
star
27

contribflow

Contribflow is a suite of high-level repository operations for making open source contributions easier.
JavaScript
5
star
28

zencoder-ex

Elixir integration library for Zencoder
Elixir
4
star
29

fastly-tokens

Generate tokens for securing content distributed with the Fastly CDN
Go
3
star
30

zensockets

Repository for demo code on building an app around Zencoder.
JavaScript
3
star
31

zencoder-cli

Zencoder CLI
Ruby
3
star
32

demos

All the demos, all the time
JavaScript
2
star
33

go-fastly-purge

Go
2
star
34

dropwizard-s3-config

Dropwizard provider to retrieve application configuration from an S3 URI
Java
2
star
35

cloudharmony-benchmark

Cloud Harmony benchmark test harness
PHP
2
star