Skip to content
kianelboPublic

About

Library and CLI for subtitle files

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Go Reference codecov

Subgo is a modern, lightweight Go library and command-line tool for manipulating subtitle files. It provides a simple, consistent API for loading, transforming, and exporting subtitles across multiple formats.

Installation

For your go projects:

go get github.com/kianelbo/subgo@latest

For the CLI, standalone binaries are available here.

CLI Usage

subgo <input-file> [flags]

Features

Flag Description
-o, --output Output file (default: output.srt)
-s, --shift Shift timing (e.g., 300ms, -1s)
-t, --stretch Stretch factor (e.g., 1.05 for 5% longer)
-c, --clamp Clamp negative times to zero (default: true)
--trim-first Remove first n events
--trim-last Remove last n events
--trim-before Remove events before timestamp
--trim-after Remove events after timestamp
--remove-hi Remove hearing impaired annotations
--remove-ids Remove events by comma-separated indices

Example

subgo eraserhead.srt --trim-before 1m --shift 300ms --remove-hi -o eraserhead.srt

Library Usage

import "github.com/kianelbo/subgo"

sub, _ := subgo.Load("input.ass")
sub = sub.Shift(300*time.Millisecond, true)
sub = sub.Stretch(1.05, 0)
sub.Save("output.srt")

Supported Formats

  • SRT
  • ASS/SSA
  • WebVTT
  • SBV
  • TTML

About

Library and CLI for subtitle files

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages