Subrip

Command-line utility to shift subtitles.

My solution to RubyLearning.com's challenge # 1 http://rubylearning.com/blog/2009/09/24/rpcfn-shift-subtitle-1/

Installation

Add this line to your application's Gemfile:

gem 'subrip'

And then execute:

$ bundle

Or install it yourself as:

$ gem install subrip

Usage

In the command-line,

shift_subtitle -o add -t 2,500 input/batman_begins.srt output/batman_begins.srt

where:

-o => Operation switch. Accepts either 'add' or 'sub' (without the quotes).

-t => Time to shift. It's of the form SS,MMM. Example: -t 02,500 meaning 2 seconds and 500 milliseconds.

The last two parameters are the input subtitle file and the output subtitle file respectively.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request