Commits
Commits on
fbc29d12fa2e194b105dd2344342fc50da4e90cdFiltered to crates/engine/tests/audio_export.rsClear filter2026-09-24
probe(demux): sample aspect ratio off the container, coded dims beside the display pairAhmet Kaan Gümüş · 66a1c40
probe(demux): sample aspect ratio off the container, coded dims beside the display pair ffmpeg's model: the decoder keeps coded pixels and carries the SAR as metadata. VideoMeta carries the pair now: coded_width/coded_height are what the samples are stored at, pixel_aspect is the ratio one coded pixel is drawn at (PixelAspect, square when nothing is stated), and width/height stay the displayed shape their docs always promised -- stretched by the aspect, then swapped by the turn, in that order. mkv: DisplayWidth/DisplayHeight/DisplayUnit read off the Video element (units 3 DAR and 4 SAR; absent, or units 0/1/2, square -- measured against ffmpeg 8.1.2, which writes a 16/9 DAR pair with unit 3 for a setsar=4/3 source and nothing at all for a square one). mp4: pasp (hSpacing/vSpacing) out of the visual sample entry, behind the same fixed 78-byte header colr and hvcC sit behind, absent = square -- measured: ffmpeg writes pasp 4/3 for setsar=4/3 and 1/1 otherwise. VhMeta's twin fields ride along so the plugin ABI can carry the same answer once a display size differs from the coded one.
2026-09-18
🐛 fix(media): audio routing, session audio re-arm, hw trailing-zero NALs, display-matrix rotationAhmet Kaan Gümüş · bc8b82e
🐛 fix(media): audio routing, session audio re-arm, hw trailing-zero NALs, display-matrix rotation - is_audio admits .mpeg/.mpg so mp3-with-cover files import (was fed to Mp4Demuxer) - session audio walks past trackless leading sources and re-arms when a sounding file joins a silent timeline (fixes add/remove/add silence) - engine-hw pump clears trailing cabac_zero_word bytes instead of dying with code -2; export falls back to software decode before first frame - tkhd display matrix read for mp4; 90/180/270 turns baked into preview and export pixels; other angles refused by name (UnsupportedRotation)
2026-09-15
✨ feat(audio): stable envelope height, full hue/sat, strands and glowAhmet Kaan Gümüş · 7ebfc44
✨ feat(audio): stable envelope height, full hue/sat, strands and glow The 2s window no longer rescales to its own peak, so a bump keeps its height as it enters and leaves. Colour is a 64-stop hue bar plus sat (white→full). Strands and glow go from one line to the dense ring. Packed on Clip.viz_paint; dialect v22.
2026-09-14
✨ feat(audio): waveform styles, any soundtrack, keys search, group on the clip menuAhmet Kaan Gümüş · dfcec06
✨ feat(audio): waveform styles, any soundtrack, keys search, group on the clip menu Visualizer is no longer wav-only: h on a video clip with sound paints that file's soundtrack. Style bits live on the clip (outline, smooth, fast, colour) and toggle from CLIP. `?` type-to-filters the keys list. Group / Ungroup / Regroup are clip-menu rows, not chords-only.
2026-09-13
🔁 feat(audio): the MP3 and Vorbis encode seats are the native ec-mp3 / ec-vorbisAhmet Kaan Gümüş · f68f46d
🔁 feat(audio): the MP3 and Vorbis encode seats are the native ec-mp3 / ec-vorbis The two registry-crate encoder seats (rusty_mp3 0.6, rusty_vorbis 0.1.1) leave the tree; both formats encode through the codec family's own crates (path deps, same boundary ec-opus/ec-ac3 already cross). MP3 (CBR per the card's rate rows): same seat contract, same Mp3EncoderConfig field names, call sites unchanged. A/B on identical 16-bit PCM (suite fixtures + a 30 s 44.1 kHz stereo music decode), outputs decoded through symphonia: correlation 0.9994-0.9998 against the incumbent's 0.9980-0.9991 at the same 192 kbps, PSNR +5..+7 dB, and the decoded length lands exactly on the mix (the old seat ran 180 samples long with a 1057-sample shift the gapless tag only partly hid). Vorbis: the seat's quality knob alone saturates below the incumbent's operating band, so write_ogg drives the encoder the way its own rate gates are measured -- rate loop started at quality 0.85 and held to a 128 kbps target. At the incumbent's own 0.85 operating point (123.8 kbps actual on the music clip, correlation 0.9947) the new seat reads 129.0 kbps actual at correlation 0.9968, +3.1 dB PSNR; against ffmpeg's libvorbis -q 5 it is par at the same rate (0.9968 vs 0.9973). Every export decodes to exactly the timeline's frame count, correlation peak at lag zero. That measurement retires write_ogg's workaround: the old seat advanced its granule a hop early and overran the tail, so the function carried a 1024-sample pre-roll and two granule corrections around it. ec-vorbis reports spec granules and clamps its final one to the sample count fed, so the pre-roll, the per-packet shift and the manual tail declaration are deleted. Mono stays dual mono (bit-identical L/R, worst |L-R| = 0 measured) because the format row promises stereo, not because the encoder refuses mono as the old seat's did. Perf, named: MP3 encode wall is 0.05x the old seat on the 30 s clip (4.3 s vs 0.20 s CBR; the old shim encoded blocks across all cores, the new seat is single-threaded sequential) -- the price of the quality and gapless-exactness above; Vorbis at the seat's operating point is 1.4x faster than the old seat (49 ms vs 69 ms per 30 s). audio_export and backends suites green (14 + 8), export lib tests green, cargo check -p engine --all-targets zero warnings; lock carries no rusty_mp3/rusty_vorbis stanza.
2026-08-20
✨ 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
🐛 fix(engine): fades reach exported and played-back audioAhmet Kaan Gümüş · 9ec26f6
🐛 fix(engine): fades reach exported and played-back audio Two bugs: `forces_encode` never checked a clip's own fade, so the default Web MP4 copy path silently dropped fades from the exported AAC track. Worse, `Fade`'s frame counts are timeline (fps) frames but `Fade::apply` multiplies audio-rate sample blocks; unconverted, a fade's threshold was crossed a few milliseconds into any clip, so a fade-out muted the rest of the segment outright and a fade-in finished before an ear (or a 100ms RMS window) could catch it. `Fade::scaled` now re-counts a fade at the mix's own sample rate the moment the audio session learns it, which also fixes the same bug in live preview.
✨ 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.
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.
✨ feat(export): OGG Vorbis is a row you can pick, not a note about missing encodersAhmet Kaan Gümüş · 17d7d99
✨ feat(export): OGG Vorbis is a row you can pick, not a note about missing encoders The export card said "no pure-Rust Vorbis or Opus encoder" and that had stopped being true. `rusty_vorbis` 0.1.1 (Apache-2.0, zero dependencies, same family as the h264/aac/mp3 encoders already here) is the first permissively-licensed pure-Rust Vorbis *encoder*; `oxideav-ogg` 0.1.8 pages it, and its only dependency is the `oxideav-core` the AC-3 decoder already pulls in. No C, no FFI, no new runtime system dependency -- `ldd` on the binary is unchanged, name for name. The row is live, keyed `o`, and names its encoder like every other live row does. VP9 stays refused with the reason it always had: AV1 replaces it. What the bench found, and what the code does about it. Every number below was measured by encoding this suite's own fixtures and decoding them back with symphonia -- an independent decoder, and the one this engine reopens exports with: * The encoder numbers its granules a full block ahead of the samples it codes, so written straight through, every sample lands ~1024 early: a marker signal came back with its head at 36% amplitude and a full-scale burst 1500 samples before the real one, in silence. One hop of silent pre-roll puts it back -- head 0.86 against an input peak of 0.80, the phantom burst down to 0.04. * Its block grid overshoots the last sample, so the stream is padded and the last page's granule declares the timeline's own frame count. An `.ogg` is now exactly as long as the WAV of the same timeline, which is the promise every other audio row here keeps. * Below quality 0.50 the encoder is *quiet*, not merely coarse (1-1.6 dB of level error, near-silence at 0.10), and the whole usable band tops out around 200 kbps. So the file is written at one measured quality, 0.85, and the Sound row is refused by name rather than mapping 128/192/256/320 onto quality steps: the top two are rates this encoder cannot reach, and a card that printed them would be lying. * The embedded setup header is a stereo profile -- a mono push is refused outright -- so a mono mix is written as dual mono, both channels bit-identical. And one defect the round trip turned up on the way in: `SymTrack` subtracted `Track::delay` on top of symphonia, which already drops those frames itself. Every `.mp3` import was losing its first 1105 samples (25 ms) and reading 25 ms short, every `.ogg` its first 128. Measured against `test_tone.flac` -- lossless, and the only one of the three declaring no delay -- which the mp3 and the ogg of the same tone now align with. WAV, FLAC and AAC-in-mp4 read hash-identical across the change; only those two formats move, and both move to the length their own container declares.
🔀 merge: origin/main into E1, and the Sound row becomes a choice listAhmet Kaan Gümüş · 3992bff
🔀 merge: origin/main into E1, and the Sound row becomes a choice list Conflicts were the three the coordinator called: keymap's FIXED count (union of my `b` and C5's 26, so 27), the tests' use-list in main.rs (theirs plus AUDIO_KBPS, DEFAULT_AUDIO_KBPS, next_audio_kbps) and two tests added at the same line of audio_export.rs (both kept). Four rates is one more than a button may be clicked round, so the Sound row opens C2's picker (`Pick::AudioRate` over `AUDIO_KBPS`, rows naming what each rate buys) instead of stepping under the pointer. `b` still steps, the way ctrl+r still steps the resolution the same list offers -- and a list open over the card is what the first stroke closes, so escape cannot take the card out from under it.
🔀 merge(A5): main (de15818) into the import-policy branchAhmet Kaan Gümüş · d17f345
🔀 merge(A5): main (de15818) into the import-policy branch The rate gate main landed (`Rate`) and this branch's codec gate removal are the same function: `matches_timeline` keeps main's `Rate` return and loses the codec equality, with the decoder probe in its place. The refusal tests that named a rate or a silence now name the one thing left -- one output device, one rate and one layout.
✨ feat(export): the sound has a bitrate you pick, in every file that codes oneAhmet Kaan Gümüş · 2169fb8
✨ feat(export): the sound has a bitrate you pick, in every file that codes one The rate was 256 kbps in two places nobody could reach: the AAC a video export re-encodes and the MP3 the audio row writes. Both now take `ExportSettings::audio_kbps` -- 128, 192, 256 or 320 -- and `None` is still 256, so an export nobody touched writes the bytes it always did. The card grows a Sound row on `b`, cycling like the container row. It dims with the reason where there is no rate to pick: no sound on the timeline, a lossless format (WAV, FLAC code samples and not a rate), or an AAC track that is copied packet for packet and carries its source's. The MP3 quality refusal stopped claiming a fixed 256 kbps, since the Sound row can now change it under the summary. Probed rather than promised: an mp3's frame headers declare 128/256/320 as asked, and an mp4's AAC track measures within a fifth of the request.
✨ feat(import): mixed codecs and silent takes join the timelineAhmet Kaan Gümüş · 9bc3bd4
✨ feat(import): mixed codecs and silent takes join the timeline The two refusals a user hits for no reason are gone: a file coded differently opens its own decoder like every clip already does, and a file with no audio track contributes silence over its span like a gap already does. What the codec gate was really protecting against stays, moved to the one place that can answer it: import asks the file for a decoder, so a machine without the VA-API plugin refuses an HEVC take by the decoder's own name rather than playing black frames with the complaint on stderr. Rate and layout stay refused -- there is no resampler. Both audio paths now read a source with no track as the silence they already synthesise for a hole: the worker plays it, the packet copy writes it, so an mp4 export of a timeline with a silent take is as long as the timeline and quiet where the take is.
✨ 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.
✨ feat(export): every video format carries sound, AV1 picks its box, MP3 is a rowAhmet Kaan Gümüş · 5ebd3ac
✨ feat(export): every video format carries sound, AV1 picks its box, MP3 is a row Three asks, one seam — the export's audio path was a packet copy, and everything it could not copy was a refusal. - MkvMuxer gains an A_AAC track (CodecPrivate = AudioSpecificConfig, CodecDelay one packet) and interleaves it into the clusters: an AV1 export carries the timeline's sound instead of naming it as left out. - Mp4Muxer::create_av1 writes AV1 into an mp4 — the `av01` + `av1C` sample entry `mp4 0.14` cannot spell is patched into the finished moov (layout cribbed from OxideAV's oxideav-mp4, MIT); Mp4Demuxer reads that entry back. - Format::Mp3 through `rusty_mp3` at 256 kbps CBR, and Format::Av1Mp4 beside Format::Av1: the export card has a row and a key for each. - copy_audio lifts every "cannot copy" refusal into a route to encode_audio — a second audio lane, a speeded clip, a Matroska source, an mp3 or a png timeline. A copy nothing forces stays a bit-exact copy. Round trips per container, through this project's own readers: mkv + mp4 AV1 with a tone (mux unit tests), an AV1 export in either box (tests/av1.rs), a still under a song as an mp4 with sound and an MP3 of the timeline (tests/audio_export.rs), two lanes summed into an mp4 (tests/lanes.rs), a speeded lane resampled into one (tests/speed.rs).
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(audio): AC3 tracks decode with a built-in stereo downmixAhmet Kaan Gümüş · 8c7bf80Browse files
✨ 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(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.