johnoneil/arib
Japan Association of Radio Industries and Businesses (ARIB) MPEG2 Transport Stream Closed Caption Decoding Tools
Featured achievements
The project's latest awards
#1 Repository of the week
#1 Repository of the week
#1 Repository of the week
arib
Japan Association of Radio Industries and Businesses (ARIB) MPEG2 Transport Stream Closed Caption Decoding Tools.


Description
Closed Captions (CCs) are encoded in Japanese MPEG Transport Streams as a separate PES (Packetized Elementary Stream) within the TS. The format of the data within this PES is described by the (Japanese native) ARIB B-24 standard. An English document describing this standard is included in the Arib/docs directory in this repository.
This python package provides tools to find and parse this ARIB closed caption information in MPGEG TS files and can be used in your own applications or used via the tools which this package provides.
Installation
Installation should be typical. We recommend using virtual environment.
pip install git+https://github.com/johnoneil/arib
or install from a local git checkout
git clone https://github.com/johnoneil/arib.git
cd arib
pip install -e .
Tools Provided
arib-ts2srt
This package provides the arib-ts2srt tool which extracts closed caption data from a .ts file and produces a simple .srt file output. This application also serves as a simple example of how to use the underying library.
arib-ts2srt stream.ts [-o <optional output .srt file>]
An option exists to alternately output .srt data directly to stdout:
arib-ts2srt --stdout stream.ts > output.srt
arib-ts2ass
This tool outputs ARIB subtitle information in a formatted .ass ("advanced substation alpha") file. The advantage is that text position, color and size can be captured and presented as intended in the .ts stream. This is esecially advantageous in presenting furigana or ruby pronunciation guides correctly.
If no sutitle stream identifieer (PID) is provided to the tool, arib-ts2ass will attempt to find the PID of the elementary stream carriing Closed Caption information, or one can be specified if it is known (see below concerning how to find PID values in TS files).
DRCS Support
This tool now has basic DRCS (dynamic runtime character) support, so when DRCS characters are encountered in the .ts stream they are cached and emitted as .ass drawing code when encountered in text. See the following image:

This behavior can be turned off if the .ass drawing code is too heavyweight by specifying the --disable-drcs command line option. This results in previous behavior whereby the "unknown character" glyph is emitted for DRCS (see below).

Experiments and Other Info
See here
Similar Projects
Discover other similar projects and AI models.
利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
AutoClip|The open-source OpusClip alternative — local-first AI clipping & MCP server, zero subscriptions. 一个链接,一键出片。开源 AI 视频剪辑桌面工具,将播客、访谈、课程等长视频自动剪成短视频,生成字幕、封面和发布文案,适配抖音、小红书、TikTok、Reels 与 YouTube Shorts。
Local video editor for coding agents: 41 FFmpeg tools with a machine-readable contract and an MCP server, for Claude Code, Cursor and Codex. Cut, captions, reframe, loudness, platform exports. No cloud, no API keys.
Gradio WebUI for creators and developers, featuring key TTS (Edge-TTS, kokoro) and zero-shot Voice Cloning (E2 & F5-TTS, CosyVoice), with Whisper audio processing, YouTube download, Demucs vocal isolation, and multilingual translation.
Python library and CLI for Microsoft Edge's online text-to-speech: neural voices, MP3 output, SRT subtitles. No Edge or API key needed.
视频硬字幕提取,生成srt文件。无需申请第三方API,本地实现文本识别。基于深度学习的视频字幕提取框架,包含字幕区域检测、字幕内容提取。A GUI tool for extracting hard-coded subtitle (hardsub) from videos and generating srt files.