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
updates
Jareerf1015e049da5
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex baf04640..10508f7e 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -148,6 +148,10 @@ jobs:# A hyphen in the tag (v0.1.0-alpha.1) marks a pre-release.prerelease: ${{ contains(github.ref_name, '-') }}generate_release_notes: true+ body: |+ WolfCut is MPL-2.0. The installers bundle GPL-built FFmpeg binaries,+ invoked as separate programs — sources and licenses in+ [THIRD_PARTY_NOTICES.md](https://github.com/jub0t/WolfCut/blob/main/THIRD_PARTY_NOTICES.md).fail_on_unmatched_files: truefiles: |bundles/**/*.dmgdiff --git a/LICENSE b/LICENSEnew file mode 100644index 00000000..ee6256cd--- /dev/null+++ b/LICENSE@@ -0,0 +1,373 @@+Mozilla Public License Version 2.0+==================================++1. Definitions+--------------++1.1. "Contributor"+ means each individual or legal entity that creates, contributes to+ the creation of, or owns Covered Software.++1.2. "Contributor Version"+ means the combination of the Contributions of others (if any) used+ by a Contributor and that particular Contributor's Contribution.++1.3. "Contribution"+ means Covered Software of a particular Contributor.++1.4. "Covered Software"+ means Source Code Form to which the initial Contributor has attached+ the notice in Exhibit A, the Executable Form of such Source Code+ Form, and Modifications of such Source Code Form, in each case+ including portions thereof.++1.5. "Incompatible With Secondary Licenses"+ means++ (a) that the initial Contributor has attached the notice described+ in Exhibit B to the Covered Software; or++ (b) that the Covered Software was made available under the terms of+ version 1.1 or earlier of the License, but not also under the+ terms of a Secondary License.++1.6. "Executable Form"+ means any form of the work other than Source Code Form.++1.7. "Larger Work"+ means a work that combines Covered Software with other material, in+ a separate file or files, that is not Covered Software.++1.8. "License"+ means this document.++1.9. "Licensable"+ means having the right to grant, to the maximum extent possible,+ whether at the time of the initial grant or subsequently, any and+ all of the rights conveyed by this License.++1.10. "Modifications"+ means any of the following:++ (a) any file in Source Code Form that results from an addition to,+ deletion from, or modification of the contents of Covered+ Software; or++ (b) any new file in Source Code Form that contains any Covered+ Software.++1.11. "Patent Claims" of a Contributor+ means any patent claim(s), including without limitation, method,+ process, and apparatus claims, in any patent Licensable by such+ Contributor that would be infringed, but for the grant of the+ License, by the making, using, selling, offering for sale, having+ made, import, or transfer of either its Contributions or its+ Contributor Version.++1.12. "Secondary License"+ means either the GNU General Public License, Version 2.0, the GNU+ Lesser General Public License, Version 2.1, the GNU Affero General+ Public License, Version 3.0, or any later versions of those+ licenses.++1.13. "Source Code Form"+ means the form of the work preferred for making modifications.++1.14. "You" (or "Your")+ means an individual or a legal entity exercising rights under this+ License. For legal entities, "You" includes any entity that+ controls, is controlled by, or is under common control with You. For+ purposes of this definition, "control" means (a) the power, direct+ or indirect, to cause the direction or management of such entity,+ whether by contract or otherwise, or (b) ownership of more than+ fifty percent (50%) of the outstanding shares or beneficial+ ownership of such entity.++2. License Grants and Conditions+--------------------------------++2.1. Grants++Each Contributor hereby grants You a world-wide, royalty-free,+non-exclusive license:++(a) under intellectual property rights (other than patent or trademark)+ Licensable by such Contributor to use, reproduce, make available,+ modify, display, perform, distribute, and otherwise exploit its+ Contributions, either on an unmodified basis, with Modifications, or+ as part of a Larger Work; and++(b) under Patent Claims of such Contributor to make, use, sell, offer+ for sale, have made, import, and otherwise transfer either its+ Contributions or its Contributor Version.++2.2. Effective Date++The licenses granted in Section 2.1 with respect to any Contribution+become effective for each Contribution on the date the Contributor first+distributes such Contribution.++2.3. Limitations on Grant Scope++The licenses granted in this Section 2 are the only rights granted under+this License. No additional rights or licenses will be implied from the+distribution or licensing of Covered Software under this License.+Notwithstanding Section 2.1(b) above, no patent license is granted by a+Contributor:++(a) for any code that a Contributor has removed from Covered Software;+ or++(b) for infringements caused by: (i) Your and any other third party's+ modifications of Covered Software, or (ii) the combination of its+ Contributions with other software (except as part of its Contributor+ Version); or++(c) under Patent Claims infringed by Covered Software in the absence of+ its Contributions.++This License does not grant any rights in the trademarks, service marks,+or logos of any Contributor (except as may be necessary to comply with+the notice requirements in Section 3.4).++2.4. Subsequent Licenses++No Contributor makes additional grants as a result of Your choice to+distribute the Covered Software under a subsequent version of this+License (see Section 10.2) or under the terms of a Secondary License (if+permitted under the terms of Section 3.3).++2.5. Representation++Each Contributor represents that the Contributor believes its+Contributions are its original creation(s) or it has sufficient rights+to grant the rights to its Contributions conveyed by this License.++2.6. Fair Use++This License is not intended to limit any rights You have under+applicable copyright doctrines of fair use, fair dealing, or other+equivalents.++2.7. Conditions++Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted+in Section 2.1.++3. Responsibilities+-------------------++3.1. Distribution of Source Form++All distribution of Covered Software in Source Code Form, including any+Modifications that You create or to which You contribute, must be under+the terms of this License. You must inform recipients that the Source+Code Form of the Covered Software is governed by the terms of this+License, and how they can obtain a copy of this License. You may not+attempt to alter or restrict the recipients' rights in the Source Code+Form.++3.2. Distribution of Executable Form++If You distribute Covered Software in Executable Form then:++(a) such Covered Software must also be made available in Source Code+ Form, as described in Section 3.1, and You must inform recipients of+ the Executable Form how they can obtain a copy of such Source Code+ Form by reasonable means in a timely manner, at a charge no more+ than the cost of distribution to the recipient; and++(b) You may distribute such Executable Form under the terms of this+ License, or sublicense it under different terms, provided that the+ license for the Executable Form does not attempt to limit or alter+ the recipients' rights in the Source Code Form under this License.++3.3. Distribution of a Larger Work++You may create and distribute a Larger Work under terms of Your choice,+provided that You also comply with the requirements of this License for+the Covered Software. If the Larger Work is a combination of Covered+Software with a work governed by one or more Secondary Licenses, and the+Covered Software is not Incompatible With Secondary Licenses, this+License permits You to additionally distribute such Covered Software+under the terms of such Secondary License(s), so that the recipient of+the Larger Work may, at their option, further distribute the Covered+Software under the terms of either this License or such Secondary+License(s).++3.4. Notices++You may not remove or alter the substance of any license notices+(including copyright notices, patent notices, disclaimers of warranty,+or limitations of liability) contained within the Source Code Form of+the Covered Software, except that You may alter any license notices to+the extent required to remedy known factual inaccuracies.++3.5. Application of Additional Terms++You may choose to offer, and to charge a fee for, warranty, support,+indemnity or liability obligations to one or more recipients of Covered+Software. However, You may do so only on Your own behalf, and not on+behalf of any Contributor. You must make it absolutely clear that any+such warranty, support, indemnity, or liability obligation is offered by+You alone, and You hereby agree to indemnify every Contributor for any+liability incurred by such Contributor as a result of warranty, support,+indemnity or liability terms You offer. You may include additional+disclaimers of warranty and limitations of liability specific to any+jurisdiction.++4. Inability to Comply Due to Statute or Regulation+---------------------------------------------------++If it is impossible for You to comply with any of the terms of this+License with respect to some or all of the Covered Software due to+statute, judicial order, or regulation then You must: (a) comply with+the terms of this License to the maximum extent possible; and (b)+describe the limitations and the code they affect. Such description must+be placed in a text file included with all distributions of the Covered+Software under this License. Except to the extent prohibited by statute+or regulation, such description must be sufficiently detailed for a+recipient of ordinary skill to be able to understand it.++5. Termination+--------------++5.1. The rights granted under this License will terminate automatically+if You fail to comply with any of its terms. However, if You become+compliant, then the rights granted under this License from a particular+Contributor are reinstated (a) provisionally, unless and until such+Contributor explicitly and finally terminates Your grants, and (b) on an+ongoing basis, if such Contributor fails to notify You of the+non-compliance by some reasonable means prior to 60 days after You have+come back into compliance. Moreover, Your grants from a particular+Contributor are reinstated on an ongoing basis if such Contributor+notifies You of the non-compliance by some reasonable means, this is the+first time You have received notice of non-compliance with this License+from such Contributor, and You become compliant prior to 30 days after+Your receipt of the notice.++5.2. If You initiate litigation against any entity by asserting a patent+infringement claim (excluding declaratory judgment actions,+counter-claims, and cross-claims) alleging that a Contributor Version+directly or indirectly infringes any patent, then the rights granted to+You by any and all Contributors for the Covered Software under Section+2.1 of this License shall terminate.++5.3. In the event of termination under Sections 5.1 or 5.2 above, all+end user license agreements (excluding distributors and resellers) which+have been validly granted by You or Your distributors under this License+prior to termination shall survive termination.++************************************************************************+* *+* 6. Disclaimer of Warranty *+* ------------------------- *+* *+* Covered Software is provided under this License on an "as is" *+* basis, without warranty of any kind, either expressed, implied, or *+* statutory, including, without limitation, warranties that the *+* Covered Software is free of defects, merchantable, fit for a *+* particular purpose or non-infringing. The entire risk as to the *+* quality and performance of the Covered Software is with You. *+* Should any Covered Software prove defective in any respect, You *+* (not any Contributor) assume the cost of any necessary servicing, *+* repair, or correction. This disclaimer of warranty constitutes an *+* essential part of this License. No use of any Covered Software is *+* authorized under this License except under this disclaimer. *+* *+************************************************************************++************************************************************************+* *+* 7. Limitation of Liability *+* -------------------------- *+* *+* Under no circumstances and under no legal theory, whether tort *+* (including negligence), contract, or otherwise, shall any *+* Contributor, or anyone who distributes Covered Software as *+* permitted above, be liable to You for any direct, indirect, *+* special, incidental, or consequential damages of any character *+* including, without limitation, damages for lost profits, loss of *+* goodwill, work stoppage, computer failure or malfunction, or any *+* and all other commercial damages or losses, even if such party *+* shall have been informed of the possibility of such damages. This *+* limitation of liability shall not apply to liability for death or *+* personal injury resulting from such party's negligence to the *+* extent applicable law prohibits such limitation. Some *+* jurisdictions do not allow the exclusion or limitation of *+* incidental or consequential damages, so this exclusion and *+* limitation may not apply to You. *+* *+************************************************************************++8. Litigation+-------------++Any litigation relating to this License may be brought only in the+courts of a jurisdiction where the defendant maintains its principal+place of business and such litigation shall be governed by laws of that+jurisdiction, without reference to its conflict-of-law provisions.+Nothing in this Section shall prevent a party's ability to bring+cross-claims or counter-claims.++9. Miscellaneous+----------------++This License represents the complete agreement concerning the subject+matter hereof. If any provision of this License is held to be+unenforceable, such provision shall be reformed only to the extent+necessary to make it enforceable. Any law or regulation which provides+that the language of a contract shall be construed against the drafter+shall not be used to construe this License against a Contributor.++10. Versions of the License+---------------------------++10.1. New Versions++Mozilla Foundation is the license steward. Except as provided in Section+10.3, no one other than the license steward has the right to modify or+publish new versions of this License. Each version will be given a+distinguishing version number.++10.2. Effect of New Versions++You may distribute the Covered Software under the terms of the version+of the License under which You originally received the Covered Software,+or under the terms of any subsequent version published by the license+steward.++10.3. Modified Versions++If you create software not governed by this License, and you want to+create a new license for such software, you may create and use a+modified version of this License if you rename the license and remove+any references to the name of the license steward (except to note that+such modified license differs from this License).++10.4. Distributing Source Code Form that is Incompatible With Secondary+Licenses++If You choose to distribute Source Code Form that is Incompatible With+Secondary Licenses under the terms of this version of the License, the+notice described in Exhibit B of this License must be attached.++Exhibit A - Source Code Form License Notice+-------------------------------------------++ This Source Code Form is subject to the terms of the Mozilla Public+ License, v. 2.0. If a copy of the MPL was not distributed with this+ file, You can obtain one at https://mozilla.org/MPL/2.0/.++If it is not possible or desirable to put the notice in a particular+file, then You may include the notice in a location (such as a LICENSE+file in a relevant directory) where a recipient would be likely to look+for such a notice.++You may add additional accurate notices of copyright ownership.++Exhibit B - "Incompatible With Secondary Licenses" Notice+---------------------------------------------------------++ This Source Code Form is "Incompatible With Secondary Licenses", as+ defined by the Mozilla Public License, v. 2.0.diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdnew file mode 100644index 00000000..457ccfec--- /dev/null+++ b/THIRD_PARTY_NOTICES.md@@ -0,0 +1,27 @@+# Third-party notices++## FFmpeg++WolfCut bundles unmodified `ffmpeg` and `ffprobe` binaries and invokes them as+separate child processes; the app does not link against them.++- **Windows**: static GPL builds from the BtbN autobuild project+ (`ffmpeg-n8.1-latest-win64-gpl`), built with x264.+ Source and build scripts: https://github.com/BtbN/FFmpeg-Builds+- **macOS**: static builds by Martin Riedl.+ Source and build info: https://ffmpeg.martin-riedl.de++FFmpeg is licensed under the LGPL-2.1-or-later, with the bundled builds+compiled as GPL-2.0-or-later (they include x264). FFmpeg source code:+https://ffmpeg.org/download.html++## Fonts++Cabinet Grotesk and Synonym are bundled under the ITF Free Font License; the+full texts ship beside the font files in `desktop/src/assets/fonts/`.++## Whisper models (optional download)++Auto-captions can download ggml Whisper models from+https://huggingface.co/ggerganov/whisper.cpp (MIT). Models are fetched on+demand and never bundled.diff --git a/desktop/README.md b/desktop/README.mdindex e31cf4cd..e8af97e8 100644--- a/desktop/README.md+++ b/desktop/README.md@@ -38,8 +38,10 @@ src/lib/engine.ts the ONLY file that calls invoke(). Typed IPC boundary.project.ts the provisional edit model and its operations- transport.ts the playback clock- audio.ts audio preview - one media element per audible clip+ transport.ts the playback clock (follows the engine's position events)+ effects.ts video effect & transition catalogue -> ffmpeg chains + live previews+ filters.ts audio filter catalogue -> ffmpeg chains+ persist.ts tolerant relay.json reader/writertime.ts display formatting. No time arithmetic lives in the UI.styles.css Tailwind entry point, tokens, and the `surface` utilitysrc-tauri/@@ -68,9 +70,12 @@ src-tauri/| `←` `→` | Step one frame (`Shift` for ten) || `Home` `End` | Jump to start / end || `V` `C` | Select tool / razor tool |-| `S` | Split at playhead |+| `S` / `Ctrl`+`B` | Split at playhead |+| `M` | Merge selected clips || `N` | Toggle snapping |-| `Del` | Delete selected clip |+| `Del` | Delete selection |+| `Ctrl`+`S` | Save |+| `Ctrl`+`E` | Export || `Ctrl`+wheel | Zoom the timeline about the pointer || wheel | Pan the timeline |@@ -86,12 +91,6 @@ Keep them adjacent in the same commit.## Not decided yet-- **Content Security Policy** is `null` in `tauri.conf.json`. Fine while- everything is local; it needs a real policy before the app loads anything it- did not author. See decision 0003.-- **File import is a path box**, not a native dialog. Adding one means the- `dialog` plugin and a capability entry - a decision for whoever builds real- import.- **No state library.** React state is enough while the engine owns the model.If it stops being enough, the answer is a store outside React (so timelineupdates do not re-render the tree), not more `useState`.diff --git a/desktop/docs/decisions/0003-csp-is-not-configured.md b/desktop/docs/decisions/0003-csp-is-not-configured.mddeleted file mode 100644index 357d9352..00000000--- a/desktop/docs/decisions/0003-csp-is-not-configured.md+++ /dev/null@@ -1,22 +0,0 @@-# 0003 - Content Security Policy: OPEN QUESTION--`"csp": null` in `tauri.conf.json`, which disables the policy entirely.--That is defensible right now - the app loads only its own bundled assets - and-indefensible the moment it renders anything it did not author: a thumbnail from-a downloaded file, a project template, an update notice, a plugin's UI.--A starting point when that day comes:--```json-"csp": "default-src 'self'; img-src 'self' asset: http://asset.localhost blob: data:; media-src 'self' asset: http://asset.localhost blob:; style-src 'self' 'unsafe-inline'; script-src 'self'"-```--Two things to check when enabling it:--- Vite's dev server and React Fast Refresh inject inline scripts. Confirm- `npm run app` still hot-reloads, or scope the policy to release builds.-- Tailwind v4 emits a real stylesheet rather than inline styles, but component- `style={{...}}` attributes still need `'unsafe-inline'` under `style-src`.--Delete this file once a policy is in place.diff --git a/desktop/docs/decisions/0003-csp.md b/desktop/docs/decisions/0003-csp.mdnew file mode 100644index 00000000..a4598910--- /dev/null+++ b/desktop/docs/decisions/0003-csp.md@@ -0,0 +1,21 @@+# 0003 - Content Security Policy++*Previously an open question; decided alongside the MPL-2.0 licensing pass.*++## Decision+Release builds run under a strict CSP set in `tauri.conf.json`: same-origin+scripts only, media and images additionally allowed from the asset protocol+plus `blob:`/`data:` (poster frames, waveform tiles, the grain overlay),+inline styles permitted (component `style={{...}}` attributes are everywhere),+and IPC endpoints named explicitly. Dev builds use a permissive `devCsp` so+Vite's injected HMR scripts and websocket keep working.++## What stays open+The asset protocol scope is still `["**"]` - a video editor opens arbitrary+user files, so a narrower scope would be a lie. The CSP now bounds what a+compromised page could *do* with that reach (no foreign script, no exfil+targets beyond IPC), which was the actual risk the old note deferred.++## What would change our mind+Rendering anything remote or user-authored beyond media files - templates, a+plugin UI, an update notice - forces this list open again, item by item.diff --git a/desktop/docs/decisions/0004-audio-preview-in-the-webview.md b/desktop/docs/decisions/0004-audio-preview-in-the-webview.mdindex 87c424aa..a325b187 100644--- a/desktop/docs/decisions/0004-audio-preview-in-the-webview.md+++ b/desktop/docs/decisions/0004-audio-preview-in-the-webview.md@@ -1,5 +1,11 @@# 0004 - Audio and video preview run in the webview, for now+> **Superseded in part by [0005](0005-audio-playback-in-the-engine.md)** and+> **amended by [0007](0007-preview-approximation-layer.md):** the "No effects"+> claim below no longer holds - the monitor now draws every effect and+> transition live through an approximation layer, and 0007 makes that layer+> the plan of record rather than scaffolding.+>> **Superseded in part by [0005](0005-audio-playback-in-the-engine.md):**> audio playback now lives in the engine - decoded, mixed and clocked in> `src-tauri/src/playback.rs`, with the UI following the engine's positiondiff --git a/desktop/package.json b/desktop/package.jsonindex bac6802c..6c404ae4 100644--- a/desktop/package.json+++ b/desktop/package.json@@ -28,5 +28,6 @@"tailwindcss": "^4","typescript": "~5.8.3","vite": "^7.0.4"- }+ },+ "license": "MPL-2.0"}diff --git a/desktop/src-tauri/Cargo.toml b/desktop/src-tauri/Cargo.tomlindex eecdfbae..01a89d18 100644--- a/desktop/src-tauri/Cargo.toml+++ b/desktop/src-tauri/Cargo.toml@@ -1,6 +1,7 @@[package]name = "relay-desktop"version = "0.1.0"+license = "MPL-2.0"description = "Relay video editor"edition = "2021"diff --git a/desktop/src-tauri/tauri.conf.json b/desktop/src-tauri/tauri.conf.jsonindex 705101bf..839614df 100644--- a/desktop/src-tauri/tauri.conf.json+++ b/desktop/src-tauri/tauri.conf.json@@ -24,7 +24,8 @@}],"security": {- "csp": null,+ "csp": "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' asset: http://asset.localhost blob: data:; media-src 'self' asset: http://asset.localhost blob:; font-src 'self' data:; connect-src ipc: http://ipc.localhost 'self'",+ "devCsp": "default-src * 'unsafe-inline' 'unsafe-eval' blob: data: asset: http://asset.localhost ws: wss: ipc: http://ipc.localhost","assetProtocol": {"enable": true,"scope": [diff --git a/desktop/src/components/AdjustPanel.tsx b/desktop/src/components/AdjustPanel.tsxindex 142b9fe8..e61c6d1c 100644--- a/desktop/src/components/AdjustPanel.tsx+++ b/desktop/src/components/AdjustPanel.tsx@@ -148,11 +148,14 @@ export function AdjustPanel({title="Speed"help="The clip covers the same material either way, so its length on the timeline changes to match.">+ {/* The engine's full range. The track is linear so the useful+ 0.25-4x band sits left of centre; the number field beside it is+ how the extremes are actually dialled in. */}<Sliderlabel="Rate"value={clip.speed}- min={0.25}- max={4}+ min={0.0625}+ max={16}step={0.05}format={(value) => `${value.toFixed(2)}x`}onReset={() => onSpeedChange(1)}diff --git a/desktop/src/components/Preview.tsx b/desktop/src/components/Preview.tsxindex d28e087e..54f74f38 100644--- a/desktop/src/components/Preview.tsx+++ b/desktop/src/components/Preview.tsx@@ -29,6 +29,37 @@ const FRAME_PRESETS = [{ label: "21:9", width: 2560, height: 1080 },] as const;+/**+ * A tiny rectangle in the aspect of a frame size, so "vertical" and+ * "landscape" read at a glance before the numbers do.+ *+ * Normalised so the long side is always the same length - the shapes differ+ * only in proportion, which is the one thing they exist to show. The current+ * size fills with accent, making the shape double as the selection mark.+ */+function RatioShape({+ width,+ height,+ active = false,+}: {+ width: number;+ height: number;+ active?: boolean;+}) {+ const long = 13;+ const shapeWidth = width >= height ? long : Math.max(5, Math.round((long * width) / height));+ const shapeHeight = height >= width ? long : Math.max(5, Math.round((long * height) / width));+ return (+ <span+ aria-hidden+ className={`inline-block rounded-[2px] border ${+ active ? "border-accent bg-accent-soft" : "border-current opacity-50"+ }`}+ style={{ width: shapeWidth, height: shapeHeight }}+ />+ );+}+/** "16:9" for a preset size, the reduced fraction for anything else. */function ratioLabel(width: number, height: number): string {const preset = FRAME_PRESETS.find(@@ -648,25 +679,29 @@ export function Preview({align="right"direction="up"groups={[- FRAME_PRESETS.map((preset) => ({- label: `${preset.label} — ${preset.width} x ${preset.height}`,- icon:- preset.width === frame.width && preset.height === frame.height- ? ("check" as const)- : undefined,- onSelect: () => onFrameChange(preset.width, preset.height),- })),+ FRAME_PRESETS.map((preset) => {+ const active =+ preset.width === frame.width && preset.height === frame.height;+ return {+ label: `${preset.label} — ${preset.width} x ${preset.height}`,+ leading: (+ <RatioShape width={preset.width} height={preset.height} active={active} />+ ),+ onSelect: () => onFrameChange(preset.width, preset.height),+ };+ }),]}trigger={(open) => (<spantitle="Output size"- className={`flex items-center gap-1 rounded-md px-1.5 py-0.5 font-technical text-[10px]+ className={`flex items-center gap-1.5 rounded-md px-1.5 py-0.5 font-technical text-[10px]transition-colors ${open? "bg-active text-primary": "text-tertiary hover:bg-hover hover:text-secondary"}`}>+ <RatioShape width={frame.width} height={frame.height} />{ratioLabel(frame.width, frame.height)} · {frame.width}x{frame.height}<Icon name="chevronDown" size={10} /></span>diff --git a/desktop/src/components/Timeline.tsx b/desktop/src/components/Timeline.tsxdeleted file mode 100644index b7e284ae..00000000--- a/desktop/src/components/Timeline.tsx+++ /dev/null@@ -1,261 +0,0 @@-import { useCallback, useEffect, useRef } from "react";-import type { PointerEvent as ReactPointerEvent } from "react";--import { timecode } from "../lib/time";--/**- * The timeline, drawn on a canvas.- *- * Deliberately not made of DOM nodes. A real edit has thousands of clips,- * keyframes and waveform segments, and scrubbing repaints all of them sixty- * times a second. React reconciliation cannot keep up with that and neither can- * the compositor. One canvas and one draw call per frame can.- *- * See docs/decisions/0002-the-hot-surfaces-are-not-the-dom.md.- */--export interface TimelineClip {- id: string;- track: number;- /** Seconds from the start of the timeline. */- start: number;- duration: number;- label: string;- kind: "video" | "audio";-}--interface TimelineProps {- clips: TimelineClip[];- trackCount: number;- playhead: number;- /** Seconds of timeline per horizontal pixel of canvas. */- secondsPerPixel: number;- frameRate: number;- onScrub: (seconds: number) => void;-}--const RULER_HEIGHT = 28;-const TRACK_HEIGHT = 56;--const COLORS = {- background: "#0d0f13",- ruler: "#14171d",- trackEven: "#101319",- trackOdd: "#0d1015",- gridMinor: "#1b1f27",- gridMajor: "#2b3240",- text: "#9aa2b1",- clipVideo: "#2b5f8f",- clipAudio: "#2f7a5c",- clipEdge: "#4f8cff",- clipText: "#e8eaef",- playhead: "#ff4f6d",-};--export function Timeline({- clips,- trackCount,- playhead,- secondsPerPixel,- frameRate,- onScrub,-}: TimelineProps) {- const canvasRef = useRef<HTMLCanvasElement>(null);- // The draw function reads the latest props through a ref so that the rAF loop- // never has to be torn down and rebuilt when a prop changes.- const props = useRef({ clips, trackCount, playhead, secondsPerPixel, frameRate });- props.current = { clips, trackCount, playhead, secondsPerPixel, frameRate };-- const draw = useCallback(() => {- const canvas = canvasRef.current;- const context = canvas?.getContext("2d", { alpha: false });- if (!canvas || !context) return;-- const { clips, trackCount, playhead, secondsPerPixel, frameRate } = props.current;-- // Match the backing store to the device pixel ratio, or everything is- // blurry on a scaled display and text looks like mud.- const ratio = window.devicePixelRatio || 1;- const width = canvas.clientWidth;- const height = canvas.clientHeight;- if (canvas.width !== width * ratio || canvas.height !== height * ratio) {- canvas.width = Math.max(1, Math.round(width * ratio));- canvas.height = Math.max(1, Math.round(height * ratio));- }- context.setTransform(ratio, 0, 0, ratio, 0, 0);-- context.fillStyle = COLORS.background;- context.fillRect(0, 0, width, height);-- drawTrackBands(context, width, height, trackCount);- drawRuler(context, width, secondsPerPixel, frameRate);- drawGrid(context, width, height, secondsPerPixel);-- for (const clip of clips) {- drawClip(context, clip, secondsPerPixel);- }-- drawPlayhead(context, height, playhead / secondsPerPixel);- }, []);-- useEffect(() => {- let frame = 0;- // One rAF loop, started once. Repainting on a timer rather than on every- // state change keeps scrubbing smooth and coalesces bursts of updates.- const tick = () => {- draw();- frame = requestAnimationFrame(tick);- };- frame = requestAnimationFrame(tick);-- const canvas = canvasRef.current;- const observer = new ResizeObserver(() => draw());- if (canvas) observer.observe(canvas);-- return () => {- cancelAnimationFrame(frame);- observer.disconnect();- };- }, [draw]);-- const scrubTo = (event: ReactPointerEvent<HTMLCanvasElement>) => {- const bounds = event.currentTarget.getBoundingClientRect();- onScrub(Math.max(0, (event.clientX - bounds.left) * props.current.secondsPerPixel));- };-- return (- <canvas- ref={canvasRef}- className="h-full w-full cursor-text"- onPointerDown={(event) => {- event.currentTarget.setPointerCapture(event.pointerId);- scrubTo(event);- }}- onPointerMove={(event) => {- if (event.buttons === 1) scrubTo(event);- }}- />- );-}--function drawTrackBands(- context: CanvasRenderingContext2D,- width: number,- height: number,- trackCount: number,-) {- for (let track = 0; track < trackCount; track += 1) {- const y = RULER_HEIGHT + track * TRACK_HEIGHT;- if (y > height) break;- context.fillStyle = track % 2 === 0 ? COLORS.trackEven : COLORS.trackOdd;- context.fillRect(0, y, width, TRACK_HEIGHT);- }-}--/** Chooses a tick spacing that stays readable at any zoom. */-function tickInterval(secondsPerPixel: number): number {- const candidates = [1 / 30, 0.1, 0.5, 1, 2, 5, 10, 30, 60, 300, 600, 1800];- const minimumPixels = 80;- return (- candidates.find((seconds) => seconds / secondsPerPixel >= minimumPixels) ??- candidates[candidates.length - 1]- );-}--function drawRuler(- context: CanvasRenderingContext2D,- width: number,- secondsPerPixel: number,- frameRate: number,-) {- context.fillStyle = COLORS.ruler;- context.fillRect(0, 0, width, RULER_HEIGHT);- context.strokeStyle = COLORS.gridMajor;- context.beginPath();- context.moveTo(0, RULER_HEIGHT - 0.5);- context.lineTo(width, RULER_HEIGHT - 0.5);- context.stroke();-- const interval = tickInterval(secondsPerPixel);- context.fillStyle = COLORS.text;- context.font = "10px ui-monospace, monospace";- context.textBaseline = "middle";-- for (let seconds = 0; seconds / secondsPerPixel < width; seconds += interval) {- const x = Math.round(seconds / secondsPerPixel) + 0.5;- context.strokeStyle = COLORS.gridMajor;- context.beginPath();- context.moveTo(x, RULER_HEIGHT - 8);- context.lineTo(x, RULER_HEIGHT);- context.stroke();- context.fillText(timecode(seconds, frameRate), x + 4, RULER_HEIGHT / 2 - 2);- }-}--function drawGrid(- context: CanvasRenderingContext2D,- width: number,- height: number,- secondsPerPixel: number,-) {- const interval = tickInterval(secondsPerPixel);- context.strokeStyle = COLORS.gridMinor;- context.beginPath();- for (let seconds = 0; seconds / secondsPerPixel < width; seconds += interval) {- const x = Math.round(seconds / secondsPerPixel) + 0.5;- context.moveTo(x, RULER_HEIGHT);- context.lineTo(x, height);- }- context.stroke();-}--function drawClip(- context: CanvasRenderingContext2D,- clip: TimelineClip,- secondsPerPixel: number,-) {- const x = clip.start / secondsPerPixel;- const clipWidth = Math.max(2, clip.duration / secondsPerPixel);- const y = RULER_HEIGHT + clip.track * TRACK_HEIGHT + 4;- const clipHeight = TRACK_HEIGHT - 8;-- context.fillStyle = clip.kind === "video" ? COLORS.clipVideo : COLORS.clipAudio;- context.beginPath();- context.roundRect(x, y, clipWidth, clipHeight, 4);- context.fill();-- context.strokeStyle = COLORS.clipEdge;- context.lineWidth = 1;- context.stroke();-- // Only bother with a label if it will not immediately be clipped away.- if (clipWidth > 44) {- context.save();- context.beginPath();- context.rect(x, y, clipWidth - 6, clipHeight);- context.clip();- context.fillStyle = COLORS.clipText;- context.font = "11px ui-sans-serif, system-ui, sans-serif";- context.textBaseline = "top";- context.fillText(clip.label, x + 6, y + 6);- context.restore();- }-}--function drawPlayhead(context: CanvasRenderingContext2D, height: number, x: number) {- const position = Math.round(x) + 0.5;- context.strokeStyle = COLORS.playhead;- context.lineWidth = 1;- context.beginPath();- context.moveTo(position, 0);- context.lineTo(position, height);- context.stroke();-- context.fillStyle = COLORS.playhead;- context.beginPath();- context.moveTo(position - 5, 0);- context.lineTo(position + 5, 0);- context.lineTo(position, 8);- context.closePath();- context.fill();-}diff --git a/desktop/src/lib/persist.ts b/desktop/src/lib/persist.tsindex e44f6435..81247437 100644--- a/desktop/src/lib/persist.ts+++ b/desktop/src/lib/persist.ts@@ -187,7 +187,7 @@ export function fromDocument(raw: unknown): Project | null {// Clamped, not just defaulted: a hand-edited 2 would export// differently from how the preview clamps it on screen.opacity: Math.min(1, Math.max(0, number(clip.opacity, 1))),- speed: Math.max(0.1, number(clip.speed, 1)),+ speed: Math.max(0.0625, Math.min(16, number(clip.speed, 1))),preservePitch: flag(clip.preservePitch, true),muted: flag(clip.muted, false) || undefined,detachedFrom: typeof clip.detachedFrom === "string" ? clip.detachedFrom : undefined,diff --git a/desktop/src/lib/project.ts b/desktop/src/lib/project.tsindex c00c7a0c..843e427f 100644--- a/desktop/src/lib/project.ts+++ b/desktop/src/lib/project.ts@@ -1103,7 +1103,9 @@ export function setClipSpeed(project: Project, clipId: string, speed: number): Pconst clip = findClip(project, clipId);if (!clip) return project;- const next = Math.max(0.1, Math.min(8, speed));+ // The engine's SPEED_RANGE (relay-media audio.rs), verbatim. One number,+ // one truth: a rate the exporter would clamp must not survive in the model.+ const next = Math.max(0.0625, Math.min(16, speed));const sourceCovered = clip.duration * clip.speed;return updateClip(project, clipId, {diff --git a/engine/Cargo.toml b/engine/Cargo.tomlindex 69422e92..1377135e 100644--- a/engine/Cargo.toml+++ b/engine/Cargo.toml@@ -6,7 +6,7 @@ members = ["crates/*"]version = "0.1.0"edition = "2024"rust-version = "1.93"-# license = "TODO" # see docs/decisions/0005-license-is-undecided.md+license = "MPL-2.0" # see docs/decisions/0005-license-mpl-2.md[workspace.dependencies]relay-core = { path = "crates/relay-core" }diff --git a/engine/README.md b/engine/README.mdindex 9197b7ba..1fe0dd9b 100644--- a/engine/README.md+++ b/engine/README.md@@ -21,7 +21,7 @@ wrong crate.cargo buildcargo testcargo run -p relay-cli -- probe some-video.mp4-cargo run -p relay-cli -- demo some-video.mp4 out.mp4 --frames 120+cargo run -p relay-cli -- render some-video.mp4 out.mp4 --frames 120```Requires `ffmpeg` and `ffprobe` on `PATH`.diff --git a/engine/crates/relay-cli/Cargo.toml b/engine/crates/relay-cli/Cargo.tomlindex cd6beceb..cdb980e4 100644--- a/engine/crates/relay-cli/Cargo.toml+++ b/engine/crates/relay-cli/Cargo.toml@@ -3,6 +3,7 @@ name = "relay-cli"version.workspace = trueedition.workspace = truerust-version.workspace = true+license.workspace = truedescription = "Command line driver for the Relay engine."[[bin]]diff --git a/engine/crates/relay-core/Cargo.toml b/engine/crates/relay-core/Cargo.tomlindex 24bbdb5a..54240dfc 100644--- a/engine/crates/relay-core/Cargo.toml+++ b/engine/crates/relay-core/Cargo.toml@@ -3,6 +3,7 @@ name = "relay-core"version.workspace = trueedition.workspace = truerust-version.workspace = true+license.workspace = truedescription = "Time, arenas, frames and the timeline model shared by every other Relay crate."# Deliberately empty. relay-core is std-only, and should stay that way: it is thediff --git a/engine/crates/relay-media/Cargo.toml b/engine/crates/relay-media/Cargo.tomlindex de873a88..e1298df9 100644--- a/engine/crates/relay-media/Cargo.toml+++ b/engine/crates/relay-media/Cargo.toml@@ -3,6 +3,7 @@ name = "relay-media"version.workspace = trueedition.workspace = truerust-version.workspace = true+license.workspace = truedescription = "Getting pixels in and out of media files. The only crate that knows FFmpeg exists."[dependencies]diff --git a/engine/crates/relay-render/Cargo.toml b/engine/crates/relay-render/Cargo.tomlindex 675befab..c34e5b8f 100644--- a/engine/crates/relay-render/Cargo.toml+++ b/engine/crates/relay-render/Cargo.toml@@ -3,6 +3,7 @@ name = "relay-render"version.workspace = trueedition.workspace = truerust-version.workspace = true+license.workspace = truedescription = "Turning a timeline plus a timestamp into one finished frame."[features]diff --git a/engine/docs/decisions/0002-ffmpeg-over-a-pipe.md b/engine/docs/decisions/0002-ffmpeg-over-a-pipe.mdindex 2e55cb77..f5873b7c 100644--- a/engine/docs/decisions/0002-ffmpeg-over-a-pipe.md+++ b/engine/docs/decisions/0002-ffmpeg-over-a-pipe.md@@ -12,10 +12,10 @@ Split by use case rather than picking one backend for everything.|---|---|---|| Probe (`ffprobe`) | subprocess | Permanent. Runs once per import; robustness beats latency. || Export / render | subprocess | Permanent unless throughput demands otherwise. |-| Playback and scrubbing | **FFI** (`rsmpeg` or `ffmpeg-next`) | Not built yet. Required before playback ships. |+| Playback and scrubbing | **FFI** (`rusty_ffmpeg`) | Built and tested (`FfiDecoder`, `ffi` feature); not yet wired to the app. |-Today only the subprocess backends exist, because nothing scrubs yet. The FFI-backend arrives with the frame cache and the transport, not before.+The subprocess backends run everything today; the FFI decoder exists and waits+on the frame cache and reader pool before playback can use it.## Why the subprocess path is genuinely right for probe and export- A crashing decoder on malformed input kills a child process, not the editor.diff --git a/engine/docs/decisions/0005-license-is-undecided.md b/engine/docs/decisions/0005-license-is-undecided.mddeleted file mode 100644index cb752d80..00000000--- a/engine/docs/decisions/0005-license-is-undecided.md+++ /dev/null@@ -1,19 +0,0 @@-# 0005 - License: OPEN QUESTION--Not decided. Deliberately left blank in `Cargo.toml` rather than defaulted, because-this is your call and a silent default is hard to walk back.--The tension for an open-source editor:--- **MIT / Apache-2.0** - maximum adoption; anyone may ship a closed fork.-- **GPL-3.0** - forks stay open; awkward with proprietary plugin SDKs.-- **AGPL-3.0** - also covers a hosted or cloud fork.-- **MPL-2.0** - file-level copyleft; a middle ground that still permits- proprietary plugins linking against the engine.--Note that FFmpeg is LGPL by default and GPL when built with `--enable-gpl`-components (x264 among them). Because we invoke it as a separate process rather-than linking it (see 0002), its license does not propagate to this code - but it-does constrain what a distributed *bundle* may be.--Pick one before the first public release, then delete this file.diff --git a/engine/docs/decisions/0005-license-mpl-2.md b/engine/docs/decisions/0005-license-mpl-2.mdnew file mode 100644index 00000000..b7fde598--- /dev/null+++ b/engine/docs/decisions/0005-license-mpl-2.md@@ -0,0 +1,28 @@+# 0005 - License: MPL-2.0++## Decision+WolfCut is licensed under the Mozilla Public License 2.0. `LICENSE` at the+repository root is the canonical text; every crate and package manifest names+`MPL-2.0`.++## Why+- File-level copyleft: changes to WolfCut's own files must be shared, which+ keeps improvements flowing back without capturing everything they touch.+- A proprietary plugin, integration, or vendor SDK can link against the engine+ without inheriting the license - the future OpenFX/VST story (decision 0001)+ stays possible.+- Compatible with the dependency tree in use (MIT/Apache Rust crates), and+ with distributing GPL-built FFmpeg *alongside* the app as a separate+ program.++## The FFmpeg constraint, restated+The bundled `ffmpeg`/`ffprobe` binaries are GPL builds (x264). Because they are+invoked as child processes and never linked (decision 0002), their license does+not propagate to this code - but distributing them makes the *bundle* subject+to FFmpeg's source-availability terms. `THIRD_PARTY_NOTICES.md` names the+builds we ship and where their sources live, and every release links it.++## What would change our mind+Linking FFmpeg into the shipped app (the `ffi` feature graduating from+dev-only) would force the bundle question open again: a GPL libavcodec linked+into an MPL binary is a licensing decision, not a build flag.diff --git a/website/package.json b/website/package.jsonindex 367d114e..cc9a3d29 100644--- a/website/package.json+++ b/website/package.json@@ -23,5 +23,6 @@"oxlint": "^1.79.0","typescript": "~6.0.2","vite": "^8.2.2"- }+ },+ "license": "MPL-2.0"}