Skip to content

Architecture

github-actions[bot] edited this page Nov 7, 2026 · 1 revision

Engine and editing contracts

The vanilla TypeScript ProjectEngine owns interactive project state, selection, history, transport and commands. UI modules dispatch commands and update persistent DOM nodes. The FastAPI engine owns project files, media ingestion, model management, rendering and background jobs. It has a separate automation dispatcher. Preserve equivalent edit semantics between both command paths.

Selection is an ordered set (selection: string[]) beside the primary (selectedClipId, always the set's last id). A plain select collapses the set; clip.select-toggle, clip.select-set and clip.select-all manage it; removal, split, timeline switch and project load keep it in step; selecting is not an edit so clip.select* skips the locked-track pre-guard. Group commands (clips.move, clips.remove, clips.duplicate, clips.add, clips.mute) act on a set as one history step; a group move keeps relative offsets and refuses whole if any member would land on a locked track or before zero. The automation dispatcher mirrors the five with identical semantics.

History holds per-step deltas (engine/json-delta.ts), 200 deep, with one full document copy only for the step in flight; a same-key clip.transform within 500 ms folds into the open step so a slider or grip drag undoes at once. Autosave writes through the ordinary save path 2 s after the last change (30 s cap, on by default); a 409 keeps the local copy and surfaces a conflict bar. Every unsaved change also journals to /api/recovery (DATA_DIR/recovery/<projectId or unsaved>.json, atomic replace); a successful save clears the journal and the start screen offers Restore for the newest one.

A project contains ordered timelines and tracks. Clips carry absolute timeline start and duration, sourceIn, optional speedCurve, transform, keyframes, effects, audio effects and asset references. Keyframe times are clip-relative. Source time is sourceIn plus the integral of the speed curve from zero to clip-relative time. A cut changes sourceIn and shifts curve/keyframe times; negative retained keyframes preserve interpolation across the new boundary.

backend/app/render_document.py validates every timeline and flattens the active one. It derives transition overlap/ramp metadata without mutating stored clips. renderer.py decodes a source frame, applies independent effects/LUT/WGSL, keying/cutout/masks, animated geometry and composition. audio_render.py uses the same timing and transition model, phase-vocoder stretching, allowlisted processing chains and stereo mixing. render_api.py serves PNG frames and produces MP4/WebM through the same FrameRenderer.

Normal blending composites on the CPU by default because per-layer GPU upload and readback cost more than the blend itself; wgpu handles the other blend modes and custom WGSL. R3 adds the stack path: consecutive layers gather into a run and gpu.composite_stack blends them in one device pass through a persistent compositor, the canvas uploaded once and read back once, normal mode included; anything that reads the canvas mid-frame (the Rust kernel, filter clips) flushes the run first, so both paths see identical state. The CPU path stays the reference: FORMCUT_COMPOSITE=cpu forces it, =gpu forces the stack, and unset engages the stack only on a real accelerator, never a software adapter; gpu.status() names the active compositor. Verified within one count of exact float arithmetic, and bit-identical to the CPU path on a rotated three-blend frame, with the stack faster even on llvmpipe because the win is the removed transfers. The remaining pipeline runs on CPU. Since v1.62.0, gpu_effects.py runs a clip's grade, fourteen effects and its transform as WGSL passes on a resident layer under the same rule (FORMCUT_EFFECTS, the CPU as reference and fallback, the Rust kernel serving the CPU side only); decode, the colour panel, LUTs, masks and transitions stay on the CPU, and the warped layer crosses memory once before the blend. Playback streams JPEG frames from render_stream.py on its own renderer while paused frames stay lossless PNG, and preview-bounded decoders are pooled across renderers in video_source.py. Do not rename the path "fully GPU" or infer playback throughput from a successful render.

store.py saves projects with atomic replace and revision checks. A stale save must not overwrite a newer revision. Frontend saves preserve the dirty flag if editing continues during an asynchronous save. Backend RPC edits are one history transaction; history is process-local.

Background work uses jobs.py, with two workers and up to eight active jobs. Status, progress, cancellation and file retrieval have one contract. Model installation and speech use this queue. Reference-counted long-lived assets are not yet implemented; media/assets are retained independently of individual project files.

Writable state comes from paths.py. No runtime writes belong under frontend assets or a PyInstaller extraction directory. HTTP binds to loopback. Mutating API clients send x-formcut-local: 1; the middleware also rejects non-loopback hosts/origins. Web page code has no Tauri shell permissions.

Keep code comments short; the reasoning behind a change belongs in its commit message. Make manual, single-region edits; do not use bulk replacement or codemods. Preserve mounted controls and their focus. Static creation before mounting is allowed; inspect update paths separately. Every version is driven in a real browser before it is released.

Playback and decoding

Playing streams JPEG frames from a dedicated renderer over /api/render/sessions/{id}/stream, paced to the wall clock from the moment the request arrives, with catch-up capped below the decoder's forward-skip window so a stream never cold-seeks mid-play. The body is disconnect-aware: aborting a stream closes its renderer from a background thread under the render guard. Paused and scrubbed frames still come from the lossless PNG frame endpoint, so a still frame matches export exactly.

Sources decode no larger than the preview canvas when a preview width is given; exports pass no width and decode at full resolution. Idle preview-bounded decoders return to a small pool keyed by path and decode size, each remembering its last frame, and a renderer takes the decoder positioned closest before the frame it needs. Stills are bounded to preview size, and a still whose effect stack is only colour grades is prepared once per renderer rather than every frame.

At start the engine says in the terminal what it runs on: the native Rust frame path (formcut_native, built into backend/venv by setup/build_native_gpu) or, when that is missing, an older build or not usable, the slower Python path and why; the GPU and whether compositing is on it; and the ffmpeg in use, with zscale, VideoToolbox and hardware decode. GET /api/engine gives the same. The boot script checks the native engine first and, with Rust installed, builds it when it is missing or older than the engine (FORMCUT_NATIVE_AUTOBUILD=0 skips that).

Hardware encoders (VideoToolbox, and any not otherwise known) are given a bitrate per tier: the size the export sheet estimates for the output's size and frame rate, with a quarter more for a hardware encoder, a maximum half as high again and a buffer twice the rate; H.264 through VideoToolbox is High profile, and its bitstream carries the BT.709 colour description. The sheet's estimate uses the same rate. (Until 2.2.8 VideoToolbox took "-q:v 45" for High, on a scale where its higher numbers are the better ones: High came out worse than Low.)

formcut asks the ffmpeg it runs which filters it was built with (ffmpeg -filters, once per binary). A wide-gamut SDR clip (BT.2020, a BT.601 tag) is converted to BT.709 with zscale where ffmpeg has it, else with ffmpeg's own colorspace filter, which every ffmpeg has (on the demo's BT.2020 clip the two differ by about 2.5 in 255 on average), else by swscale's matrix alone; HDR (PQ, HLG) is tone-mapped through zscale where there is one, and converted by matrix alone otherwise. An ffmpeg installed with Homebrew or by hand may lack zscale (it needs libzimg); the terminal says once which route is taken.

A clip whose media cannot be read (not in the library, its file missing, a link to nothing, or a file the decoder cannot open) is drawn in the preview as a card naming the file and the reason, and said once in the terminal; the rest of the frame goes on, and the preview stream no longer takes its connection down. An export stops instead, naming the file and the reason. A video that the device's colour path cannot read is read again with formcut's own conversion. cd backend && ./venv/bin/python -m app.media_check (or GET /api/media/health) reports every item's file and whether it decodes through both colour paths, and every clip in a saved project whose media the library does not have; it changes nothing.

Every state file in the data folder is kept the same careful way (durable.py): written whole to a temporary file and moved into place, the version it replaces kept as <name>.bak, and a file that cannot be read set aside as <name>.damaged-<time> (never overwritten) with its backup read in its place, rather than read as empty and saved over. That covers the projects (projects.json, each project also kept in project-records/<id>.json, which it is rebuilt from first), the API keys (providers.json, owner-only, its backup too), presets, the cloud, TikTok, Instagram, remote and webhook connections, and the Krea 2 and Klein licence records.

The media library's index (media.json in the data folder) is not its only record. It is written whole to a temporary file and moved into place, the version before it kept as media.json.bak, and each item's own record kept in media-records/<id>.json. When the index is missing or unreadable it is rebuilt from those, and from the files in media/ themselves (probed afresh, named after the clip that uses them in a saved project, or "Recovered "); a media file the index does not know is taken back into it when a clip asks for it and at start, so a lost index no longer leaves every clip undecodable. Deleting media removes its record, so it does not come back. Recovery never deletes a file.

Where the device path runs, formcut converts decoded frames to RGB itself (backend/app/yuv.py) rather than through swscale. A planar 4:2:0 frame at its own size (8-bit, full-range 8-bit, or 10-bit) goes up to the device as its planes when its layer goes straight there, and the first pass converts it; in a fused chain, the conversion is the chain kernel's head, so a layer's upload, conversion, effects and first blend are one dispatch. A frame this side needs (for a colour panel, a grade, stabilisation, a crop, or a CPU-only effect) is converted on the decoder's read-ahead thread by the same map through cv2, and the two agree to a code. The map is bilinear chroma, the stream's own matrix and range, clipped and rounded half up. Against swscale the difference is the chroma filter, about a byte count on average at chroma edges. Without a device, swscale converts as before, so the frame path's exports stay the pictures of the native-cuts and layered paths, which convert with swscale too. FORMCUT_YUV=0 turns formcut's conversion off; =1 turns it on everywhere, as the bench does so that it compares the two paths like with like.

Secrets and environment

Keys are read from the environment by the engine, never from the interface or a project file. example.env is the tracked template; copy it to .env, which the launchers export before starting. .env is ignored by git.

Engine services

  • app/providers.py holds provider keys in the engine (stored first, then the environment, never returned) and runs a real connection test per provider.
  • app/clip_visuals.py serves audio peaks and filmstrips describing whole media, cached on disk, so the timeline windows a cached whole instead of asking for a render per trim.
  • app/storage.py measures the data directory by area and marks which areas are rebuildable.
  • app/orchestration.py carries orchestration sessions, the operation log and the server-sent event stream that jobs publish to.
  • mcp/ is a separate process: an MCP server over the engine, with its own virtualenv because the MCP SDK and the engine's FastAPI disagree on starlette.
  • frontend/src/engine/audio-playback.ts schedules the decoded mix and acts as the transport's clock source; frontend/src/ui/clip-visuals.ts, track-keyframes.ts, accordion.ts, settings-popout.ts and appearance.ts are the interface modules added over the same period.
  • .claude/skills/formcut-skillset/ describes this codebase for local development, generated from the tree rather than written from memory.

v0.56.0

Per-timeline formats resolve at validate_document; reversed intermediates cache under DATA_DIR/reversed; magnetic tracks settle in the engine's emit funnel and after each RPC batch.

v0.57.0

Title styling is drawn entirely in renderer.text_frame; fonts install once by content hash; built-in title styles and their engine-rendered thumbnails live in presets.py and effect_previews.py.

v0.58.0

Preview frames are cached by content and rendered ahead; per-clip audio is cached and mixed live in the interface against the audio clock; export renders on a bounded pool; hardware decode is probed by decoding. The GPU path covers the blend (v1.61.0) and, since v1.62.0, the grade, fourteen effects and the transform as passes in gpu_effects.py, each measured within 1/255 of the CPU reference, which stays the fallback; decoded frames still cross memory between the warp and the blend, and a frame-rate reading needs a real adapter.

v0.59.0

A colour panel runs ahead of the effect stack; effect parameters, volume and animation slots are sampled per frame; pixel-measured parameters scale with the decoded resolution so preview and export agree.

v0.60.0

Mattes are computed once into a cache and only read at render time; encoders are confirmed by encoding rather than by listing; export size estimates come from a model fitted to real output.

v0.61.0

Effects can be added as data packages with a filter allowlist; templates carry their own fonts, LUTs, shaders, fixed media and a poster; model downloads are pinned; the RPC surface covers every interface edit.

v1.56.0 to v1.60.0 (the repository's own numbering, which diverged from the plan's)

Capture remuxes browser recordings in media.py; GIF exports go through an ffv1 intermediate into gif_export.py's two-pass palette; HEIC, AVIF and TIFF stills import through Pillow and pi-heif with the fast paths refusing what their ffmpeg cannot decode; HDR sources are tone-mapped in video_source.py's one decode chain so preview and export agree, and the fast paths refuse HDR; a clip's audioStream is mapped at the one decode site in audio_render.py and keyed into the clip-audio cache. Every registry file is pinned in model_manager.PINNED; model_file() resolves the model folder first, then app/bundled_models, where the build ships U2NetP; segmentation.cutout_ready admits the auto arbitration; brush.py maps strokes to source space for the plain brush and resolves smart strokes through SAM 2 into region outlines that feathered() fills; every ONNX Runtime session takes model_manager.providers(), platform accelerator first, CPU floor.

Planar tracking (P0: the engine)

backend/app/planar.py follows a layer's plane against its reference frame, never chained frame to frame: per frame a homography from the reference and a confidence, in the motion types Mocha names (translation, scale, rotation, shear, perspective; rotation brings scale, as in Mocha), with its track parameters (input channel, Min % Pixels Used, smoothing, Large, Small or Manual motion, search area, angle, zoom). Each frame: a prediction from the last two; for large motion a rough estimate by ORB features of the reference's matte matched near the prediction and fitted by MAGSAC in the motion model; then the frame warped back into the reference by that estimate, the light matched (a robust gain and offset fitted to pairs of smooth pixels, or local contrast where the light has changed a lot), and the reference's points followed into it by sub-pixel Lucas-Kanade checked both ways, the residual fitted in the model and composed, twice. Points under an exclusion matte are left out. A new reference only when the plane has shrunk or grown past three times its reference's size. Windows are sized to the tracked area.

backend/app/planar_bench.py scores it on synthetic shots with known corners: backend/venv/bin/python -m app.planar_bench --size 1920x1080 --frames 300. P0's bar (1080p): unoccluded mean under 0.5 px, worst under 1.5 px, the same through an excluded occluder, no drift. A faint surface (mean gradient under 25 levels a pixel) gets three times the points.

backend/app/planar_api.py (P1) runs it through the engine. A layer is its shapes (polygons in the frame's unit square, each adding or cutting), the frame they are drawn on (its reference, source seconds) and its settings. POST /api/planar/track {media_id, layer, start, stop, above} tracks it as a job, forwards or backwards from its reference or any frame it already has a track for, as far as stop (one frame: a step); layers in above exclude what they cover on each frame, carried by their own tracks or where they are drawn. Each frame's homography from the reference and its confidence are kept in planar-tracks/<layer>.json in the data folder as they come, so a stopped job keeps its frames and the next carries on. GET /api/planar/track/?surface=x0,y0,...,x3,y3 reads them back with the surface's corners on every frame; DELETE clears all or a range (start, stop). A layer whose media, shapes, reference or settings change starts a fresh track. Frames are read at full size by ffmpeg (backwards in chunks read forwards). Every estimate is checked as sound before use (finite, the plane's box still convex and the same way round, a twentieth to twenty times its area); a step that fails anywhere gives the prediction with no confidence, and twelve frames running near zero end the job there with lost in its result, the frames before kept. The job reports frame and confidence as it goes. GET /api/planar/media/ gives a media file's frame rate, size and count; GET /api/planar/frame/?index=&width= one frame as a JPEG.

The Track workspace (frontend/src/ui/planar-workspace.ts, P2) opens from the inspector's Track section (Animation tab: Track surface) for the selected video clip, full screen at the viewer's level. A side panel: layers (visibility, tracking, lock, name, moving in front, delete; higher is in front and excludes what it covers from the layers below), shape tools (select and move points, draw a polygon that a double click or Enter closes, rectangle; add or subtract), and the track settings as Mocha names them (rotation brings scale, shear rotation, perspective all). The viewer draws the frame (fetched from the engine) with the layers' shapes and surfaces carried by their tracks, in the media's own pixels: surface, grid, corner trace, matte, and a stabilised view that moves the picture by the inverse track. The transport tracks backwards, a frame back, stops, a frame forward and forwards, following the job frame by frame, with a confidence strip under the scrubber. Shapes and the surface are kept in the reference frame's coordinates; changing a tracked layer's shapes or settings starts its track afresh, asked first. Done keeps the layers on the clip (clip.planar, a project command with undo); the per-frame tracks stay the engine's.

AdjustTrack (P4): a layer's reference points remove its track's drift, as Mocha's do. Each point has a master frame and its place there; the raw track carries it to every other frame. Where the person puts it back on its feature on a frame, that frame keys its correction (the place less where the track carried it); the master frame's correction is nothing, corrections run linearly between keyed frames and hold beyond. On each frame the points' carried and corrected places give a correcting transform (a homography from four or more points, least squares past four; affine from three; a similarity from two; a shift from one), composed in front of the raw track: the adjusted track (planar_api.adjusted_track). POST /api/planar/adjust/ sets a layer's points and keeps the adjusted track in the layer's store beside the raw one, made again after every re-track; the read, the surface's corners, the corner pin, the Transform keys and the tracked matte follow it where there is one. POST /api/planar/nudge is Mocha's Auto nudge: the master frame warped into the frame's geometry by the track, the patch around the point searched for within the maximum motion to a fraction of a pixel. In the workspace, AdjustTrack (a view) puts four points on the surface's corners the first time, draws each where the engine will put it (a red X on its master frame), joins them with lines coloured by their spread, and keys a correction where one is dragged (on its master frame, it moves its home); New point, Next, Set master, Delete, a 0.1 px nudge pad and Auto nudge with its search region and maximum motion.

Roto (P5, backend/app/planar_shapes.py, its twin in planar-workspace.ts): a shape may be an X-Spline, each point's tension from a corner (0) to a smooth curve (1) (a Hermite curve whose tangent at each point is the Catmull-Rom tangent times its tension, after the behaviour of Mocha's X-Spline handles), may carry each point's own feather (media pixels; the matte's edge fades outward over its nearest part's feather), and may be keyed on frames (keys: frame -> points, linear between, held beyond). A layer may be linked to another's track (link): its shapes ride that track, adjusted where it has one, in the workspace, the renderer's matte, the exclusion of layers behind it and the apply step. In the workspace a layer that is not tracked is a roto layer: dragging its point keys its shape on that frame (the first key holds across the clip), and with Uberkey the point moves the same on every key; Smooth draws X-Splines; a selected point's tension and edge feather are set in the shapes panel; the strip ticks the selected shape's keyframes. A tracked layer's shapes stay its search area (editing them starts its track afresh, asked; a point's feather is the matte's and leaves the track alone).

Click to spline (P6): POST /api/planar/segment {media_id, frame, points} runs formcut's click-select model (SAM 2 Hiera Tiny, the cutout's) on that frame at the clicked points and traces its largest region into a shape's points (segmentation.outline, the same simplified path the cutout's convert-to-mask gives); refused plainly when the model is not downloaded. The workspace's Segment tool adds it to the current layer as an X-Spline at half tension, mapped into the layer's reference like a drawn shape. The shapes panel also steps between the selected shape's keyframes, adds one (the shape as it is on this frame) and deletes one (the last kept as the shape); a double press on a shape's edge in the select tool adds a point there on every keyframe (told from two presses, since a press re-draws the overlay and Chromium then sends no double click), and Delete point takes one off every keyframe (three kept at least).

The key with tracked mattes (P7): a clip's tracked matte (P3) is the key's garbage matte, multiplied after it. The key's hold-out (key.holdout: planar layer ids) is its core matte: inside those layers' shapes, carried by their tracks through planar_alpha, the key takes nothing away. Its spill suppression (key.spill, 0 to 1) takes off the part of each pixel's chroma (its colour less its mean) along the key colour's own chroma direction, where it leans that way; that direction has no mean, so brightness is kept, and a colour leaning away from the key is left alone. A clip whose key has either is keyed on the CPU side (the device's key pass has neither). The inspector's key section has Spill; the workspace's Apply to a clip has Key hold-out for this clip (the key must be on); Remove key hold-out is in the Track section.

Green screens (P8, on the owner's three phone shots): backend/app/planar_green.py measures a green (or blue) screen's corners on every frame without a tracker: the screen keyed (green less the larger of red and blue, the map upsampled twice), its outline taken, the outline points on the convex hull kept (a notch is bridged), each side's straight edge found by RANSAC within a pixel among the points near that side (a rounded corner's arc has few collinear points), refitted, and the four lines crossed (the sharp corners the rounded ones stand for). python -m app.planar_green shot.mp4 scores the planar tracker against it, tracking the phone's border (the screen grown 8% less the screen shrunk 4%, as a Mocha artist leaves a shiny screen out). The track job also tracks by the screen itself (settings screen: green or blue; the workspace's Track by): each frame's measured corners against the first's, a four-point homography; frames where the screen cannot be read (a finger over it) are filled from the read frames either side, linearly, gaps up to a second, confidence 0.5. The key's spill suppression fades with distance from what the key took away (a blurred map of it reaching about 3% of the frame): spill is the screen's light, near it.

Input channel max (the brightest of the three channels, HSV value): a reflection adds white light, and on a saturated screen colour only the other two channels can rise, so the screen's luminance climbs under glare while its brightest channel stays put. On the owner's upright phone it took the planar track from 0.72 to 0.39 px RMS by sides (worst 6.1 to 2.8 px). planar_green measures each side from greenness profiles across it (their halfway crossings) and scores the tracker by its sides; the corners are reported too, but in strong perspective the far ones are ill-conditioned for any measurement.

The key's colour-difference mode (key.mode "difference"): how far the key colour's own channel leads the larger of the other two, as a share of its lead in the key colour; black, grey, white and colours leaning away cannot be keyed at any setting. Spill suppression's reach: from what the key took, filled out to the convex outline of each large keyed area, so glare the key leaves anywhere on a screen loses its green, while what lies outside (a wall) keeps the falloff. For green-screen phone shots the method that holds up (the owner's preference, tested on their three shots): the screen tracked by its own edges (Track by: a green screen's edges), the plate keyed on top keeping its own glare (similarity 0.3, blend 0.12 to 0.2, spill 0.7 to 1), the picture corner-pinned below.

Planar modules (v2.5.2 to v2.5.5)

The Track workspace's modules, each a renderer step or a job over a layer's track (backend/app/planar_api.py, backend/app/renderer.py): Stabilize and ReOrient (planarStabilize, planarReorient, the frame warped by the track's inverse or forward homography); Remove (POST /api/planar/remove, a job: the hole filled from up to 20 frames either side through the background's track, inpainted where none shows it, out to the media bin); Insert (cornerPin.match: the plate's shading, grain and softness measured per frame and laid on the insert); Lens (POST /api/planar/lens, k1 and k2 fitted by Levenberg-Marquardt to lines that should be straight; clip.lens undistorts and redistorts in the render); PowerMesh (POST /api/planar/mesh: each vertex followed by Lucas-Kanade, only outliers corrected; cornerPin.mesh warps the insert cell by cell in one remap); and the 3D camera solve (GET /api/planar/camera/<layer>: focal length from the plane's right angles, both poses solved and the front-facing one kept, as JSON or a Nuke Camera2). Matte Assist (POST /api/planar/assist) carries a shape by dense flow inside it snapped to edges.

Screen replacement (v2.5.6)

What made the owner's phone composites right: the picture pinned with supersampling (cornerPin.supersample: shrunk by area to four times the canvas, warped there, averaged down, so a wallpaper shrunk 5 to 15 times keeps its lines); cleanPlate (a reflection lies on the whole glass, so the notch and border are replaced from a reflection-free frame through the track, levelled per channel); screenCut.front layers for what lies in front (a keyed occluder grown by front_grow so the key decides its edge; the screen-colour rules measured on a colour lead smoothed by a pixel, so 4:2:0 blocks do not step); full despill within 4 px of the cut. The screen-edge track (green_quad per frame) records how much of a band inside each side is covered; frames whose rim is covered beyond its usual share, or whose corner jumps over 1.5 px, widened by three frames, are bridged from the clean frames around them (a quadratic in time), so a hand crossing the screen no longer moves it (the worst corner jump on clip 3 went from 5.38 to 0.76 px).

Cutdowns and delivery (v2.5.7 to v2.6.2)

From the owner's Posh cutdowns, the work that ran outside formcut is now in it:

  • jobs.py keeps a ledger (jobs.json) at each status change with a recipe; on start finished jobs return and an export caught mid-render is queued again under its own id. Until that resume has run, a ledger write keeps the records still on disk (a startup job once overwrote it).
  • render_api.py: the audio bitrate; measure_loudness and loudness_gain (one gain to a target under a true-peak ceiling); a rate more than 0.2% from the project's sampled from the timeline at that rate (rendered at the project's rate and padded by the encoder, a 24 fps edit at 30 repeated every fifth frame).
  • qc.py: the delivery check, its perceptual repeats ffmpeg's mpdecimate.
  • cadence.py: a source's cadence map (each frame's share of pixels changed by over 4 levels; new above the larger of 0.15% and 5% of the local new-frame level), formcut's frame choice replayed per clip, the per-clip solver, and an mpdecimate simulator matching ffmpeg's decisions frame for frame.
  • speech.py: the voice map (Silero VAD, MIT, 32 ms steps) and the cut rule (unsafe with speech on both sides within 100 ms). Transcription word times are not cut points; loudness pauses fail under a music bed.
  • music.py: spectral flux, tempo by weighted autocorrelation then tempo and phase searched together (0.01 BPM), the final hit, bar-aligned joins between safe zones. The downbeat is not detected (a four-on-the-floor kick gives beat one no accent): the first beat stands for it.
  • cutdown.py: the planner, ranked scripts with exact source segments; on the Posh master all seven delivered scripts are among its candidates. The ranking is by natural joins, not meaning.

formcut

Pages

In the repository


These pages are published from .docs/wiki/ in the repository. Edit them there; a push to main updates this wiki. Editing a page here is overwritten by the next publish.

Clone this wiki locally