{"id":15066941,"url":"https://github.com/ecdye/macsubtitleocr","last_synced_at":"2025-04-10T13:53:51.392Z","repository":{"id":256433437,"uuid":"851255178","full_name":"ecdye/macSubtitleOCR","owner":"ecdye","description":"Convert bitmap subtitles into SubRip format using the macOS Vision framework","archived":false,"fork":false,"pushed_at":"2024-10-24T04:46:09.000Z","size":614,"stargazers_count":9,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-24T11:25:13.024Z","etag":null,"topics":["collaborate","macos","ocr","subtitles","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/ecdye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2024-09-02T18:19:20.000Z","updated_at":"2024-10-24T04:46:13.000Z","dependencies_parsed_at":"2024-10-26T06:17:17.001Z","dependency_job_id":null,"html_url":"https://github.com/ecdye/macSubtitleOCR","commit_stats":null,"previous_names":["ecdye/macsup2srt","ecdye/macsubtitleocr"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecdye%2FmacSubtitleOCR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecdye%2FmacSubtitleOCR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecdye%2FmacSubtitleOCR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecdye%2FmacSubtitleOCR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecdye","download_url":"https://codeload.github.com/ecdye/macSubtitleOCR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248229256,"owners_count":21068863,"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":["collaborate","macos","ocr","subtitles","swift"],"created_at":"2024-09-25T01:14:07.276Z","updated_at":"2025-04-10T13:53:51.373Z","avatar_url":"https://github.com/ecdye.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# macSubtitleOCR\n\n[![License](https://img.shields.io/github/license/ecdye/macSubtitleOCR)](https://github.com/ecdye/macSubtitleOCR/blob/main/LICENSE.md)\n[![CodeQL](https://github.com/ecdye/macSubtitleOCR/actions/workflows/codeql.yml/badge.svg)](https://github.com/ecdye/macSubtitleOCR/actions/workflows/codeql.yml)\n[![Test](https://github.com/ecdye/macSubtitleOCR/actions/workflows/test.yml/badge.svg)](https://github.com/ecdye/macSubtitleOCR/actions/workflows/test.yml)\n[![Lint](https://github.com/ecdye/macSubtitleOCR/actions/workflows/lint.yml/badge.svg)](https://github.com/ecdye/macSubtitleOCR/actions/workflows/lint.yml)\n\n## Overview\n\n**macSubtitleOCR** converts bitmap subtitles into the SubRip subtitle format (SRT) using the macOS Vision framework to perform OCR.\nCurrently PGS and VobSub subtitles are supported.\n\nFor more details on OCR accuracy, refer to the [Accuracy](#accuracy) section below.\n\n[Release](https://github.com/ecdye/macSubtitleOCR/releases/latest) and [Nightly](https://github.com/ecdye/macSubtitleOCR/releases/tag/nightly) builds are provided for `arm64`.\nUnfortunately, GitHub Actions doesn't provide a runner I can build `x86_64` binaries on, sorry.\nHowever, you should be able to compile for `x86_64` on you own machine by following the directions in the [Building the Project](#building-the-project) section below.\n\n### Features\n\n- Export raw JSON output from Vision for further analysis\n- Save `.png` images of subtitles for manual correction of OCR output\n- Optional support for FFmpeg in case of any issues with internal decoder\n\n### Supported Formats\n\n- PGS (`.mkv`, `.sup`)\n- VobSub (`.mkv`, `.sub`, `.idx`)\n\n## Building the Project\n\n\u003e [!IMPORTANT]\n\u003e macSubtitleOCR requires Swift 6 support to compile\n\nTo make and install the project, follow the directions below:\n\n### Build Internal Decoder Only\n\nTo build macSubtitleOCR, follow these steps:\n\n``` shell\ngit clone https://github.com/ecdye/macSubtitleOCR\ncd macSubtitleOCR\nswift build --configuration release\n```\n\n### Build With FFmpeg Decoder\n\nTo build with FFmpeg support, follow these steps:\n\n``` shell\nbrew install ffmpeg\ngit clone https://github.com/ecdye/macSubtitleOCR\ncd macSubtitleOCR\nUSE_FFMPEG=1 swift build --configuration release -Xswiftc -DFFMPEG\n```\n\n## Running Tests\n\nThe testing process compares OCR output against known correct results.\nTests aim for at least 95% accuracy, as there are slight differences in Vision results between machines.\n\n``` shell\nswift test\n```\n\n## Accuracy\n\nIn general, Vision produces a highly accurate output for almost all subtitles.\nIf you find an edge case with degraded performance, open an issue so it can be investigated.\n\nIn tests comparing Vision's output with [Tesseract](https://github.com/tesseract-ocr/tesseract), Vision consistently gave better results, particularly with tricky cases like properly recognizing `I`.\n\nWhile some tools, like [SubtitleEdit](https://github.com/SubtitleEdit/subtitleedit), may use binary image compare for marginally better accuracy, Vision offers more flexibility with built-in language support.\n\n## Contribution and TODO\n\nFor information on how to contribute to the project, please refer to [CONTRIBUTING.md](CONTRIBUTING.md).\n\nIf you're interested in working on specific features or improvements, check out issues tagged as [enhancements](https://github.com/ecdye/macSubtitleOCR/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement).\n\n## References\n\n- [Presentation Graphic Stream (PGS) Files](https://blog.thescorpius.com/index.php/2017/07/15/presentation-graphic-stream-sup-files-bluray-subtitle-format/)\n- [DVD Subtitle Stream (VobSub) Files](http://www.mpucoder.com/DVD/index.html)\n- [Matroska Technical Specifications](https://www.matroska.org/technical/elements.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecdye%2Fmacsubtitleocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecdye%2Fmacsubtitleocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecdye%2Fmacsubtitleocr/lists"}