The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
Add a Nix flake for Linux
Jareer30ec439b75ce
diff --git a/.gitignore b/.gitignoreindex 3d50ec1d..39199c72 100644--- a/.gitignore+++ b/.gitignore@@ -7,6 +7,10 @@ target/**/target/*.pdb+# Nix build output+/result+/result-*+# Python (tooling and one-off scripts live at the repo root for now)__pycache__/*.py[cod]diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d938e783..2860b1bb 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,27 +6,22 @@ behaviour.## Unreleased-- The engine links FFmpeg and compiles whisper.cpp in: nothing spawns an- `ffmpeg`, `ffprobe` or `whisper-cli` process any more, so a build is one- binary with no tools to stage beside it. Seeks are frame-accurate and- every decoded frame carries its real timestamp.-- Releases are archives now, built by the `release.yml` workflow from a- pushed `v*` tag: one binary per platform, with FFmpeg's runtime libraries- beside it on Windows and Linux. Installers return with packaging.-- The editor window is rebuilt in Slint as the `concat` crate inside the- engine workspace: one native Rust binary with no web view, embedding its- own fonts and effect previews, driving the engine in-process. The Tauri +- React app is gone, and with it Node, npm and the Nix flake.+- The engine links FFmpeg and compiles whisper.cpp in: a build is one+ binary with no tools beside it. Seeks are frame-accurate and every+ decoded frame carries its real timestamp.+- Releases are built by the `release.yml` workflow from a pushed `v*` tag:+ one archive per platform, the binary with FFmpeg's runtime libraries+ beside it on Windows and Linux.+- The editor window is built in Slint as the `concat` crate inside the+ engine workspace: one native Rust binary, embedding its own fonts and+ effect previews, driving the engine in-process.+- Nix flake for Linux: `nix build`, `nix run` and `nix develop` at the+ repository root, with FFmpeg, whisper.cpp and the speech libraries pinned.- Text to speech: File → Text to speech turns typed narration into an audioclip at the playhead, spoken by one of 36 Kokoro voices (American andBritish English, Chinese) at a chosen pace. Generation runs entirely onthis machine; the voice model downloads once (about 130 MB) from the sheetitself or Settings → Speech.-- The entire interface is translatable: the app follows the system language- when a translation exists, with an override in Settings → General.- Translations are plain JSON files contributors can add — see TRANSLATING.md.-- Simplified Chinese ships as the first translation (machine-drafted,- pending native review).## v0.2.0-alpha.6 — 2026-08-29diff --git a/engine/README.md b/engine/README.mdindex d4f07fc3..24818213 100644--- a/engine/README.md+++ b/engine/README.md@@ -9,21 +9,26 @@ The video engine behind Concat. Rust, no GC, no hidden control flow.| `concat-core` | Time, arena, frames, timeline model. The vocabulary every other crate speaks. | **none** (std only) || `concat-media` | Getting pixels and samples in and out of files. Links FFmpeg (libav*), and is the only crate that knows it exists. | `concat-core`, ffmpeg-the-third || `concat-project` | The edit itself: document model, operations as commands, undo, concat.json IO. | serde, serde_json |-| `concat-render` | Turning a timeline plus a timestamp into one finished frame. | `concat-core` |-| `concat-cli` | A binary to drive the above. The vertical slice. | all of them |+| `concat-render` | Turning a timeline plus a timestamp into one finished frame. | `concat-core`, wgpu (optional) |+| `concat-export` | Timeline to file: flatten, the filter-chain builders, the frame-by-frame render loop, the paused monitor's true frame. | `concat-core`, `concat-media`, `concat-render`, `concat-project` |+| `concat-cli` | A binary to drive the above. The vertical slice. | the engine crates || `concat-host` | What the window needs that is not the edit: sessions, project folders, previews, playback, templates, job slots. | `concat-media`, `concat-project`, `concat-export`, cpal || `concat-speech` | Transcription (whisper.cpp, in-process) and text to speech (Kokoro via sherpa-onnx). | `concat-host`, `concat-media`, whisper-rs, sherpa-onnx |-| `concat` | The editor window: every pane, dialog and primitive, in Slint. The app a user launches. | slint (engine wiring is next) |+| `concat` | The editor window: every pane, dialog and primitive, in Slint. The app a user launches. | slint, `concat-host`, `concat-speech` |++The dependency arrows point one way:++```+concat -> concat-speech -> concat-host -> {export, project, media} -> core+ -> render -> core+```-The dependency arrows point one way: `{concat, cli} -> {media, render} -> core`.If you ever find yourself wanting `core` to depend on `media`, something hasbeen put in the wrong crate.-`concat` is the app. The window was built in the wc-ui-rnd repository-against the same design as the earlier web-based editor, then wired to the-engine here: it opens project folders through `concat-host`, reads the-engine's project to draw the bin and the lanes, and writes every edit as a-`concat-project` command.+`concat` is the app. It opens project folders through `concat-host`, reads+the engine's project to draw the bin and the lanes, and writes every edit as+a `concat-project` command.## Build and run@@ -47,9 +52,14 @@ FemtoVG over wgpu, and the two are meant to be compared, not chosen once.On Linux, Skia needs the fontconfig and freetype headers at build time (see`.github/workflows/build-app.yml` for the package list).+On Nix, the flake at the repository root builds the window with every native+dependency pinned: `nix build` (then `./result/bin/concat`), `nix run`, or+`nix develop` for a shell with the toolchain and libraries in it. Linux+x86_64 and aarch64.+## Reading this codebase cold-1. `docs/decisions/` - short notes on why things are the way they are. Read these first.+1. [`../ARCHITECTURE.md`](../ARCHITECTURE.md) - the map of the whole system. Read it first.2. `crates/*/src/lib.rs` - every crate opens with a `//!` block saying what it is for.3. `cargo doc --open` - the generated API map of the whole engine.@@ -57,6 +67,6 @@ On Linux, Skia needs the fontconfig and freetype headers at build time (see- **Time is exact.** All timestamps are `concat_core::time::Rational` seconds, never `f64`.Frame-accurate editing and floating point do not mix.-- **Graphs use handles, not pointers.** See decision 0003.+- **Graphs use handles, not pointers.** `concat_core::arena` explains why.- **Shallow generics.** Concrete types until three call sites demand otherwise.- **Threads, not async.** The render path is CPU-bound; `async` buys nothing here.diff --git a/flake.nix b/flake.nixnew file mode 100644index 00000000..c8027ae9--- /dev/null+++ b/flake.nix@@ -0,0 +1,191 @@+{+ # Concat on Nix, Linux only: the people asking for a flake run Linux, and+ # the macOS and Windows builds ship from release.yml.+ #+ # nix build the editor window, ./result/bin/concat+ # nix run build and launch it+ # nix develop a shell with everything `cargo run -p concat` needs+ #+ # The build is one Cargo workspace under engine/, so cargo dependencies+ # come straight from engine/Cargo.lock and there is no vendor hash to keep+ # in sync. Three native pieces need care inside the sandbox, which has no+ # network:+ #+ # - FFmpeg is linked, not spawned. nixpkgs' ffmpeg (7+) provides the+ # headers and libraries; bindgen finds them through pkg-config and+ # bindgenHook's libclang.+ # - whisper.cpp is compiled in by cmake from the source vendored inside+ # whisper-rs-sys, so it needs cmake and a C++ toolchain and nothing else.+ # - sherpa-onnx (text to speech) links prebuilt static libraries that its+ # sys crate would download at build time. They are fetched here as fixed-+ # output derivations instead and handed over with SHERPA_ONNX_ARCHIVE_DIR.+ #+ # The window is built with the FemtoVG-over-wgpu renderer (`--features+ # wgpu`) rather than Skia: skia-bindings also downloads its binaries at+ # build time, and the wgpu renderer is pure Rust. Vulkan is loaded at run+ # time, hence the LD_LIBRARY_PATH on the wrapper.+ description = "Concat - free and open source video editor";++ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";++ outputs =+ { self, nixpkgs }:+ let+ systems = [+ "x86_64-linux"+ "aarch64-linux"+ ];+ eachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});++ # Must match the sherpa-onnx-sys version in engine/Cargo.lock: the sys+ # crate names the archive after its own version and refuses any other.+ sherpaVersion = "1.13.7";+ sherpaArchives = {+ x86_64-linux = {+ name = "sherpa-onnx-v${sherpaVersion}-linux-x64-static-lib.tar.bz2";+ hash = "sha256-0b56aawrMBIAWNgwLmJCOaMGQIU4PPpHmUoU/cRMMtY=";+ };+ aarch64-linux = {+ name = "sherpa-onnx-v${sherpaVersion}-linux-aarch64-static-lib.tar.bz2";+ hash = "sha256-dDtN66urLp9lTjk9pyY72Xlaq+1groDIMCMFQINBXRQ=";+ };+ };+ sherpaArchiveDir =+ pkgs:+ let+ archive = sherpaArchives.${pkgs.stdenv.hostPlatform.system};+ in+ pkgs.linkFarm "sherpa-onnx-archives" [+ {+ name = archive.name;+ path = pkgs.fetchurl {+ url = "https://github.com/k2-fsa/sherpa-onnx/releases/download/v${sherpaVersion}/${archive.name}";+ inherit (archive) hash;+ };+ }+ ];++ # Libraries the binary opens at run time rather than links: the Vulkan+ # loader for wgpu, and the windowing libraries winit dlopens.+ runtimeLibs =+ pkgs: with pkgs; [+ vulkan-loader+ libGL+ wayland+ libxkbcommon+ xorg.libX11+ xorg.libXcursor+ xorg.libXi+ xorg.libXrandr+ ];++ nativeInputs =+ pkgs: with pkgs; [+ pkg-config+ cmake+ rustPlatform.bindgenHook+ ];++ buildInputs =+ pkgs: with pkgs; [+ ffmpeg+ alsa-lib+ fontconfig+ freetype+ gtk3+ libxkbcommon+ wayland+ ];+ in+ {+ packages = eachSystem (pkgs: rec {+ default = concat;+ concat = pkgs.rustPlatform.buildRustPackage {+ pname = "concat";+ version = "0.2.0";+ src = self;++ cargoRoot = "engine";+ buildAndTestSubdir = "engine";+ cargoLock.lockFile = ./engine/Cargo.lock;+ cargoBuildFlags = [+ "-p"+ "concat"+ "--no-default-features"+ "--features"+ "wgpu"+ ];++ # The workspace's tests generate their own media through the+ # linked encoder and run anywhere the engine builds, but they take+ # minutes; `cargo test` in `nix develop` is where they belong.+ doCheck = false;++ env.SHERPA_ONNX_ARCHIVE_DIR = sherpaArchiveDir pkgs;++ nativeBuildInputs = (nativeInputs pkgs) ++ [+ pkgs.wrapGAppsHook3+ pkgs.copyDesktopItems+ ];+ buildInputs = buildInputs pkgs;++ preFixup = ''+ gappsWrapperArgs+=(+ --prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath (runtimeLibs pkgs)}+ )+ '';++ desktopItems = [+ (pkgs.makeDesktopItem {+ name = "concat";+ exec = "concat";+ icon = "concat";+ desktopName = "Concat";+ comment = "Free and open source video editor";+ categories = [+ "AudioVideo"+ "AudioVideoEditing"+ ];+ })+ ];++ postInstall = ''+ install -Dm644 assets/concat_logo_512.png \+ $out/share/icons/hicolor/512x512/apps/concat.png+ '';++ meta = {+ description = "Free and open source video editor";+ homepage = "https://github.com/jub0t/Concat";+ license = pkgs.lib.licenses.agpl3Plus;+ platforms = systems;+ mainProgram = "concat";+ };+ };+ });++ devShells = eachSystem (pkgs: {+ default = pkgs.mkShell {+ packages =+ (nativeInputs pkgs)+ ++ (buildInputs pkgs)+ ++ (with pkgs; [+ cargo+ rustc+ clippy+ rustfmt+ rust-analyzer+ ]);++ env.SHERPA_ONNX_ARCHIVE_DIR = sherpaArchiveDir pkgs;+ LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (runtimeLibs pkgs);++ shellHook = ''+ echo "Concat: cd engine && cargo run -p concat --no-default-features --features wgpu"+ '';+ };+ });++ formatter = eachSystem (pkgs: pkgs.nixfmt-rfc-style);+ };+}