samaku is an editor for non-destructive visual typesetting of ASS subtitles. It aims to solve the primary problem of Lua macro-based typesetting workflows, where once a sign has been typeset, it is very hard to make even minor changes without redoing the sign entirely. Instead of destructive Lua macros, samaku includes a Blender-like node editor for non-destructive editing, where a node graph corresponds to a chain of transformations that are instantly, automatically rerun when the inputs are changed.
Note that samaku is extremely incomplete and absolutely not ready for production use. The node editor works in principle, but so far the selection of nodes is very limited, with no way to do most of the important tasks in typesetting. Also, there will be many bugs and other inconveniences.
I make absolutely no promises that I will continue to develop samaku into a usable tool; in fact, it is pretty likely I will eventually lose interest or become too busy with something else, given how ambitious this project is. Maybe it will still be useful educationally.
Technology-wise, samaku uses
- Rust,
- iced for the UI,
- libass for subtitle rendering,
- Vapoursynth with LSMASHSource for reasonably performant precise video decoding,
- BestSource for audio decoding,
- and libmv for motion tracking.
To understand the project structure, you should have a basic idea of how iced projects are structured in general. The application lives in src/lib.rs
, with the Samaku
struct containing the state; the messages are defined in src/message.rs
. For the most part, the application consists of a pane grid, containing panes with their own view and update logic; these live in the pane
module. Apart from that, there are the following modules in src
:
media/bindings
: Thin but safe bindings around the various media libraries.media
: More integrated bindings to provide specifically the features samaku needs.model
: Various specific state structs to avoid too much clutter inlib.rs
.nde/node
: The different nodes that can be used in the node editor.nde/tags
: Code for parsing, manipulating, and emitting ASS override tags. (I intend to eventually extract this module into its own crate, for use by others.)nde
: Other glue code for non-destructive editing.resources
: Static resources needed for the UI.subtitle
: samaku's internal representations of ASS subtitle data.view
: UI utilities and custom widgets.workers
: Any code that needs to run in its own thread.
Apart from samaku's own code, there are the following modules in the root folder:
benches
: Criterion benchmarks for ASS tag handling code.tests
: Integration tests, mainly also for ASS tag handling code.test_files
: Static files used for tests.bestsource-sys
: Unsafe FFI bindings for BestSource and libp2p.libass-sys
: Unsafe FFI bindings for libass.
Currently only tested on Linux.
- Install dependencies:
- libass (including headers)
- Vapoursynth (including headers)
- LSMASHSource for Vapoursynth
- Dependencies for libmv-capi-sys: GOMP, SuiteSparse, and OpenBLAS
- Run
cargo test
to ensure the dependencies have been installed correctly. - Then, start the program using
cargo run
.
For actually using samaku, please also take a look at src/keyboard.rs
, which defines global keyboard shortcuts for functionality that is not yet mapped to any buttons or the like in the UI.
samaku as a whole is licenced under the GPLv3, whose text is available in the LICENSE-GPL
file in the project root. It also includes some code from arch1t3cht's Aegisub fork, specifically the vapoursynth/aegisub_vs.py
script, as well as the scripts in the src/media/default_scripts
folder, which are all licensed under the BSD 3-clause licence.
I eventually plan to extract parts of the code and make it available under more permissive licences.