Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Quick and easy video attributes -- width, height, bitrate, codec, duration, framerate.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 video_dimensions.gemspec
README.md

video_dimensions

Quick and easy video attributes -- width, height, bitrate, codec, duration, framerate. Inspired by Sam Stephenson's Dimensions gem.

Features

Seamlessly supports multiple "backends" for sussing out video attributes, so it will try to find whatever utility the system has available (see Supported Backends) and use that.

Examples

require 'video_dimensions'

VideoDimensions.dimensions('~/Movies/720p.wmv') # => [1280, 720]
VideoDimensions.width('~/Movies/720p.wmv')      # => 1280
VideoDimensions.height('~/Movies/720p.wmv')     # => 720
VideoDimensions.bitrate('~/Movies/720p.wmv')    # => 5904
VideoDimensions.codec('~/Movies/720p.wmv')      # => "WMV3"
VideoDimensions.duration('~/Movies/720p.wmv')   # => "00:00:02"
VideoDimensions.framerate('~/Movies/720p.wmv')  # => 21.83

v = VideoDimensions('~/Movies/720p.wmv')
v.dimensions # => [1280, 720]
v.width      # => 1280
v.height     # => 720
v.bitrate    # => 5904
v.codec      # => "WMV3"
v.duration   # => "00:00:02"
v.framerate  # => 21.83

Requirements

One of the supported backends available in the system's $PATH.

Supported Backends

Install

$ gem install video_dimensions

Version History

0.3.0 (2013-03-25)

  • Add framerate attribute

0.2.0 (2012-08-25)

  • Add duration attribute

0.1.1 (2012-08-21)

  • Update FFmpeg backend patterns to match more video types

0.1.0 (2012-08-20)

  • Initial release.

Copyright

Copyright (c) 2012 Robert Speicher

See LICENSE.txt for details.

Something went wrong with that request. Please try again.