Commits
2026-08-11
✨ feat(mix): every track has its own volume and the mix has a ceilingAhmet Kaan Gümüş · dc7d07d
✨ feat(mix): every track has its own volume and the mix has a ceiling A fader per audio track and one master limiter over the sum of them, both applied where the lanes are added and nowhere else -- so what an export writes is what the room heard, by construction rather than by two call sites agreeing. A track's fader moves everything on it, every frequency: it is not the equalizer (one take, one band) and not the panel's volume (this machine's monitoring, which no file carries). The limiter is lookahead, soft-knee and per sample: the peak of an exported file is a measurement, not a hope, and the hard clamp stays behind it as the backstop. Flat settings are still the bit-exact passthrough: one lane at unity with the limiter off never opens a mixer thread, and an mp4 of such a timeline is still a packet copy. A mixed one re-encodes, and the card says so before the export starts. Both belong to the project, so `.edith` is v9: `fps`, `limiter` and `gain` lines, every older dialect still loading flat. The rate line pays an old debt with it -- a timeline of nothing but stills and songs now comes back at the rate it was cut at instead of the one its scaffold implied. UI: the mix card (f, or an audio track's own header), rows with steppers and hold-to-run arrows, and the track's level on its header.
2026-08-10
✨ feat(timeline): a clip shot at another rate plays at the speed it was shot atAhmet Kaan Gümüş · 26af1e4
✨ feat(timeline): a clip shot at another rate plays at the speed it was shot at A frame rate of its own is no longer a refusal at import. Every frame number in the edit list counts the *timeline's* frames -- a clip's in/out included -- and a file shot at another rate is converted once, at the decoder's door: `Rate` (milli-fps rational, `Speed`'s floor/ceil pair) says which frame of the file a timeline-rate frame is. Playback opens its worker through it and stamps the pictures coming back through its inverse; the export walks its span through it after the speed, so a 2x 24 fps clip on a 30 fps timeline is exactly both. Nothing in `project.rs` changed: placement, trim, split, paste and speed are the same arithmetic on one clock, and a single-rate project takes the identity map everywhere it used to take nothing. A library row now names the *file's* rate rather than the timeline's, which was true only while every source shared it.
✨ feat(timeline): silences are cut out or played fast in one pressAhmet Kaan Gümüş · d4ac3fc
✨ feat(timeline): silences are cut out or played fast in one press A scan of the selected clip's own sound (RMS dBFS over 20 ms windows, off the decode path the waveform already takes) marks every silence on the lane before anything moves; `enter` cuts them all out with a ripple, `f` plays them at 4x with the room they no longer need closed behind them. Either way it is one edit and one undo press, however many it found. Four numbers, all keyboard-driven from the card: the threshold, the quiet short enough to forgive, the padding kept either side of speech, and the kept sliver short enough to swallow -- the last of which is what stops a breath between two silences surviving as one-frame confetti. `set_speed` does not ripple, so speed mode closes the gaps itself; a clip on another lane lapping over a silence is refused by name, because the lanes would shrink by different amounts. A source with no audio track at all is refused by name too rather than read as one long silence. Output is ordinary clips: `.edith` stays v8.
✨ feat(timeline): clips play at a speed of their ownAhmet Kaan Gümüş · f8effe8
✨ feat(timeline): clips play at a speed of their own A clip gains a rate (`Speed`, thousandths of real time, 0.25x to 4x) and every speed question is answered at the mapping seams that were already there: `Clip::frames` is the source range divided by the rate, `end` is built on it, and `map`/`span_at`/`composite_span_at` walk the offset through `Speed::source_at`. `in_frame`/`out_frame` stay *source* frames, so a trim and a split still address the file. The picture needs no new decoder: the span says how many source frames it reads, and `try_frame` brings the decoder's numbers back through the same rate -- at 2x two decoded frames land on one timeline frame and the display's drop-when-behind policy takes it from there. The sound is resampled per segment inside the worker playback and the audio export already share (linear interpolation, carried across packet seams), so the pitch moves with the rate: tape, not pitch-preserve, and the card says so. Each segment is told how much timeline it owes and pads or trims to it, which is what keeps a run of speeded cuts from drifting. Rounding is where a rate could break the lane, so it does not: `Speed::fit` never hands a trim more source than its room holds, and `Speed::split_at` refuses a cut a slow clip's rate cannot address rather than leaving two halves that no longer add up. The fuzz sweeps set_speed in with the rest. - card in the eq/colour pattern, on `j` and in the clip menu; a drag is one undo step for the whole linked group, 1.00x reachable by hand and by `r` - clip boxes carry a "2.00x" mark, and their width, waveform and details row are the timeline length - WAV/FLAC honour it; mp4 and AV1 *refuse* by name -- that path copies AAC packets and a resample is not a copy (ponytail names the upgrade path) - .edith v8 carries the rate; v7 and older load at 1.00x - `assets/test_speed_sync.mp4`: one flash, one beep, same instant. At 2x they still land together, to the frame.
✨ feat(timeline): still images import and place as clipsAhmet Kaan Gümüş · 30d430d
✨ feat(timeline): still images import and place as clips A PNG, JPEG or WebP is a source like any other: it imports into the library, drags onto a video lane, shows at the playhead, trims, saves and exports. `engine::is_image` is the door, beside `is_audio`, and every choice it forces is made in one place. The decisions, spelled out: - Extensions: png, jpg, jpeg, webp -- exactly what the `image` crate is built with here. Anything else is refused by the door that refuses a .txt. - Length: an image has none, so it is *held to* ten minutes (600 s at the timeline's rate) and *placed* at five seconds. The cap is finite on purpose -- a u32::MAX sentinel would hand a trim drag a wall past anything the timeline can hold -- and it is recomputed identically at load, so a clip trimmed out to it reopens. - Image-first project: its own picture is the canvas (a still *has* a resolution, unlike a song) at 30 fps, silent, one 5 s clip on V1. The A2 audio-only precedent for everything else. - Scaling: none of its own. The still is decoded once to I420 and goes through the same grade, the same `Composer` and the same conversion a decoded picture does, so a 640x360 image on a 1280x720 canvas is letterboxed by its fit policy and never stretched. - Lanes: the mirror of a song. A still goes on the video lane it was asked for or on V1, never on an audio one, and never as a grouped take -- a clip on A1 playing a PNG is a segment the audio worker cannot open. Hand-written projects are refused by name. - The timeline's audio parameters are now the first source that *could* have any, so an image as source 0 no longer holds every later import to its silence. Playback opens a still worker (one conversion, then a memcpy per frame, as the black-gap worker does); the export's `ClipDecoder` hands the same planes out for as long as the span runs, so a mixed video/still timeline encodes at the cut. tests: engine/tests/images.rs -- import registers only, placed pixels match the file's own (top/bottom bands catch a flip, RGB order catches a swap), trim walls at the cap, .edith round trip incl. the audio-lane refusal, mp4 export pixel-checked at the cut, audio-lane placement lands on V1. Fixture: scripts/gen_fixtures.sh writes assets/test_still.png.
🐛 fix(engine,ui): paste respects lane kinds; bounds and rebind capture hardenedAhmet Kaan Gümüş · 11603ec
🐛 fix(engine,ui): paste respects lane kinds; bounds and rebind capture hardened Four bugs a hunter sweep found, each with the door it comes in through: - `Project::paste` put the clipboard clip in the first lane of *every* kind, so an audio-only clip copied off A1 landed on V1 too: a wav as a video source, a decode that fails, and a save the next open refuses. It now asks the source what it is, the same question `place_stream_at` asks an import, and reaches A1 only when there is no picture. - The `resolution` line was applied unbounded while the keystroke capped at 8K, so a crafted `resolution 4294967295 4294967295` panicked `open_black` with a capacity overflow. One bound now (`engine::is_resolution`) with both doors asking it, and the load door refuses by line like every other malformed line. - `open_room` shifted starts unbounded, and the file format permits a clip ending at the very last frame: a paste wrapped it round to the front of the lane -- a debug panic, or in release an overlap no reload accepts. The edit door refuses the paste that would push anything past `u32::MAX`; the load bound stays where it is, since the wrap was the edit's to prevent. - A rebind captured whatever gpui reported, so shift+= wrote `play +` and the next load threw the *whole* keybindings file away, losing every other rebind. Capture now takes only a chord the file can spell and read back, and a line the parser cannot use costs that line alone -- the magic line is the only thing that still refuses the file.
✨ feat(engine): I420 scaler and fit geometryAhmet Kaan Gümüş · dd54308
✨ feat(engine): I420 scaler and fit geometry Bilinear 16.16 rescale, four fit policies handing back chroma-grid-aligned placement and crop rects, and a canvas blit -- the primitive a project resolution decoupled from media resolution needs. 3.82 ms/frame for 1280x720 -> 1920x1080 in release; nothing is wired to it yet.
Merge S5a audio-file import into stream-picker mainAhmet Kaan Gümüş · 1bb8ee2
Merge S5a audio-file import into stream-picker main
Both sides taught `audio` a new axis and they meet on one type: S5a made
`Track` an enum over the mp4/AAC reader and symphonia's, main gave every
reader a `(path, stream)` address. The merged `Track::open(path, stream)`
keeps both -- the stream index lives inside `AacTrack::open`, and a
standalone audio file, which has exactly one track by construction, refuses
any stream above 0 rather than quietly serving the only one it has.
- `AudioProbe` is S5a's `{sample_rate, channels}`: equality is playability,
so an mp3 may share a timeline with mp4s. Copyability is a separate
refusal, at export, and stays AAC-only through `copy_track`.
- `probe_streams` reads a standalone file through symphonia instead of
walking it as an mp4 -- an ALAC .m4a parses as an mp4 whose only audio
track is not AAC, so the mp4 walk would call it undecodable where
symphonia decodes it.
- Which lane a source lands on is decided once, in `place_stream_at`: a
file with no picture is placed on the audio lane alone, everything else
is pasted as a grouped take. The front-end only owes the refusal notice.
- `unsupported()` and the NTSC/VP9 work are untouched; `is_audio` files
never reach the former, since a song cannot open a timeline at all.✨ feat(engine): common audio files import and playAhmet Kaan Gümüş · fe53979
✨ feat(engine): common audio files import and play mp3, wav, flac, ogg-vorbis, ALAC and ADTS join a timeline as sources with no picture: symphonia's own probe reads them, the audio lane holds them, and the video lane refuses them by name. The mp4/AAC path is untouched -- it is still the only one that yields packets an export can copy, so a timeline carrying anything else is refused at export with the file and its format named rather than exported silent. A source with no picture is as long as it plays, rounded up to whole frames; import, load and the library row all derive its length from that.
✨ feat(engine): VP9 import via the VA-API pluginAhmet Kaan Gümüş · 03a34d3
✨ feat(engine): VP9 import via the VA-API plugin The demuxer takes a vp09 track alongside avc1 and hands its samples through untouched -- an mp4 VP9 sample is a self-contained superframe, so there is no avcC repack and no parameter sets to re-inject. VideoMeta carries the codec, and the plugin picks its cros-codecs decoder from it. The C ABI is unchanged on purpose: the plugin demuxes the file it is given, so the codec is a property of the container rather than of the call, and a libengine_hw.so built before this still loads and still decodes H.264 -- it simply returns null for a VP9 path, the same no it gives for an unsupported profile. There is no software VP9 decoder to fall back to, so a VP9 file the plugin will not take is refused at open, by name, where the front-end can show it -- never a black screen, and never VP9 bytes fed to rusty_h264. One timeline stays one codec, and export re-encodes to H.264 as before; only audio is ever copied packet for packet.
✨ feat(engine): every audio stream is listed, and any one of them opensAhmet Kaan Gümüş · dff7d84
✨ feat(engine): every audio stream is listed, and any one of them opens A remux carries one audio track per language; the engine took whichever AAC track a HashMap handed it first and there was no way to ask for another. - probe_streams() describes every audio track in file order, undecodable ones included (decodable: false) so a picker can grey them rather than hide them - open_multi_streams() takes (path, stream) per source; the old open_multi_segments is a wrapper pinning stream 0, so no caller moved - stream ids come from moov.traks, not the tracks HashMap: "stream 0" was a different track run to run on a multi-track file - a named stream that is missing or not AAC is an Err; stream 0 stays the silent source it always was, because a file we cannot decode the audio of still has a picture worth editing - assets/test_multiaudio.mp4: video + AAC stereo + AAC mono (fra) + AC-3, which covers the picking, the language and the greyed row
2026-08-09
✨ feat(waveform): min/max peak extraction off the audio decode pathAhmet Kaan Gümüş · 57bd150Browse files
✨ feat(engine): .veproj save/load — relocatable, validated, atomicAhmet Kaan Gümüş · ac60b80
✨ feat(engine): .veproj save/load — relocatable, validated, atomic A project file is line-based text: `veproj 1`, an optional playhead, one `source` line per file and one `clip` line per range. Text because a path is bytes on this platform and a JSON string could not carry one losslessly, so the path field is byte-escaped instead; paths under the project's own directory are written relative to it, which makes a folder of media plus its .veproj movable anywhere. The parser is strict and every refusal names its 1-based line, and writing goes through .part + rename as an export does. Loading is a new session, never a mutation of the old one: source 0 defines the timeline, every other source passes the same checks import applies (in the same words), and every clip has to still fit inside the file it plays from -- a source that vanished or shrank is a refusal that names it, not a silently shorter timeline. Sources no clip plays from are pruned at save, so an import that was undone cannot leave a file behind that blocks a future load.
✨ feat(engine): multi-source traversal, import validation, cross-source exportAhmet Kaan Gümüş · 68b0ca2
✨ feat(engine): multi-source traversal, import validation, cross-source export Wave 2 of the import slice, two packages merged at one seam. Playback traversal (S3): next_clip/seek open each clip against project.sources()[clip.source]; audio switches to open_multi_segments over the (source, start, end) triples segments_from now yields. New PlaybackSession::import validates dimensions, fps and audio params against the timeline before appending, and reseeks unconditionally so a running audio worker learns the appended tail. clip_spans_by_source() added for the app's per-source tint. Cross-source export (S4): export::start drops its source path argument -- Project::sources() is the only path truth now -- and is pub so a test can build a multi-source Project without a session. Each clip opens its own ClipDecoder; the audio pass carries one bresenham accumulator across source joins. Seam: PlaybackSession::path is gone. It was kept only to feed export_to, which no longer takes a path, so the field and its initialiser go with it.
✨ feat(engine): export — edit list to mp4, HW encode with SW fallbackAhmet Kaan Gümüş · 86d5c15
✨ feat(engine): export — edit list to mp4, HW encode with SW fallback Worker thread per export: decodes each clip straight to I420 (never through DecodeSession, which only speaks BGRA), feeds one encoder chosen once -- VA-API plugin unless VE_SW_ENC=1 or the plugin is unavailable, rusty_h264 Fast/CBR otherwise -- and muxes the access units as they come. Audio is copied packet for packet, so the file has to be opened before the first video sample is written. Cancel and every error path delete the partial file; progress is a permille atomic a render loop can read without a lock. mux: the movie timescale moves to 90 kHz. mp4 0.14 converts each sample duration into the movie timescale with its own integer division, so 1 kHz lost 0.33 ms per frame and made a 4.000 s export announce 3.960 s.
✨ feat(engine): export lane 1 — mux module, AAC packet copyAhmet Kaan Gümüş · 5ce68fe
✨ feat(engine): export lane 1 — mux module, AAC packet copy mux.rs is the write side of demux.rs: split_annex_b/nal_type feed a repack to 4-byte-length-prefixed samples (mp4 0.14 hardcodes length_size_minus_one=3), SPS/PPS/AUD/SEI stripped out of the sample bytes, is_sync taken from an actual NAL type 5 rather than GOP arithmetic. Mp4Muxer::create wants the parameter sets up front, so mux::parameter_sets pulls them out of a buffered first access unit before the muxer exists. Timescales are 90000 video / sample_rate audio / 1000 movie, per-frame duration (90000/fps).round(), and mp4 0.14 ignores Mp4Sample::start_time on write -- timing is duration accumulation only. An SPS shorter than 4 bytes panics inside the crate (avc1.rs indexes sps[1..3]), so create rejects that and the other degenerate shapes up front instead. Audio is copied, not re-encoded: there is no pure-Rust AAC encoder and mp4 0.14 has no PCM MediaConfig, so the only honest option is to hand the source packets back through verbatim. AudioSession::copy_segments does that -- stts walk to packet ids, no decode, bytes straight from read_sample. Cut points do not land on 1024-sample boundaries (23.2 ms packets vs 33.3 ms frames), so a bresenham accumulator picks the packet run per segment and keeps the cumulative A/V offset under 512 samples, proven by induction over the carry and measured over 200 random join lists. The first segment starts one packet early to feed the 1024-sample priming drop; interior segments do not, because an extra head packet there is 23 ms of pre-cut audio at every join and it would not fix the missing MDCT predecessor anyway. That artifact is documented at the seam.
✨ feat(engine): clips primitives — edit-list model, bounded decode, segmented audioAhmet Kaan Gümüş · e75a7ba
✨ feat(engine): clips primitives — edit-list model, bounded decode, segmented audio Lane 1 of the clips slice; PlaybackSession traversal comes next. - project.rs: Clip/Project — cut (metadata-only, refuses no-op splits), delete (closes gap, keeps ≥1 clip), undo snapshots, timeline↔source mapping with boundary sweep tests - decode: open_range(start, end) — both backends stop after end-1, empty/inverted ranges disconnect cleanly without spawning a worker - audio: open_segments — one worker walks the edit list; segments bit-exact vs equivalent seeks, joins gapless by contiguity assert, head+tail trim inside a single AAC packet handled
✨ feat(engine): seek primitives — video open_at, ao_flush, audio open_atAhmet Kaan Gümüş · 96ae365
✨ feat(engine): seek primitives — video open_at, ao_flush, audio open_at Lane 1 of the seek slice; PlaybackSession orchestration comes next. - demux/decode: stss sync lookup, DecodeSession::open_at decodes from the keyframe and discards to the target; Frame.index stays absolute. HW plugin ABI: vh_open renamed vh_open_at(path, target) — discards skip the vaGetImage readback; measured seek cost 65ms HW / 222ms SW - engine-audio: ao_flush drains the ring consumer-side in the RT callback (one-shot atomic), stale PCM unplayable even when paused; played-position atomics untouched so clock math survives - audio: open_at walks stts, 2-packet AAC pre-roll (MDCT overlap reconstructed exactly — verified 0-diff before the first PNS band), sample-exact trim; priming skip and seek discard unified. AAC seek is deliberately not bit-exact: symphonia's PNS noise LCG state depends on packet history; bounded <1e-3 by test instead
✨ feat(playback): A/V session — audio-master clock, real-speed video, space to pauseAhmet Kaan Gümüş · 63e6964
✨ feat(playback): A/V session — audio-master clock, real-speed video, space to pause engine::playback::PlaybackSession wires DecodeSession + AudioSession + AoSession + PlaybackClock together behind open/play/pause/toggle/now/tick. A feeder thread pours decoded chunks into the device ring; tick() polls the device position into the clock and switches to wall time at audio EOF. Every audio failure (no track, no plugin, no daemon) degrades to a wall-paced silent session. The app renders against the clock: drain every due frame, show the last (drop-when-behind), hold one that is early. Space toggles playback.
✨ feat(engine): audio decode, PipeWire output plugin, playback clockAhmet Kaan Gümüş · 229a569
✨ feat(engine): audio decode, PipeWire output plugin, playback clock Wave 1 of the audio slice — three independent modules, app wiring comes next: - audio.rs: AAC-LC via standalone symphonia AacDecoder over the existing mp4 demuxer; priming trim read from the container elst (verified against ffprobe); channel identity pinned by zero-crossing tests on the 440/880 Hz fixture - engine-audio: dlopen'd PipeWire cdylib (ao_* C ABI). App binary keeps zero libpipewire linkage; daemon absent fails open() in ~1ms. Fill capped at 1024 frames/callback: uncapped, PipeWire hands the sink-sized buffer and the position clock steps 256ms at a time. Stream time rate is 1/48000 regardless of stream rate — position is rescaled or the clock runs 8.8% fast on 44.1k content - clock.rs: PlaybackClock, audio-driven with wall fallback; audio positions relative to last re-anchor so restarted streams re-sync; paused == frozen exactly, all re-anchoring through one path
🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui previewAhmet Kaan Gümüş · 0acbf8d
🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui preview - engine: mp4 demux → Annex-B, rusty_h264 software decode, BT.601 I420→BGRA; decode on worker thread behind a bounded channel - engine-hw: optional VA-API decode plugin (cros-codecs) behind a C ABI, dlopen'd at runtime with silent software fallback; the app binary keeps zero libva/gbm/drm linkage so it runs on any distro - app: gpui window, per-frame RenderImage swap + drop_image - vendor/: cros-libva + cros-codecs with 3 LOCAL PATCH fixes (libva 1.23 struct init, radeonsi 64x64 min context, pub surface()) — upstream is dormant, so vendor/ is adopted code, not a temp fork - fixtures are gitignored; scripts/gen_fixtures.sh regenerates them