Commits
Commits on
978e6857d64772912559c8d8a4e6ee7cd309bdccFiltered to crates/engine/tests/export.rsClear filter2026-08-20
🐛 fix(engine): stale dialect asserts learn the current magicAhmet Kaan Gümüş · 6b8d7dd
🐛 fix(engine): stale dialect asserts learn the current magic Six integration-test asserts still pinned "edith 16" on freshly saved projects; the suite had not compiled since that dialect.
✨ feat(engine): clips can be moved, scaled, rotated and cropped (edith 20)Ahmet Kaan Gümüş · 684b8a4
✨ feat(engine): clips can be moved, scaled, rotated and cropped (edith 20) Per-clip TransformParams (position, scale, 90-degree rotation, crop) shared through a colour-style table, applied in both the playback preview and the export compositor, persisted as the edith 20 dialect; v19 files load untransformed.
2026-08-19
✨ feat(engine): clips can name a dissolve into their neighbor (edith 19, storage+format)Ahmet Kaan Gümüş · 8369d8e
✨ feat(engine): clips can name a dissolve into their neighbor (edith 19, storage+format) transition_out frames on a video clip dissolve it into the adjacent next clip; split keeps the tail's transition clamped and zeroes the head; v18 files load with hard cuts, v19 round-trips bit-exactly. Blending (playback and export) lands separately.
🐛 fix(engine): integration tests learn the sample-rate argumentAhmet Kaan Gümüş · c6b5eb7
🐛 fix(engine): integration tests learn the sample-rate argument cf27932 added sample_rate to export::start and edith::save but left every tests/ call site behind; cargo build -p engine --tests has been broken since. All 34 call sites pass None (source rate), preserving each test's old behavior.
✨ feat(engine): per-clip audio fades, adjacency crossfade, and edith 18Ahmet Kaan Gümüş · 6d0747c
✨ feat(engine): per-clip audio fades, adjacency crossfade, and edith 18 Clip carries fade_in/fade_out, an equal-power gain envelope mixed into playback and export, a crossfade() op that sets both edges of two adjacent audio clips, and split's rule that only the kept edge keeps its fade. The project file format bumps to edith 18 to carry the two new fields; a v17 (or older) file loads with every clip's fades at zero. Fixes a stray fade_in/fade_out struct-literal fragment left outside any Clip literal in Player::trimmed (crates/app/src/player/timeline_edit.rs), which was a syntax error breaking the whole app crate's build. Adds unit coverage for Fade::gain_at's boundary/midpoint curve, the split edge rule, crossfade's adjacency refusal, the Clip size-lock test (40 -> 48 bytes), and a v17-loads-zero-fades / v18-round-trips edith.rs test.
🐛 fix(engine): the proxy tests take turns over their one filmAhmet Kaan Gümüş · 31449fc
🐛 fix(engine): the proxy tests take turns over their one film
Both proxy tests proxy test_av.mp4, and a proxy job is one per film:
run in the same binary, whichever asked second was refused ("a stand-in
for this film is already being made") and a cancel in one deleted the
file the other was asserting about -- the rotating failure this binary
has shown all sweep, misread as starvation until the panic named it.
A shared mutex serializes the pair; everything else still runs wide.✅ test(engine): the long export waits ride out the binary's own loadAhmet Kaan Gümüş · c319ba2
✅ test(engine): the long export waits ride out the binary's own load A software-seat export here costs up to ~130 s alone and the binary runs its tests together; the 120/180/300 s completion budgets rotated through starvation failures, a different proxy test each run. 600/900 s now -- hang guards, the same law as the AV1 and subtitle budgets. The short waits stay: 5-60 s there is stop-latency semantics under test, not completion.
✅ test(engine): the proxy's opening window rides out its siblingsAhmet Kaan Gümüş · 2c8bd01
✅ test(engine): the proxy's opening window rides out its siblings The encoder opens in under a second alone, but the binary's other exports can starve the worker for minutes -- 120 s tripped three times this sweep, twice under suite load and once under the binary's own. 600 s now: a hang guard, not a speed claim, same law as the AV1 budget.
2026-08-15
✨ feat(timeline): ctrl-click multi-selection, manual groups, ctrl+aAhmet Kaan Gümüş · 66d5395
✨ feat(timeline): ctrl-click multi-selection, manual groups, ctrl+a The app half of manual clip grouping: the timeline's selection becomes a list of picks (Selection, click order kept, anchor = last), ctrl+click toggles a pick on every clip box, caption box and edge strip, and a right-click on a picked placement keeps the selection so the menu's Group row acts on all of it — one pick keeps the span-partner flow. SelectAll takes ctrl+a (every clip and caption, one selection) and RemoveAudioLane moves to ctrl+q beside its own letter. The oracle unhides Group and Detach over captions, words the one-clip-per-lane refusal, and the caption menu grows the group rows. marked() lights every pick and its link-mates — captions included — captions wear the grouped border, trims preview each member by the drag's delta clamped to its own room, deletes route a grouped caption through the group door, and a drag's snap excludes the group it carries. The save-format tests and every affected app suite updated with the new shapes.
2026-08-14
🐛 fix(ui): a stand-in being made can be stoppedAhmet Kaan Gümüş · e534575
🐛 fix(ui): a stand-in being made can be stopped A proxy is a whole film through a decoder and an encoder, started without being asked for, and until now there was nothing that could stop one: the row said "proxy 12%" for as long as it took, on a machine somebody was trying to cut on. So the row that shows the encode running carries the way out of it: a × beside the percentage, the subtitle row's button and the subtitle row's rule -- it stops the click there, since the row under it picks a file and stopping an encode is not a way of choosing one. The engine already had the stop (`proxy::Job::cancel`, the export's own checkpoints), so nothing new was invented for it. What is new is the two states between the click and the end: `Cancelling` holds the job while the worker winds down -- it gives up at its next frame and deletes its own half-written file -- and `Cancelled` is where it settles, kept in the map so no repaint starts the encode that was just stopped all over again. The worker's own answer is what settles it, which is what makes the three claims checkable rather than hopeful: nothing is left under the name a finished stand-in would have (the cache is looked up by existence alone, so a file left there is a cut made on a truncated picture), the `.part` goes with it, and an encode that *beat* the stop settles as the ready stand-in it is rather than being deleted underneath the switch that is playing it. Asking twice is asking once. The new test in tests/export.rs is those four in one pass, on the software seat: stop it mid-encode, wait for the worker, then look at the directory.
🐛 fix(engine): a bar that has been filled is not taken back when the GPU diesAhmet Kaan Gümüş · 197d1e2
🐛 fix(engine): a bar that has been filled is not taken back when the GPU dies The hardware encoder's process dying puts the whole export through the software encoder again, and the bar was put back to zero to do it: a person watching 93% of a film written suddenly saw 5%, at the one moment they most needed to believe the editor was still working. The mark holds instead, and the re-run moves it on once it passes it -- which needed the copied-picture path to publish with `fetch_max` like everything else. With it, the rest of that same seam: * the audio pass is joined however `run` leaves, not detached. The mp4 path runs the sound beside the picture, and a picture that failed left that thread running: the re-run then started a second pass, so a machine that had just lost its GPU mixed the same film's sound twice at once. * a dead child is a *type* (`hwproc::Lost`) and not a phrase. `is_lost` commits an export to being written again from the first frame, and a substring match handed that decision to any future error whose wording happened to mention the child. * a wedged child is waited out by its own measure. The 15 s ceiling is what an encoder opening on a 4K frame may need, and it is also fifteen seconds an export spends on a child that will never answer again, before the software encoder it is owed can begin. Once a child has answered its first frames it has said what its frames cost, and eight times the slowest of them (never under two seconds) contains a wedge in two or three rather than fifteen -- while a slow open still gets the whole ceiling and is never killed for being slow. The editor is live throughout either way: the wait is on the export's own thread. * the countdown cannot be handed a rate below zero or a division by nothing: a bar that went backwards read as "~0:00 left" over six minutes of encoding, and the estimate is a guess, never a lie.
🐛 fix(engine): the seat a test cycles is one no other test is sitting inAhmet Kaan Gümüş · 88ce23e
🐛 fix(engine): the seat a test cycles is one no other test is sitting in The stand-in encoder seat was armed by a process-wide variable and read by `hw_seat`, so a software test that had already opened its own export picked it up mid-flight, met the hang injection, and stalled: `cargo test -p engine --test export` was green or five-failed depending on the interleaving. The progress reset the fallback does made it worse -- one cancel test hot-spins on progress reaching 1.0 and a regression there never ends. The seat is process state, so it is borrowed rather than assumed: the whole software suite shares a read guard, exactly as parallel as it always was, and the encoder-death family takes it exclusively, lifting the software encode pin only for its own exports and putting it back before it lets go. Which lets `hw_seat` go back to being production policy with no test flag in it. Also: a child that does not answer `vh_enc_dma_geometry` is now reaped there instead of costing the next picture a second whole timeout; the plugin's own note no longer claims the editor never loads the encode half, when what it never does is *call* it -- the availability check is a dlopen and opens no VA-API display; and the guard that refuses to write an export again in software when a person picked the GPU by name now has the test it was shipped without.
✨ feat(engine): the driver that aborts kills a process nobody was editing inAhmet Kaan Gümüş · c0a1847
✨ feat(engine): the driver that aborts kills a process nobody was editing in Mesa's radeonsi calls libc abort() from its own C worker thread when the video ring resets under it -- amdgpu_ctx_set_sw_reset_status, mesa 26.1.6, vcn_unified_0 hung during an AV1 encode submission on 2026-08-13. A foreign thread's abort is not an unwind, so every catch_unwind in the plugin was structurally unable to see it: the editor died with the driver and took the session's work with it. So the encoder is not in the editor's address space any more. HwEncoder is a handle on a `hw-encode-child` process that dlopens the plugin, and its death -- by abort, by any signal, or by going quiet past VE_HW_TIMEOUT_MS -- comes back as an error the export answers by writing the file again in software. A person who picked the GPU by name still gets the refusal in words rather than an encoder nobody chose. Isolation that cost the speed would not be worth having, so pictures do not travel down a pipe: in-memory ones go through a memfd mapped in both processes, and pictures still on the GPU never move at all -- their DRM-PRIME descriptors cross as file descriptors over SCM_RIGHTS, so the zero-copy export path stays zero-copy across the boundary. Measured on this box at 1080p: 430 fps in-process, 384 isolated, 89% of it, worst case (every export of an untouched clip takes the descriptor path instead). The proof does not need a wedged ring, which is the one thing a wedged machine cannot supply: VE_HW_TEST_FAKE opens a stand-in seat in the child and VE_HW_TEST_ABORT / VE_HW_TEST_HANG say where it dies or stops, so the containment paths are exercised on any machine, GPU or no GPU. Decode is still in the editor's process, where the same abort would still be fatal; the seam to move it is now the one this built.
✨ feat(engine): the words a project places are in the file it savesAhmet Kaan Gümüş · df4020f
✨ feat(engine): the words a project places are in the file it saves The `.edith` grows a `sub` line -- `sub <lane> <start> <frames> <track> <in> <out>` -- and a bare `sub <lane>` for a subtitle lane holding nothing, written in the lane's own place among the video and audio ones so the display order a load rebuilds is the one that was saved. Both of a caption's clocks are on the line: the placement in timeline frames like everything else, the window in the microseconds its cues are timed in. MAGIC is `edith 15`. `Project::without_orphan_sources` stops filtering the subtitle lanes out of its `Parts` and `Project::lane_gains` stops filtering them out of its gains -- the two are zipped by `edith::emit`, so they were only ever allowed to filter in step, and now neither does. What is *on* those lanes travels beside them in the new `Project::lane_subs`, one list per lane exactly as the gains are, and comes back through `Project::with_subs`, which is `from_parts` for words: it refuses a caption on a lane that is not a subtitle lane, an empty span or window, a track the palette does not have, a span past the last frame there is, and a lane that overlaps itself. The parser refuses the same file by line number. A v14 project is one that named subtitle files and could place none of them: it loads with its palette whole and no subtitle lane at all, which is what it always meant, and re-saves as v15 having invented neither. Also fixes a version-bump straggler in tests/silence.rs, which asserted `edith 13` against a `edith 14` writer and was red before this change.
✨ feat(app): the seat that writes the picture is picked on the card, not by an env pinAhmet Kaan Gümüş · 50af5b5
✨ feat(app): the seat that writes the picture is picked on the card, not by an env pin The export card gains an Encoder row: Auto, Hardware or Software, three rows in a list like every other setting with more than two values -- `e` steps it, a click opens the list, and the planned line under the rows re-probes and says which seat it measured. Auto is what every export did before (the GPU where there is one). Hardware is the GPU or a refusal in words -- `Enc::open` refuses before the muxer exists, so nothing is written -- and it is now the only door to the plugin's AV1 seat, which `VE_HW_AV1=1` used to guard: an env pin nobody exporting a film would ever find. A person who picks it for AV1 gets a plain row naming what happened on this box's driver, and the pick still stands. Software forces the CPU encoder, which also takes the zero-copy path off the table by construction (`Enc::dma_want` answers only for the two hardware seats). Kept with the project: `.edith` gains an `encoder` line at v14, written only when it is not Auto, and a v13 file loads as Auto. - engine: `ExportSettings::force_sw` -> `seat: EncoderSeat`; `hw_seat` returns the refusal instead of falling back; `planned_video` says `NO_HW_SEAT` where it would - app: `Pick::Encoder`/`Choice::Encoder`, card row, `e` in the card's own keyboard and in the keys menu (`FIXED`) - tests: the backends sweep runs all three seats (the AV1 hardware seat excepted, as before), and asserts the refusal is only what a missing seat produces
✨ feat(app): the stand-ins are made when a project asks, not whenever a big film arrivesAhmet Kaan Gümüş · 269b0c2
✨ feat(app): the stand-ins are made when a project asks, not whenever a big film arrives A project now says whether an import makes a proxy by itself. On is the default and the line left out, so every project that came before behaves exactly as it did; off makes nothing at all, and turning Proxies on is what asks for the ones the project is missing -- the only ask there is, since no per-source item exists. The file grows an `autoproxy` line and the version goes to 13: a v12 project makes them by itself, which is all any project could do. The switch is a button beside Proxies in the PROJECT panel, ctrl+o, and a row on the actions card -- the three doors together, as the two sync tests require.
🧪 test(engine): the hardware proxy is decoded, not just countedAhmet Kaan Gümüş · 79f2bac
🧪 test(engine): the hardware proxy is decoded, not just counted `a_hardware_proxy_is_every_frame_a_starting_point_too` counted `demux::sync_points` and never read a picture, so it stayed green through 150 of 150 access units no decoder would accept. It now decodes every picture back through the engine, refuses an empty one, and lets ffmpeg read the file with `-v error` and say nothing.
2026-08-13
🐛 fix(engine): "no picture in it" is a header's answer, not an extension's guessAhmet Kaan Gümüş · 627d623
🐛 fix(engine): "no picture in it" is a header's answer, not an extension's guess Two residuals of the proxy round, and the doc line that makes a hardware run measure the code it was meant to. The quiet answer for a file that is not a film was name-shaped: an audio-only `.mp4`, `.mkv` or `.mov` is a video container with no video track in it, so no extension can tell and every one of them still opened, failed and said "NO PROXY" about a song. Only the header knows, and the demuxer already knew -- it just said so in prose, which is the one thing in this engine free to be reworded. `NoVideoTrack` makes it a type: the two doors that mean *this file carries no picture at all* return it, a front-end still shows the sentence it always showed, and the proxy takes it as the same silent `None` a 1080p film gets. A picture in a codec nothing here decodes is not that class and stays loud. ...and the cap was soft by exactly what it was capping: the sweep aimed at 20 GB and then two encodes wrote gigabytes on top of it, so the disk held the cap plus a film per encode (~43 GB worst case). It now sweeps to `CACHE_CAP - reserve`, where the reserve is what those encodes will really take -- the file's own bits-per-pixel arithmetic times the 1.25 the hardware seat overshoots its asked-for rate by -- held to half the cap so a single 4K feature cannot empty the cache to make room for itself. `AT_ONCE` moves into the engine beside that arithmetic: how many encodes run at once *is* how much room the sweep must leave, and two places holding that number is one place for them to disagree. The ignored hardware tests now say to build `-p engine-hw --release` as its own step: `--tests` does not rebuild the cdylib, so the plugin beside the test binary is whatever was there last time -- and a hardware claim measured against a stale one is a claim about code nobody edited. One commit rather than two: both fixes are in `proxy.rs`, in regions a hunk split cannot separate cleanly (it was tried once and produced a corrupt intermediate), so each is named here instead.
🐛 fix(engine): the GPU's stand-in was one starting point long, not every frameAhmet Kaan Gümüş · 60ae56c
🐛 fix(engine): the GPU's stand-in was one starting point long, not every frame A proxy asked the ordinary hardware seat for a key frame on every picture, which is not the same thing as an intra-only file and does not make one: cros-codecs' low-delay predictor takes the keyframe branch with `idr` false for a forced key frame, writes no SPS or PPS with it, and `fix_slice_nal_headers` -- which reads the parameter sets to know what a slice is -- then marks it a plain I slice. A 60-picture hardware proxy came back with **one** frame a decoder could start on, so its seeks were the film's own seeks and the whole point of it was gone. Software was right all along (150 of 150), which is what hid it. The thing that decides this is the predictor's group limit, and a group of one picture is what an intra seat is: the counter is then pinned at zero, every picture takes the keyframe branch as an IDR, and every access unit carries its own parameter sets. That is the HEVC seat's own mechanism, now the H.264 one's as well. Its own plugin symbol (`vh_enc_open_intra`) rather than a flag on the existing one, matching the AV1 and HEVC seats: a plugin built before it exists has no intra seat, and the caller then takes the software encoder -- which codes one frame a GOP and writes what was asked for -- instead of being handed a long-GOP file under a name that promises otherwise. `intra_only` on anything but the mp4 pair is now refused by name. Checked without a GPU: the group limit and the IDR-marking rule are both unit tests in the plugin. The hardware end-to-end twin (`sync_points` == frame count) is written and `#[ignore]`d, for a machine whose GPU is not wedged.
✨ feat(engine): the picture may come off the stand-in, the delivery never doesAhmet Kaan Gümüş · 79c69dd
✨ feat(engine): the picture may come off the stand-in, the delivery never does One switch for the project, saved with it as the v12 `proxy` line, and one place that reads it: the span open asks `picture_path`, which hands back the stand-in where the cache has one and the film itself everywhere else. The sound is opened elsewhere and is always the film's; `export` reads the project's own sources and knows nothing of proxies, so a delivery cannot come off one -- and both sides now say out loud which file they read (`export source:` / `picture: proxy`), so that is a grep rather than a belief. *Which* films have a stand-in is deliberately not saved: a proxy is found by the film's own path, length and modification time, so the cache is the single answer and a project file cannot go stale about it. A v11 project loads unchanged and is cut on its films, which is all it could ever do.
✨ feat(engine): a big film gets a small stand-in to cut withAhmet Kaan Gümüş · 83e561d
✨ feat(engine): a big film gets a small stand-in to cut with A proxy is the film at 1280 on its long edge, every frame an IDR, no sound in it at all: a seek lands on the frame asked for instead of on the nearest one a decoder can start from, and the mix stays the original's. Generation is the export walk given a one-clip project and a smaller canvas, so the hardware seat, the progress and the cancel are the ones a file export already had. Two switches were wanted for it: `intra_only` (one frame a GOP on the H.264 pair) and `keep_source_colour`, which carries the film's own space into the stand-in instead of converting it -- that conversion ran on the source's full 4K, cost 48 ms a frame and was the whole of a proxy's price, and leaving it to the screen means the tone-map preset can still be changed after the stand-in was made. The cache is keyed on the source's path, length and modification time, so a re-encoded original misses rather than reading a stale stand-in. A 4K HDR film: 2.35x realtime on the VA-API seat, against 0.59x before the colour switch; a cancel leaves neither the file nor its .part.
2026-08-11
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads itAhmet Kaan Gümüş · 070ffe6
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads it Three tiers, per field: the container's own tags (Matroska `Colour`, mp4 `colr`), then the bitstream's (H.264/HEVC SPS VUI, AV1 `color_config`), then the ffmpeg/mpv resolution rule -- 720 lines or taller is BT.709, below it BT.601, limited either way. A code that says nothing, or says something with no implementation here, falls to the next tier rather than answering wrongly. `VideoMeta` carries the answer; nothing consumes it yet. Everything still renders through the hardcoded BT.601 it always did, which is the bug this is the foundation for fixing. The bit-level walks are where this can quietly go wrong: an SPS whose scaling lists are counted wrongly lands the VUI read in the middle of a coefficient. Both are measured -- H.264 and HEVC against hand-built parameter sets (no encoder here writes SPS scaling lists), the rest against fixtures tagged in the container, tagged only in the bitstream, and tagged nowhere, plus the two real films: a 4K HDR remux that reads BT.2020/PQ and a fully untagged 720p one that reads BT.709.
🧹 test(scratch): a fixture directory is deleted by the test that made itAhmet Kaan Gümüş · 5c39124
🧹 test(scratch): a fixture directory is deleted by the test that made it Every suite here made its own directory under /tmp with a name and a process id and then walked away from it: 2907 `ve_*` directories, 6.4G of a 16G tmpfs, none of them reclaimable by anything but a person with `rm`. `engine::scratch::Scratch` is the one place a throwaway path comes from now -- a directory, or the single file inside one -- and `Drop` is what takes it back. That is the whole reason it is a guard rather than a cleanup call at the end of a test: unwinding runs `Drop`, so the *failing* tests, which are exactly the ones that used to leave the most behind, clean up like the passing ones. It derefs to a `Path`, so the call sites did not have to change: the helpers that handed back a `PathBuf` hand back one of these. The prefixes stay what they were, so a directory is still recognisable while a test is stopped in it. Nothing about what a test *does* moved -- only where its fixtures live and when they die. Driven: the whole engine suite and the app's own tests run with the count of `/tmp/ve_*` before equal to the count after.
2026-08-10
✨ 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(engine): project resolution stands apart from media resolutionAhmet Kaan Gümüş · 19e294a
✨ feat(engine): project resolution stands apart from media resolution A timeline had one resolution because its first source did: import refused anything else by name, and there was nowhere to say otherwise. A project now carries its own picture size and every clip is composed onto it, so media of different resolutions share a timeline the way they do in any editor. * scale::Composer is the one definition of that composition -- fit_rect, scale_i420, compose_i420 onto a black canvas -- and both playback and export call it, so what is written is what was watched. A canvas of the picture's own size is a pass-through that allocates nothing and touches no byte. * Grade first, place second: a grade belongs to the clip's pixels at the resolution they were shot at, and the letterbox bars are not the clip. * Per-clip fit policy (fit/fill/stretch/centre), one byte inline in Clip -- it lands in padding the clip already had. * .edith v7: a `resolution <w> <h>` line and a fit word per clip line. v6..v1 still load, defaulting to source 0's picture and Fit, which is what those projects always meant. * The fps refusal stays: mixing frame rates is resampling the timeline, a different problem, and a refusal is the honest answer until it is solved. * UI: `p` cycles the fit policy of the clip on screen (and a clip-menu item), ctrl+r cycles the project resolution through the usual sizes with the media's own among them, and the export card says which size it writes.
✨ feat(timeline): every lane draws and tracks can be addedAhmet Kaan Gümüş · 30e8aae
✨ feat(timeline): every lane draws and tracks can be added The panel drew V1 and A1 and nothing else, so the N-lane model, the composite playback and the v6 format had no way into the window. It now draws a row per project lane, labelled from Lane::label, and grows the panel per row up to a cap past which the lane column scrolls. + V / + A -- and the v / a chords, in the registry so the keys menu lists them -- add a track; undo takes one back like any other edit. The V1/A1 pinning the last two slices flagged is gone: delete_clip takes the lane its index belongs to (Project::delete_in), a drop names the lane it was let go over (place_stream_at's onto), and whole_take decides ripple-or-lift per lane -- a clip on an added track is a layer and is lifted, while the first pair keeps exactly the semantics it had. Project::paste now inserts into V1/A1 only while still opening room everywhere, or an Add with three lanes would have played one sound twice. The export card greys MP4 out with its reason when more than one audio lane carries sound, on the row and on the m chord both, so the engine's refusal arrives before a destination is picked.
✨ feat(engine): per-clip color persists in .edith v6Ahmet Kaan Gümüş · 0530fc9
✨ feat(engine): per-clip color persists in .edith v6 A clip names a colour grade the way it names an equalizer: an index into an append-only Project table, deduped on set, pruned at save, inherited by both halves of a split and carried by copy, paste and undo. The file format grows a color <b>:<c>:<s>:<t> line and a 7th clip field; v5..v1 still load and every one of them re-saves as v6. Clip grew from 32 to 40 bytes -- the eq index fit the padding hole, the colour one did not.
✨ feat(engine): per-clip EQ persists in .edith v5Ahmet Kaan Gümüş · 782fc53
✨ feat(engine): per-clip EQ persists in .edith v5
A clip names its equalizer by index into a project-level table, the way it
already names its source: `Clip` stays `Copy`, so a split hands both halves the
same settings, a clipboard copy carries them and an undo restores whichever
index the clip had. The table is append-only within a session -- an index on a
clipboard clip or in an undo snapshot can never dangle -- and only a save prunes
it, exactly as an undone import leaves its source entry behind.
The file grows `eq <band>...` lines (freq:gain:q:shape, printed `{:?}` so every
f32 comes back bit for bit) and one more clip field naming one of them. v4, v3,
v2 and v1 still load and re-save as v5.♻️ refactor(engine): the project holds N lanes, V1..Vn and A1..AnAhmet Kaan Gümüş · b474a9b
♻️ refactor(engine): the project holds N lanes, V1..Vn and A1..An Merge of the multi-lane winner (candidate B) onto the S5a main, plus the three grafts the judge picked out of candidate A and the delete-selected fix it flagged: * LaneData::two_lanes(), one place for the pair single() and from_parts() both build; * a_group_may_span_any_lane: hand-built lanes driving links_are_consistent directly -- one take on V1 + A2 with the lanes between it empty is legal, and both ways to break the rule are asserted by their exact message; * add_lane doc: an empty new lane is legal even though from_parts refuses an all-empty project -- the lanes that were there still hold the timeline; * delete_selected is exhaustive over lane.kind and explicit about ord: it hands V1/A1 indexes to engine calls that mean V1/A1, so a second-lane selection would have deleted a different clip under a _ => false wildcard. Conflicts, all against the S5a Source model: without_orphan_sources keeps B's crate::Result and its >1-lane-per-kind refusal but returns Vec<Source>, and Lane::Audio in place_stream_at/import_audio became Lane::A1.
♻️ refactor(engine): the project holds N lanes, V1..Vn and A1..AnAhmet Kaan Gümüş · 154fd69
♻️ refactor(engine): the project holds N lanes, V1..Vn and A1..An
The edit list was a fixed pair -- `Lane` {Video, Audio}, `lanes: [Vec<Clip>; 2]`
and seven hundred lines of methods walking that pair by hand. Multi-lane UI,
per-lane compositing and per-clip EQ all want lanes to be a list, so make them
one now, while the model is small enough to change in one sitting.
`Lane` becomes a handle -- a `LaneKind` plus a 0-based `ord`, so `Lane::V1` is
the first video lane and `Lane::new(Audio, 1)` is A2 -- and the project stores
`Vec<LaneData>`, a struct that per-lane state (mute, compositing mode, a name)
can grow into. A handle naming a lane that is not there reads as an empty lane
and refuses every mutation, so a front-end that only ever asks for V1/A1 needs
no bounds check of its own. Every method is a walk over the lane list now
instead of two hand-written cases.
The grouping rule generalises rather than pairing lanes off: a link id names at
most one clip per lane and every clip carrying it covers the same span, on
however many lanes. So a split hands out one id per group of lanes whose halves
line up -- one helper, used by split and regroup alike.
Playback, export and the audio worker still read V1 and A1: compositing is its
own slice. So is the file format, which holds one lane keyword per kind, so a
save of more than two lanes is refused by name instead of silently dropping
one; a two-lane project writes exactly the bytes it always did.✨ feat(library): every audio stream is a row, and the picked one plays and exportsAhmet Kaan Gümüş · ecb5e06
✨ feat(library): every audio stream is a row, and the picked one plays and exports A file with one audio track per language is one row per track now, not one row per file. The engine carries the pick end to end: a source is a (file, audio stream) pair, .edith v3 writes the stream on the source line, playback opens it and — the trap this closes — the export copies *that* stream's packets rather than always stream 0. Streams that cannot go on the timeline are listed greyed with the reason instead of hidden: a codec we cannot read, or a rate/layout that cannot share one output device and one copied AAC track with the rest of the timeline (there is no resampler here and no AAC encoder to write a join with). place_stream_at is the one door a row goes through, and it refuses those in the engine's own words. - v2 and v1 files still load: no stream field means stream 0, which is all those dialects could play; saving either writes v3. - Waveform peaks are keyed by file *and* stream, so two tracks of one file cannot draw each other's envelope. - Library swatches and clip tints follow the *file*, so a file's streams share one colour in the panel and on the lanes. - assets/test_multilang.mp4: two AAC 44.1k stereo streams (und, fra), the shape real multi-language media has and the one where a second stream is placeable.
🐛 fix(engine): group ids only where the lanes agree, priming for a leading gapAhmet Kaan Gümüş · 07cd3d3
🐛 fix(engine): group ids only where the lanes agree, priming for a leading gap Two states the verifier panel reached that saved but would not load again. `split` and `regroup` handed one fresh id to whichever clip each lane had at that frame, but the lanes are edited apart: the clip being cut may start or end somewhere else in the other lane, and a group id whose two clips disagree about their span is not one take. Each side of the cut now asks the question separately, so the halves that do line up stay one take and the ones that do not get ids of their own. The exported audio of a timeline that opens on a hole played every sound after the hole 23 ms early: a reader drops the first packet of an AAC track as priming, and with no packet to spare that drop came out of the hole. The gap at the head now carries one extra silent packet, which owes the rounding debt nothing. Tests: both panel repros, a seeded random-op sweep that reloads the project after every edit, and the leading-gap onset measured off the exported file (44032 of an expected 44100; 43008 without the packet).
✨ feat(engine): real silent AAC for export gaps, link + overflow guardsAhmet Kaan Gümüş · 301e29b
✨ feat(engine): real silent AAC for export gaps, link + overflow guards Grafts the losing candidate's hand-written AAC-LC silence into the offset-placed lanes: a gap in the audio lane is copied as max_sfb=0 access units (4 bytes mono, 7 stereo, verified against our own decoder) instead of being spent as stts duration on the packet in front of it. That retires the 23 ms leading-gap misplacement, so every packet is one 1024-frame sample table entry again and the muxer takes no duration. from_parts becomes the release-active untrusted door it claims to be: per-cause errors, an end-overflow bound, and the grouping rules -- a link id names at most one clip per lane, and a pair covers one span. The parser bounds the same overflow by line number, `place` strips the incoming group id, and the two lane surgeries (`clear`, `open_room`) drop the id from what they cut, which is where duplicates came from.
✨ feat(engine): video+audio lanes with offset-placed clips, gaps, .edith v2Ahmet Kaan Gümüş · 59eb78e
✨ feat(engine): video+audio lanes with offset-placed clips, gaps, .edith v2 Project gains two lanes; a Clip now carries `start` (its timeline placement) and `link` (group id), so a gap is simply the absence of a placement rather than an object anyone has to keep in sync. Moves and trims become arithmetic on start/in_frame; the lane invariant (sorted, non-overlapping) is checked in from_parts, at the .edith parser, and asserted after every mutation. split cuts every lane and hands the two sides fresh group ids; regroup is its exact inverse. delete still ripples both lanes (the app keeps its behaviour), lift removes one placement and leaves a hole, place is the per-lane overwrite that can make one. A video gap plays as black frames from a worker that opens no file -- same channel, backpressure, cancel and retire path as a decoder -- and exports as encoded black. An audio gap is synthesised zero chunks, real ones, so the master clock keeps counting through it; on the export side it is spent as stts duration on the packet beside it, since there is no AAC encoder to make silence with. .edith v2 writes one line per placement per lane; v1 files still load, as fully-grouped gapless lanes, and save as v2.
2026-08-09
✨ feat(export): ExportSettings for bitrate and software-encoder pinAhmet Kaan Gümüş · 2c9c3a2Browse files
✨ 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.
🐛 fix(export): late-cancel window + atomic .part renameAhmet Kaan Gümüş · f973b71
🐛 fix(export): late-cancel window + atomic .part rename Cancel was only checked inside the per-clip frame loop, so an esc during the drain, the audio pass or `finish` completed the export anyway and left a file the user had asked not to have. Cancel is now checked after the loop and again before `finish`. The worker also writes to `<out>.part` and renames it onto the output only on full success, so the output name never points at a half-written file -- and a killed process orphans a `.part` instead of a playable-looking `.export.mp4`.
✨ 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.