Skip to content

tautcony/ChapterTool

Repository files navigation

ChapterTool

License: GPL v3 .NET 10 CI NuGet NuGet downloads GitHub Pages GitHub downloads WASM

ChapterTool is a cross-platform Avalonia desktop chapter editor for importing, adjusting, combining, and exporting chapter lists from text, disc playlist, and media container sources.

Features

  • Import chapter data from text files, disc playlist formats, BDMV folders, and media containers.
  • Edit chapter names and timestamps in a cross-platform Avalonia UI.
  • Apply time adjustments with a Lua expression/script editor that supports diagnostics, completion, and syntax highlighting.
  • Calculate frame information from chapter times and frame rate settings.
  • Combine supported multi-segment sources such as MPLS and IFO.
  • Export chapters as .txt, .xml, .qpf, .TimeCodes.txt, .TsMuxeR_Meta.txt, .cue, .json, .vtt, and Celltimes output.
  • Use the CLI to list supported formats, inspect selectable chapter groups, and convert chapter sources without launching the desktop UI.

NuGet Package

The reusable chapter parsing and transformation library is published as ChapterTool.Core for .NET 8, .NET 9, and .NET 10 applications, including browser WebAssembly hosts.

Install it from NuGet.org:

dotnet add package ChapterTool.Core

Tagged releases are also published to GitHub Packages by the package workflow. The workflow publishes a version when a v* tag is pushed, and can also be started manually from the Actions tab.

Supported Import Sources

  • OGM-style text chapters: .txt
  • Adobe Premiere Pro chapter marker lists: .csv, and detected marker tables in .txt
  • Matroska chapter XML: .xml
  • WebVTT chapter cues: .vtt
  • Cue sheets and embedded cues: .cue, .flac, .tak
  • Blu-ray playlists: .mpls
  • Blu-ray BDMV folders through eac3to
  • DVD IFO files: .ifo
  • HD-DVD playlists: .xpl
  • Matroska containers through mkvextract, with ffprobe fallback when the tool cannot be invoked: .mkv, .mka, .mks, .webm
  • MP4/QuickTime/media files through ffprobe: .mp4, .m4a, .m4v, .mov, .qt, .3gp, .3g2, .asf, .wmv, .wma, .mp3, .aac, .ogg, .oga, .ogv, .opus, .wav, .nut, .aa, .aax, .ffmetadata, .ffmeta

Requirements

  • .NET 10 runtime for framework-dependent release builds.
  • .NET 10 SDK for building from source.
  • ffprobe from FFmpeg for media-container chapter import.
  • mkvextract from MKVToolNix for primary Matroska chapter extraction.
  • eac3to for importing Blu-ray BDMV folders.

External tool paths can be configured in the app settings. ChapterTool also searches common configured paths and platform tool locations where supported.

Command Line

The Avalonia executable also exposes maintained CLI workflows. Run these from a published artifact or from the project with dotnet run --project src/ChapterTool.Avalonia --.

ChapterTool.Avalonia formats
ChapterTool.Avalonia inspect input.mpls
ChapterTool.Avalonia convert input.xml --format txt --output chapters.txt
ChapterTool.Avalonia convert input.xml --format vtt --stdout
ChapterTool.Avalonia load input.xml

formats lists the stable CLI import/export surface. inspect reports imported groups, selectable options, and diagnostics. convert supports file output, stdout output, explicit group/option selection, XML language, CUE source file name, and frame-rate override. GUI-only expression transforms are intentionally not applied by CLI conversion.

Build And Test

Restore, build, and test the current solution:

dotnet restore ChapterTool.Avalonia.slnx
dotnet build ChapterTool.Avalonia.slnx --no-restore
dotnet test ChapterTool.Avalonia.slnx --no-restore

The CI workflow is .github/workflows/dotnet-ci.yml and runs on Linux with .NET 10, FFmpeg, and MKVToolNix.

To collect test coverage and generate a browsable HTML report:

./scripts/test-coverage.sh

The script runs the four test projects sequentially, excludes generated *.g.cs files through scripts/coverage.runsettings, then writes Cobertura XML and the HTML report under artifacts/coverage. HTML generation requires the ReportGenerator global tool:

dotnet tool install -g dotnet-reportgenerator-globaltool

Use ./scripts/test-coverage.sh -SkipHtml when only the XML coverage files are needed.

Browser WASM app (GitHub Pages)

src/ChapterTool.Wasm is a browser WebAssembly workspace for ChapterTool.Core (byte import, reload/append, chapter grid editing, templates, multi-select actions, preview, export download, drag and drop, settings, and en-US/zh-CN/ja-JP localization). It is published by .github/workflows/github-pages.yml to:

https://tautcony.github.io/ChapterTool/

Enable once: Settings → Pages → Source → GitHub Actions, then run the Deploy WASM (GitHub Pages) workflow (or push to master under the watched paths).

Publish

Use the publish helpers for local artifacts:

./scripts/publish.sh -Runtime linux-x64
./scripts/publish.sh -Runtime osx-arm64
./scripts/publish.sh -Runtime win-x64 -SelfContained

scripts/publish.ps1 is available for Windows publishing only:

./scripts/publish.ps1 -Runtime win-x64
./scripts/publish.ps1 -Runtime win-x64 -SelfContained

Framework-dependent artifacts are written under artifacts/publish/framework-dependent/<runtime>. Self-contained artifacts are written under artifacts/publish/self-contained/<runtime>.

The GitHub Actions publish job currently builds single-file framework-dependent artifacts for win-x64, linux-x64, and osx-arm64; the macOS job also packages the app as a .dmg.

Pushing a version tag runs the full CI and NuGet publication workflows first; after Publish to NuGet succeeds, Publish GitHub Release automatically packages the CI artifacts, extracts the corresponding ChangeLog.md section, and creates or updates the GitHub Release. The release workflow can also be run manually with an existing tag to retry or repair a release.

Project Layout

  • src/ChapterTool.Core: chapter models, transformations, import contracts, and exporters.
  • src/ChapterTool.Infrastructure: external tool discovery, process execution, settings, and infrastructure-backed importers.
  • src/ChapterTool.Avalonia: desktop UI and runtime composition.
  • tests/: Core, Infrastructure, and Avalonia test projects.
  • openspec/specs/: current behavior specifications.
  • openspec/changes/: active and archived OpenSpec changes.

Thanks

License

Distributed under the GPLv3+ license. See LICENSE for details.

About

A simple tool for video chapter extract & process

Topics

Resources

License

Stars

109 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors