Project

srt_parser

0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem to parse how much of a video an SRT file covers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.1.2, ~> 0.1
 Project Readme

SRT Parser

A nifty tool to get SRT coverage from a video. Still in the works!

Getting started

Add SRT Parser to your Gemfile with:

gem 'srt_parser'

Usage

Parse a given SRT file with a specified video duration:

subtitle = SRTParser::Parser.parse(File.new('MY_SRT_FILENAME.srt'), duration)

Then, to get the coverage from that file:

coverage = subtitle.coverage

You can also merge multiple subtitles for the same video to get an aggregate coverage:

merged_subtitle = SRTParser::Subtitle.merge(SUBTITLE_1, SUBTITLE_2)
merged_subtitle.coverage

Contributing

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