{"id":13367382,"url":"https://github.com/asticode/Go-astisub","last_synced_at":"2025-03-12T18:32:37.814Z","repository":{"id":41045594,"uuid":"76661194","full_name":"asticode/go-astisub","owner":"asticode","description":"Manipulate subtitles in GO (.srt, .ssa/.ass, .stl, .ttml, .vtt (webvtt), teletext, etc.)","archived":false,"fork":false,"pushed_at":"2024-09-10T06:55:13.000Z","size":176,"stargazers_count":569,"open_issues_count":11,"forks_count":110,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-09-10T09:11:54.340Z","etag":null,"topics":["go","golang","golang-library","srt","stl","subtitle","ttml","webvtt"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asticode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-16T14:47:59.000Z","updated_at":"2024-09-10T07:19:03.000Z","dependencies_parsed_at":"2023-10-02T20:34:05.702Z","dependency_job_id":"644dbbb3-3984-4c3c-bd87-c3ce9f8f47ae","html_url":"https://github.com/asticode/go-astisub","commit_stats":{"total_commits":114,"total_committers":26,"mean_commits":4.384615384615385,"dds":"0.35964912280701755","last_synced_commit":"2f42372251880bbedef567e33782a33b5c8b97e6"},"previous_names":["asticode/go-subtitles"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astisub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astisub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astisub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asticode%2Fgo-astisub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asticode","download_url":"https://codeload.github.com/asticode/go-astisub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221309979,"owners_count":16795837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-library","srt","stl","subtitle","ttml","webvtt"],"created_at":"2024-07-30T00:01:46.316Z","updated_at":"2024-10-24T11:31:16.609Z","avatar_url":"https://github.com/asticode.png","language":"Go","readme":"[![GoReportCard](http://goreportcard.com/badge/github.com/asticode/go-astisub)](http://goreportcard.com/report/github.com/asticode/go-astisub)\n[![GoDoc](https://godoc.org/github.com/asticode/go-astisub?status.svg)](https://godoc.org/github.com/asticode/go-astisub)\n[![Test](https://github.com/asticode/go-astisub/actions/workflows/test.yml/badge.svg)](https://github.com/asticode/go-astisub/actions/workflows/test.yml)\n[![Coveralls](https://coveralls.io/repos/github/asticode/go-astisub/badge.svg?branch=master)](https://coveralls.io/github/asticode/go-astisub)\n\nThis is a Golang library to manipulate subtitles. \n\nIt allows you to manipulate `srt`, `stl`, `ttml`, `ssa/ass`, `webvtt` and `teletext` files for now.\n\nAvailable operations are `parsing`, `writing`, `applying linear correction`, `syncing`, `fragmenting`, `unfragmenting`, `merging` and `optimizing`.\n\n# Installation\n\nTo install the library:\n\n    go get github.com/asticode/go-astisub\n\nTo install the CLI:\n\n    go install github.com/asticode/go-astisub/astisub        \n\n# Using the library in your code\n\nWARNING: the code below doesn't handle errors for readibility purposes. However you SHOULD!\n\n```go\n// Open subtitles\ns1, _ := astisub.OpenFile(\"/path/to/example.ttml\")\ns2, _ := astisub.ReadFromSRT(bytes.NewReader([]byte(\"1\\n00:01:00.000 --\u003e 00:02:00.000\\nCredits\")))\n\n// Add a duration to every subtitles (syncing)\ns1.Add(-2*time.Second)\n\n// Fragment the subtitles\ns1.Fragment(2*time.Second)\n\n// Merge subtitles\ns1.Merge(s2)\n\n// Optimize subtitles\ns1.Optimize()\n\n// Unfragment the subtitles\ns1.Unfragment()\n\n// Apply linear correction\ns1.ApplyLinearCorrection(1*time.Second, 2*time.Second, 5*time.Second, 7*time.Second)\n\n// Write subtitles\ns1.Write(\"/path/to/example.srt\")\nvar buf = \u0026bytes.Buffer{}\ns2.WriteToTTML(buf)\n```\n\n# Using the CLI\n\nIf **astisub** has been installed properly you can:\n\n- convert any type of subtitle to any other type of subtitle:\n\n        astisub convert -i example.srt -o example.ttml\n\n- apply linear correction to any type of subtitle:\n\n        astisub apply-linear-correction -i example.srt -a1 1s -d1 2s -a2 5s -d2 7s -o example.out.srt\n\n- fragment any type of subtitle:\n\n        astisub fragment -i example.srt -f 2s -o example.out.srt\n\n- merge any type of subtitle into any other type of subtitle:\n\n        astisub merge -i example.srt -i example.ttml -o example.out.srt\n\n- optimize any type of subtitle:\n\n        astisub optimize -i example.srt -o example.out.srt\n\n- unfragment any type of subtitle:\n\n        astisub unfragment -i example.srt -o example.out.srt\n\n- sync any type of subtitle:\n\n        astisub sync -i example.srt -s \"-2s\" -o example.out.srt\n\n# Features and roadmap\n\n- [x] parsing\n- [x] writing\n- [x] syncing\n- [x] fragmenting/unfragmenting\n- [x] merging\n- [x] ordering\n- [x] optimizing\n- [x] linear correction\n- [x] .srt\n- [x] .ttml\n- [x] .vtt\n- [x] .stl\n- [x] .ssa/.ass\n- [x] .teletext\n- [ ] .smi\n","funding_links":[],"categories":["视频","視頻"],"sub_categories":["高级控制台界面","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasticode%2FGo-astisub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasticode%2FGo-astisub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasticode%2FGo-astisub/lists"}