Giter Club home page Giter Club logo

libgosubs's Introduction

libgosubs

Golang library to read and write subtitles in the following formats

  • Advanced SubStation Alpha v4
  • SRT
  • TTML v1.0 - This is based on the spec provided by Netflix in their documentation
  • WebVTT experimental support
  • MicroDVD experimental support

notes

TTML is somewhat complex to implement in Go due to the way that Go handles XML namespaces. Until this issue is fixed, two different structs for reading and writing, as well as a lengthy conversion function will probably be necessary. See the test file for a sample (and probably poor) implementation.

todo

  • Clean up the ASSv4 format, specifically do something about the way headers are handled

updates

  • Experimental MicroDVD format support added

libgosubs project garbage

Documentation

Available via Godoc

Godoc Format
GoDoc ASS
GoDoc SRT
GoDoc TTML
GoDoc WVTT
GoDoc MicroDVD

Test Coverage

Coverage Format
gocover.io go ASS
gocover.io go SRT
gocover.io go TTML
gocover.io go WVTT
gocover.io go MDVD

Other

Go Report Card

libgosubs's People

Contributors

wargarblgarbl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

libgosubs's Issues

ttml: html.UnescapeString

need this otherwise you get escaped text:

WEBVTT

00:19:34.000 --> 00:19:34.017
And Mrs. Ho says she's
ready to cut her birthday cake.

00:19:34.041 --> 00:19:35.308
She wants you to hurry home.

00:19:35.332 --> 00:19:36.000
- Did you get me something to give her?
- Yes, this.

the problem of "\ufeff" with a num

if line != "" && line != "\ufeff" {

id, err := strconv.Atoi(i[0])

if the file is code with utf8+bom, this package parse srt fail :

the srt file like this:

1  // here ! it is \ufeff and 1
00:00:01,430 --> 00:00:03,230
前情提要

2
00:00:01,430 --> 00:00:03,230
{\pos(190.2,244.8)}西部世界

use the function ParseSrt() to parse the file , go program throw error

strconv.Atoi: parsing "\ufeff1": invalid syntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.