{"id":17292929,"url":"https://github.com/xqq/libaribcaption","last_synced_at":"2025-04-05T05:02:28.008Z","repository":{"id":49523670,"uuid":"363606398","full_name":"xqq/libaribcaption","owner":"xqq","description":"Portable ARIB STD-B24 Caption Decoder/Renderer","archived":false,"fork":false,"pushed_at":"2024-12-06T08:44:05.000Z","size":997,"stargazers_count":106,"open_issues_count":2,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T04:03:33.818Z","etag":null,"topics":["arib","aribb24","caption","closedcaption","cpp","dtv","ffmpeg"],"latest_commit_sha":null,"homepage":"","language":"C++","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/xqq.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":"2021-05-02T08:51:22.000Z","updated_at":"2025-03-22T14:57:12.000Z","dependencies_parsed_at":"2023-11-12T01:29:09.345Z","dependency_job_id":"6f85971f-3bd1-4fac-bc5b-6f391c0b76ce","html_url":"https://github.com/xqq/libaribcaption","commit_stats":{"total_commits":526,"total_committers":7,"mean_commits":75.14285714285714,"dds":0.04562737642585546,"last_synced_commit":"41a014d245adf66f425a8317a031477dd1f80c67"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqq%2Flibaribcaption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqq%2Flibaribcaption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqq%2Flibaribcaption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqq%2Flibaribcaption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xqq","download_url":"https://codeload.github.com/xqq/libaribcaption/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289409,"owners_count":20914464,"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":["arib","aribb24","caption","closedcaption","cpp","dtv","ffmpeg"],"created_at":"2024-10-15T10:44:49.070Z","updated_at":"2025-04-05T05:02:27.987Z","avatar_url":"https://github.com/xqq.png","language":"C++","readme":"libaribcaption\n======\n[日本語](README_ja.md)\n\nA portable caption decoder / renderer for handling ARIB STD-B24 based TV broadcast captions.\n\n## Background\nWhile **CEA-608/708** closed caption standards are used by the **ATSC** system in North America,\n**DVB Subtitles / DVB Teletext** defined in **DVB** standard are used in Europe and many parts of the world,\nJapan established its own TV broadcasting standard **ISDB** that includes a kind of caption service defined in **ARIB STD-B24**\nby the **A**ssociation of **R**adio **I**ndustries and **B**usinesses (ARIB).\n\nBrazil also adopted **ISDB-T** International for their broadcasting by establishing Brazilian version **SBTVD / ISDB-Tb** based on the Japanese standard,\nwhich has been widely used in South America countries and around the world.\nBrazilian version also includes a caption service for Latin languages defined in **ABNT NBR 15606-1** which is modified from **ARIB STD-B24** specification.\nPhilippines also adopted ISDB-T International based on the Brazilian standards,\nbut uses **UTF-8** for caption encoding based on the Japansese specification **ARIB STD-B24**.\n\nThough ISDB-based TV broadcasting has been operating for about 20 years, ARIB based caption is still lacking support in general players.\n\n## Overview\nlibaribcaption provides decoder and renderer for handling ARIB STD-B24 based broadcast captions,\nmaking it possible for general players to render ARIB captions with the same effect (or even better) as Television.\n\nlibaribcaption is written in C++17 but also provides C interfaces to make it easier to integrate into video players.\nIt is a lightweight library that only depends on libfreetype and libfontconfig in the worst case.\n\nlibaribcaption is a cross-platform library that works on various platforms, including but not limited to:\n- Windows 7+\n- Windows XP+  (libfreetype required)\n- Linux  (libfreetype and libfontconfig required)\n- Android 2.x+  (libfreetype required)\n- macOS\n- iOS\n\n## Screenshot\n![screenshot0.png](screenshots/screenshot0.png)\n\n## Features\n- Support captions in Japanese (ARIB STD-B24 JIS), Latin languages (ABNT NBR 15606-1) and Philippine (ARIB STD-B24 UTF-8)\n- Full support for rendering ARIB additional symbols (Gaiji) and DRCS characters\n- Lightweight and portable implementation that works on various platforms\n- Performance optimized (SSE2 on x86/x64) graphics rendering\n- Multiple text rendering backend driven by DirectWrite / CoreText / FreeType\n- Zero third-party dependencies on Windows (using DirectWrite) and macOS / iOS (using CoreText)\n- Built-in font fallback mechanism\n- Built-in DRCS converting table for replacing / rendering known DRCS characters into / by alternative Unicode\n\n## Build\nCMake 3.11+ and a C++17 compatible compiler will be necessary for building. Usually you just have to:\n```bash\ncd libaribcaption\nmkdir build\ncd build\ncmake .. -DCMAKE_BUILD_TYPE=Release\ncmake --build . -j8\ncmake --install .      # Optional\n```\n\nBy default libaribcaption is compiled as static library, indicate `ARIBCC_SHARED_LIBRARY:BOOL=ON` to build as a shared library:\n```bash\ncmake .. -DCMAKE_BUILD_TYPE=Release -DARIBCC_SHARED_LIBRARY:BOOL=ON    # or -DBUILD_SHARED_LIBS:BOOL=ON\n```\n\nlibaribcaption has several CMake options that can be specified:\n```bash\nARIBCC_BUILD_TESTS:BOOL            # Compile test codes inside /test. Default to OFF\nARIBCC_SHARED_LIBRARY:BOOL         # Compile as shared library. Default to OFF\nARIBCC_NO_EXCEPTIONS:BOOL          # Disable C++ Exceptions. Default to OFF\nARIBCC_NO_RTTI:BOOL                # Disable C++ RTTI. Default to OFF\nARIBCC_NO_RENDERER:BOOL            # Disable the renderer and leave only the decoder behind. Default to OFF\nARIBCC_IS_ANDROID:BOOL             # Indicate target platform is Android. Detected automatically by default.\nARIBCC_USE_DIRECTWRITE:BOOL        # Enable DirectWrite font provider \u0026 renderer. Default to ON on Windows\nARIBCC_USE_GDI_FONT:BOOL           # Enable GDI font provider which is necessary for WinXP support. Default to OFF.\nARIBCC_USE_CORETEXT:BOOL           # Enable CoreText font provider \u0026 renderer. Default to ON on macOS / iOS\nARIBCC_USE_FREETYPE:BOOL           # Enable FreeType based renderer. Default to ON on Linux / Android\nARIBCC_USE_EMBEDDED_FREETYPE:BOOL  # Use embedded FreeType instead of searching system library. Default to OFF\nARIBCC_USE_FONTCONFIG:BOOL         # Enable Fontconfig font provider. Default to ON on Linux and other platforms\n```\n\nBy default, libaribcaption only enables DirectWrite on Windows and CoreText on macOS / iOS without any third-party\ndependencies, But you can still enable the FreeType based text renderer by indicating\n`-DARIBCC_USE_FREETYPE:BOOL=ON`.\n\nFor Windows XP support, you have to turn off DirectWrite (which will result in a crash), enable GDI font provider and FreeType:\n```bash\ncmake .. -DCMAKE_BUILD_TYPE=Release -ARIBCC_USE_DIRECTWRITE:BOOL=OFF -DARIBCC_USE_GDI_FONT:BOOL=ON -DARIBCC_USE_FREETYPE:BOOL=ON\n```\n\nFor enabling FreeType text renderer on Windows, consider using `vcpkg` or `msys2` for accessing third-party libraries.\n\nIf you are under some kind of environment (like Android NDK or Windows) that is hard to prepare system-wide installed FreeType,\nconsider using embedded FreeType by indicating `-DARIBCC_USE_EMBEDDED_FREETYPE:BOOL=ON`.\nThis option will automatically fetch and compile a static-linked FreeType library internally.\n\n## Usage\nlibaribcaption could be imported through `find_package()` if you have installed it into system:\n```cmake\ncmake_minimum_required(VERSION 3.11)\nproject(testarib LANGUAGES C CXX)\n\nfind_package(aribcaption REQUIRED)\n\nadd_executable(testarib main.cpp)\n\ntarget_compile_features(testarib\n    PRIVATE\n        cxx_std_17\n)\n\ntarget_include_directories(testarib\n    PRIVATE\n        ${ARIBCAPTION_INCLUDE_DIR}\n)\n\ntarget_link_libraries(testarib\n    PRIVATE\n        aribcaption::aribcaption\n)\n```\n\nOr using `add_subdirectory()` to import source folder directly:\n\n```cmake\ncmake_minimum_required(VERSION 3.11)\nproject(testarib2 LANGUAGES C CXX)\n\nset(ARIBCC_USE_FREETYPE ON CACHE BOOL \"Enable FreeType\")    # Indicate options here (optional)\nadd_subdirectory(thirdparty/libaribcaption)\n\nadd_executable(testarib2 main.cpp)\n\ntarget_compile_features(testarib2\n    PRIVATE\n        cxx_std_17\n)\n\ntarget_link_libraries(testarib2\n    PRIVATE\n        aribcaption::aribcaption\n)\n```\n\nOr using pkg-config if you have installed it into system:\n```bash\n# Link to libaribcaption static library\ngcc main.c -o main `pkg-config --cflags --libs --static libaribcaption`\n\n# Link to libaribcaption shared library\ngcc main.c -o main `pkg-config --cflags --libs libaribcaption`\n```\n\n## Documents\nSee the comments in [public headers](include/aribcaption), and [sample code with ffmpeg](test/ffmpeg)\n\n## Hints\nlibaribcaption's C++ headers are also written in C++17. If your environment doesn't support C++17,\nconsider using the C API or switch to a newer compiler.\n\nThe C API ([public headers] with \".h\" extensions) could be useful for calling from Pure C or other languages,\nsee [capi sample](test/capi) for usage.\n\n[public headers]: include/aribcaption\n\n## Recommended fonts\nThese fonts are recommended for Japanese ARIB caption rendering:\n\nWindows TV MaruGothic\n\nHiragino Maru Gothic ProN (macOS)\n\n[Rounded M+ 1m for ARIB](https://www.axfc.net/u/3107925)\n\n[和田研中丸ゴシック2004ARIB](https://ja.osdn.net/projects/jis2004/wiki/FrontPage)\n\n## License\nlibaribcaption is released under MIT License. You should include the copyright notice and permission notice in your distribution.\n\n## References\n[ARIB STD-B24](https://www.arib.or.jp/english/std_tr/broadcasting/std-b24.html)\n\n[ARIB TR-B14](https://www.arib.or.jp/english/std_tr/broadcasting/tr-b14.html)\n\nABNT NBR 15606-1\n\n[ISDB-T Standards (Philippines)](https://ntc.gov.ph/wp-content/uploads/2018/MC/MC-07-12-2014-Attachment.pdf)\n\n## Other implementations\nlibaribcaption is heavily inspired by the following projects:\n\n[aribb24](https://github.com/nkoriyama/aribb24)\n\n[aribb24.js](https://github.com/monyone/aribb24.js)\n\n[TVCaptionMod2](https://github.com/xtne6f/TVCaptionMod2)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqq%2Flibaribcaption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxqq%2Flibaribcaption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqq%2Flibaribcaption/lists"}