Skip to content
forked from Kam1k4dze/SubChat

SubChat is a command-line and GUI toolset for generating YouTube subtitles from chat logs.

License

Notifications You must be signed in to change notification settings

tsoding/SubChat

 
 

Repository files navigation

SubChat

SubChat is a command-line and GUI toolset for generating YouTube subtitles from chat logs.

IMPORTANT: Currently, only YouTube in desktop browsers is supported.

Tsoding Chat on this screenshot was created entirely using YouTube subtitles.

Screenshot from Tsoding stream.

Project Components

The project has two separate targets:

  • config_generator_gui: A GUI tool for creating and editing INI config files used by the subtitle generator.
    System Dependencies: OpenGL, GLEW

    Uses Submodules: GLFW, Dear ImGui, TinyXML2, SimpleIni, Magic Enum, UTFCPP, nativefiledialog-extended.

  • subtitles_generator: A CLI tool that converts CSV chat logs into subtitle files (YTT/SRV3) using a given config file.
    Uses Submodules: CLI11, TinyXML2, SimpleIni, Magic Enum, UTFCPP.


CSV Format Specification

The input CSV file must follow this schema:

time,user_name,user_color,message

Where:

  • time: Timestamp when the message was sent (in milliseconds or seconds, see -u flag)
  • user_name: The display name of the user who sent the message
  • user_color: Hex color code for the username (e.g., #FF0000 for red)
  • message: The actual chat message content

Example CSV:

time,user_name,user_color,message
1234567,User1,#FF0000,"Hello world!"
1235000,User2,,"Hi there!"
1240000,User1,#FF0000,"How are you?"

For example, you can download chat from Twitch VOD using https://www.twitchchatdownloader.com/


Cloning the Repository

Clone the repository recursively to fetch all submodules:

git clone --recursive --shallow-submodules https://github.com/Kam1k4dze/SubChat

If already cloned without submodules:

git submodule update --init --recursive

Building the Project

The project uses CMake (minimum required version 3.14) and is set up to build both targets. Note that OpenGL and GLEW are only needed for the GUI target.

Steps to Build All Targets

  1. Create a build directory and navigate into it:

    mkdir build && cd build
  2. Configure the project:

    cmake ..
  3. Build everything:

    cmake --build .

Building Without GUI

If you only need the CLI tool and don't have OpenGL/GLEW installed:

cmake -DBUILD_GUI=OFF ..
cmake --build .

Usage

config_generator_gui

Launch this tool to generate or modify INI config files:

./config_generator_gui

GUI Interface

subtitles_generator

Convert a chat CSV into a subtitle file using a config file.

Command-Line Options

./subtitles_generator -c <config_path> -i <chat_csv_path> -o <output_file> -u <time_unit>
  • -h, --help
    Display help information and exit.

  • -c, --config
    Path to the INI config file.

  • -i, --input
    Path to the CSV file with chat data.

  • -o, --output
    Output subtitle file (e.g., output.ytt or output.srv3).

  • -u, --time-unit
    Time unit in the CSV: "ms" or "sec".

About

SubChat is a command-line and GUI toolset for generating YouTube subtitles from chat logs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.4%
  • CMake 0.6%