forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 3fc675351f2b4381bbb62e7fdff9d3e26a21603eFiltered to crates/engine/src/export.rsClear filter

2026-08-12

⚡ fix(export): the sound of a feature film is measured in a minute, not in half an hourAhmet Kaan Gümüş · 3fc6753
⚡ fix(export): the sound of a feature film is measured in a minute, not in half an hour

An mkv export of a two-and-a-half-hour film wrote zero bytes for twenty-one
minutes and then failed its own test's ten-minute cap. All of it was the Opus
fidelity gate: `ruopus` is built here without its `spectrograms` feature, so its
inverse MDCT is an O(n²) DFT with a `sin_cos` per term and decodes at 0.2x real
time. Measured on a two-minute window of a real 4K film (the new
`export_audio_cost` example, and the three `export audio:` lines it reads):

    mix (E-AC-3 5.1 -> stereo)   0.7 s
    Opus encode (opus-rs)        0.3 s
    fidelity decode-back        24.2 s   <- 98.6% of the pass

So the gate now samples: twelve five-second windows spread across the track, a
warm-up per window because CELT predicts across frames, and the *worst* window
is the answer -- which is harsher than the old whole-track sum, where a ruined
minute averaged away against two good hours. What it looks for survives
sampling: OPUS_MAX_KBPS's cliff is a rate the encoder falls off, not a defect of
one bar of music. A window with no sound in it is skipped rather than scored
0.0, which is what a silent timeline used to score before falling back to AAC.

...and the export no longer decides what it is *after* paying for the sound:
CopyPlan is consulted first, so the line on screen says "copy" from the first
second, and the audio pass owns the head of the progress bar instead of leaving
it at zero for as long as it runs.

Beside them, for the card that has been predicting the wrong export in both
directions: `planned_seats` asks the export's own gates what it would open, and
`sync_points` hands a front-end the frames a cut may be placed on.

    cargo test -p engine --release --test video_copy -- --include-ignored
      7 passed in 157.6 s (was: failing the 600 s cap)
🔀 fix(export): a copied picture names the sound it was really written withAhmet Kaan Gümüş · 64cb44f
🔀 fix(export): a copied picture names the sound it was really written with

The copy path and the Opus seat landed in the same function from two lanes and
published two different sentences. The encoder path already names the codec the
mix was *measured* to have taken; the copy path was still handing the card the
same prediction the card shows before an export starts -- so an mkv whose mix
fell back to AAC would have run under a line saying Opus, on precisely the
exports that are over in a few seconds.

Both branches now read the one flag `copy_audio` came back with. The check is
the seam itself: an untouched HEVC timeline (copied block for block) with a 5.1
Opus source folded onto its audio lane (encoded), asserting the published line
is "copy · Opus · SW encode (opus-rs)" and that the file carries A_OPUS and no
A_AAC.
✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusingAhmet Kaan Gümüş · c94ba8b
✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusing

An 8-channel Opus track came back "IMPORT FAILED: unsupported channel
layout: 8 channels (max stereo)" and took the picture with it, and a
48 kHz file "audio 48000 Hz 2 ch does not match the timeline's 44100 Hz
2 ch". Both strings are gone: an import converts.

Width: `fold_5_1` becomes `downmix`, a coefficient table per layout from
2.1 to 7.1 (ITU-R BS.775 — front channels keep their side, centre and
surrounds join at -3 dB, LFE dropped, both sides normalised by their own
coefficient sum so a full-scale source cannot clip). 5.1 comes out of the
table bit-identical to what it was. `vorbis_to_film_order` gains the RFC
7845 permutations for 3, 5, 7 and 8 channels beside the 6 it had, so
surround Opus at any width reaches the fold in the order the fold reads.
The AC-3 decoder's own 2.1 passthrough, which it leaves at 3, folds here
too, and a multichannel AAC track in an *mp4* now takes the `rusty_aac`
route the Matroska side already had (`aac_decoder`, one call for both).

Rate: the segment resampler a speeded clip already goes through takes the
source rate over the timeline's into its step, so the two compose into one
interpolation and 48 kHz onto a 44.1 kHz timeline keeps its pitch. All of
it is convert-on-read — per packet in the decoder, per buffer in `emit`,
after the window trim — so there is no upfront pass to show progress for
and nothing to cancel.

What is still refused is the layout alone: a mono track cannot join a
stereo timeline, in the words "audio 1 ch does not match the timeline's
2 ch". The picker's grey-out rule follows the gate rather than leading it.

Measured on a 12.9 GB 2160p AV1 remux with a real-library 7.1 Opus
track: imports, opens as a timeline, and a ten-second WAV export comes
back at RMS 0.0091 left / 0.0085 right.
🔊 feat(export): an edited Opus source leaves an mkv as OpusAhmet Kaan Gümüş · 76ede8e
🔊 feat(export): an edited Opus source leaves an mkv as Opus

Opus could be read here since `ruopus` landed and could not be written at
all, so every cut of an Opus film came out as AAC in a Matroska file: a
codec downgrade nobody asked for, paid on every edit. `opus-rs 0.1.26` is
the encoder half -- a pure-Rust port of libopus 1.6, BSD-3, no `build.rs`,
not one `.c` in the crate and no dependencies at all (checked, not read off
the README) -- and a Matroska export now writes `A_OPUS` with an `OpusHead`
in its `CodecPrivate`, `CodecDelay` and the codec's fixed 80 ms
`SeekPreRoll` beside it. An mp4 still says AAC and the mp4 writer now
refuses an Opus track by name rather than declaring `mp4a` over it.

Only where an *encode* was going to happen anyway. An untouched timeline
still copies its packets, bit for bit, into the same container: Opus is what
an edit costs, never what a passthrough costs.

The envelope is measured and it is narrow, which is the whole story of this
crate. On three one-second spans of a 5.1 Opus film, encoded here and
decoded with `ruopus` -- not the suspect, it reads ffmpeg's libopus at 256
kbps back at correlation 1.00000 -- the encoder is usable to 128 kbps
(0.937/0.989/0.994) and ruined by 136 (0.452/0.697/0.951), against libopus
at 0.997/0.998 on the same material. Pure-tone fixtures put that cliff at
165 kbps, so its edge moves with the content and no constant is safe on its
own: the cap is 128 kbps *and* every track is decoded again and correlated
with the mix before it is written. Below 0.95 the export writes AAC instead,
and the encoder line the export publishes says AAC, so the fallback is
visible rather than silent. Mono keeps AAC outright -- this encoder mis-codes
it at every rate asked for here -- and so does any timeline that is not
48 kHz, since Opus has one rate and resampling a whole timeline to reach it
is a bigger change to the sound than the codec is.

Two delays, both measured rather than hoped for. The pre-skip is 1080
samples: the encoder's 2.5 ms lookahead plus one warm-up frame, because a
cold first frame comes out ramped and out of phase (the head of the fixture
went 0.9788 -> 0.988 correlated once it was fed its own first 20 ms first),
and one silent frame is pushed in at the end so the last 2.5 ms leave the
encoder instead of ending the track short under a picture that is not.
ffmpeg's decode of the file agrees with this project's own reader sample for
sample, which is what says the header describes the stream.

`tests/opus_export.rs` exports a cut and reads it back through symphonia's
mkv reader and `ruopus` -- 0.9948 left and 0.9825 right against the source,
0.997/0.993 past the first frame -- proves the AAC copy still wins where it
applies and that a mono mix takes the AAC path, and, with `EDITH_OPUS_FILM`
pointing at a real-library Opus mkv, cuts a span out of the film itself:
correlation 0.9914 at a lag of one sample. The unit test in `export.rs` pins
the 256 kbps failure, so the day the crate fixes it this suite fails and the
cap can be raised.
✨ feat(export): an untouched Matroska timeline leaves as its own packetsAhmet Kaan Gümüş · ada6ac5
✨ feat(export): an untouched Matroska timeline leaves as its own packets

The picture's half of what `copy_audio` already did for the sound: where a
copy says exactly what the timeline says, the coded blocks of the source are
written straight into the file and no decoder or encoder is opened at all.

The gate is the audio one's doctrine, not a looser one -- Matroska in and
Matroska out, the source's codec is the one this format carries (HEVC for
`Format::Hevc`, AV1 for `Format::Av1`), and nothing has touched a sample: no
grade, no speed, no rate conversion, no gap to fill with black, no source of
another size, no `ContentEncodings` packing to undo. Every span must begin on
a sync point and end where the next begins, which is what placing a cut on a
keyframe gives it.

All or nothing per export, and that is the interesting constraint: a copied
span and an encoded one cannot share one track, because this project's
encoders write 8-bit SDR streams with parameter sets of their own and a
container states its configuration record once -- splicing them into a Main 10
HDR source would change bit depth and colour mid-track. So the head and tail
fragments of a cut that lands mid-GOP are not re-encoded into the copy; they
are what makes the whole export fall back to the encoder it always used.

A copy keeps its source's `Colour` as well as its `CodecPrivate`: an HDR film
copied is still the HDR film, because not one of its samples was touched. The
blocks are timed by their source's own timestamps (`MkvMuxer::write_block`)
rather than by a frame counter, without which a stream with B-frames -- stored
in decode order, timestamped in display order -- would play its groups of
pictures in the order they were coded in.

An open-GOP source writes leading pictures after a sync point that are shown
before it and reference the group before it; at the start of a copied region
those references are not in the file, so they are dropped rather than written
as pictures no decoder can put back together. The region still starts at the
timeline frame it owns, so the sound never drifts.

Measured on a real-library 4K x265 HDR Matroska of 2h30m (167671 pictures),
five minutes cut out of the middle on two sync points: the export takes 162 s
and writes 10.8 GB, against a re-encode of the same timeline measured at
0.94-1.75 pictures a second -- 25 to 47 hours for the same file. Every block
sampled either side of the join is its source's own bytes, the shown order is
one unbroken frame grid, and the pictures two seconds either side of the join
decode through this project's own decoder without an error.
✨ feat(subtitles): as many tracks as you want, embedded in the exportAhmet Kaan Gümüş · 28e2853
✨ feat(subtitles): as many tracks as you want, embedded in the export

Subtitle tracks now work the way audio and video tracks do: add as many
as you like, remove any of them, and every track with cues on the
timeline is written into the exported file.

Add and remove
- "+ S" beside "+ V"/"+ A" imports every subtitle track in a picked
  file; each row carries its own "x". Pointer and keyboard doors share
  one implementation and refuse identically, before any chooser opens.
- Project::remove_subtitles / PlaybackSession::remove_subtitles, with
  the index fixup in one place so a removal cannot repoint the overlay.

Embedded in the output
- ExportSettings.subtitles is a list; the Matroska muxer writes N tracks
  from number 3 up, ceiling derived from the encoding (0x7F -
  SUB_TRACK_FIRST) because track 127 is the all-ones VINT our own reader
  maps to "unknown" and would silently lose.
- mp4 carries them too, as real tx3g timed text. The old "an mp4 carries
  none" was a false refusal: mp4 0.14 has MediaConfig::TtxtConfig all
  along. Samples are built from cue boundaries, so gaps are empty
  samples and the track spans the film.
- of_mp4 reads them back, so edith re-imports its own output. Verified
  against a file ffmpeg muxed, which writes mdhd in microseconds where
  we write milliseconds.
- The export set is derived from timeline_cues per call, so it cannot
  desync; the card names a track it leaves off, and counts past the
  width budget rather than eating the card.

Language and title
- SubtitleTrack carries language and name apart; the guess-them-back
  heuristic is gone. LanguageBCP47 is read and mapped to a 3-letter code
  (ffmpeg reads no BCP-47 at all, so writing it would have made the
  language invisible). A 17-track subtitle library file and a
  dual-language one no longer read "und".

Media bitrate in properties
- engine::probe_bitrate opens no decoder; all three numbers share the
  container's duration, so total >= video + audio holds by construction.
  Within 0.004% of ffprobe across the library.
- Both properties cards show it; a dual-audio file says which of how
  many. The line picks one unit off its smallest stated component, so a
  real value never renders as 0.00.

Off the render thread
- The subtitle walk moved to the background executor at every door:
  1324ms -> 0.1ms on a 3.1GB film, 234ms -> 5.0ms on a 25.4GB/35-track
  one. (The media walk is still on the render thread; separate slice.)

False refusals removed
- .mks and .mka were refused while the compiled-in Matroska reader
  parses them; is_matroska now takes the standard's closed set.
- The audio-only "sound alone" sentence was unreachable when every pick
  was a bitmap track.

Subtitle-free exports stay byte-identical: 294a8b0c (hevc mkv),
8c16b8b1 (default mp4).

2026-08-11

✨ feat(tonemap): the reference rendition converts a film at the peak the film declaresAhmet Kaan Gümüş · 27097e2
✨ feat(tonemap): the reference rendition converts a film at the peak the film declares

`Demuxer::light().peak()` -- a stream's MaxCLL, or its mastering display's
maximum -- has been read at every open and dropped on the floor. It now reaches
`ToneMapper::new` as `declared_peak`, and `Preset::master_nits_for` is the whole
composition rule: `Reference` takes the film's number (1000 stays the fallback
for a file that declared nothing), `Standard` and `Vivid` keep their fixed 400
and 250, because a picked exposure that moved per file would not be a pick.

One HDR film declares 1759 cd/m^2, so its 1000-nit highlights
land at SDR 215 instead of clipping at white, and BT.2408 diffuse white at 145
instead of 166.

Both sites that build a table have the demuxer in hand already, so nothing is
promoted through `VideoMeta`: the decode funnel reads it before the worker takes
the demuxer, and `source_rate` returns it off the header parse export already
did -- which is what keeps preview and export on one number.

A declared peak is a stranger's number and is checked before it becomes a
divisor: outside 100..=10000, or a NaN, is treated as not declared.

test_hdr_bright.mkv joins the fixtures for it -- the older HDR metadata ones all
say 1000, which no picture can tell apart from the fallback.
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for youAhmet Kaan Gümüş · 09671f7
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for you

BT.2446 Method A's assumed mastering peak was a constant in the module: 400
cd/m^2, one exposure decided for everybody. It is a matter of taste, not of
correctness -- a reference rendition and a vivid one are both honest pictures of
the same film -- so it becomes a project setting with three renditions through
the very same curve, which is what keeps the hues right whichever is picked:

  Reference  1000 nits, chroma 1.0   the published conversion (diffuse white 166)
  Standard    400 nits, chroma 1.0   display-referred, as bright as a player
  Vivid       250 nits, chroma 1.10  brightest, and a tenth more colour

The chroma gain is a scale about 128 in the SDR codes, after the map and clamped
to the legal range: a grey stays exactly grey at any gain, and at 1.0 it is a
clamp the maths cannot reach, so the other two presets are byte for byte what
Method A produced. HLG's OOTF gain is guarded at black -- below a 1000 cd/m^2
peak the system gamma is under 1, and the 0 * inf that follows byte-cast to 0
and put a hole where black belongs.

The preset lives on the Project beside the limiter (a setting, not an undo step),
reaches the decode workers and the export through the same value, and is saved as
a `tonemap` line in edith 11 -- left out when it is the default, so a project
holding no HDR media is the bytes it was, and a v10 file loads as the reference
rendition, which is the only one it ever had. Picking one rebuilds the picture
under the playhead the way a resize does; an SDR project is unmoved.

The panel names it beside the resolution and the rate -- the third thing that is
the project's rather than the media's -- and a click opens the three renditions
with the one in force marked. No stroke: this is a list to look at.
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the gradeAhmet Kaan Gümüş · f390c37
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the grade

The export path read a PQ or HLG source's tags, wrote an SDR file and left the
pixels on their HDR curve: a washed-out, flat picture in a file that says
BT.709. `engine::tonemap` existed and nothing called it.

One `ToneMapper` per source stream -- the 9 537-node table is built beside the
per-source rate and colour, not per span -- and one call per frame, into the
grade scratch the path already owns, ahead of `apply_yuv`. That order is
playback's: the grade is a decision made against the SDR picture on the canvas,
so applying it to HDR codes would export a picture nobody saw.

The matrix remap that used to be the whole of the answer now asks `remap_into`,
which knows the tone map hands back BT.709 whatever the source was coded as: an
HDR clip is never *also* given the 2020 matrix treatment, and one on a canvas
below 720 lines still takes its 709 -> 601 step.

An SDR project is byte-identical: no table is built, no branch is taken.
🐛 fix(color): the bitstream says which matrix it is, and a grade happens where the preview grades itAhmet Kaan Gümüş · 86c11d8
🐛 fix(color): the bitstream says which matrix it is, and a grade happens where the preview grades it

Two faults the container-level tests could not see.

An HEVC export carried its colour in the file's tags and nowhere in the
stream, and a decoder reads the stream first: libavcodec inferred
"unspecified", which is BT.601, and rendered a 709 export from the wrong
matrix (9.78 mean codes off the right render against 2.27 off the wrong
one). The vendored encoder now writes a §E.2.1 VUI carrying the colour
description, from the same `ColorDescription::output` rule the muxers
tag with, so the two halves of a file cannot drift apart. rav1e gets the
same signalling for the same reason; `rusty_h264` has no VUI knob at all
(`vui_parameters_present_flag` is hardcoded 0), and H.264 only ever
ships here inside an mp4 whose `colr` box rescues it.

...and an export remapped a clip into the file's space before grading
it, while playback grades in the source's own space and converts for the
screen -- so a graded 601 clip on a 709 canvas came out 21.04 mean codes
away from the picture the canvas had shown. The grade goes first now,
which is the order `Decoded::frame` renders in.

Measured, on the frame-0 rig: preview vs export 21.04 -> 0.15, and
`ffprobe -show_frames` on the raw HEVC and AV1 elementary streams reads
bt709 where it read unknown. An ungraded same-space export is
byte-identical to before.
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that oneAhmet Kaan Gümüş · 907dfc5
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that one

Exports carried no colour tags at all: the numbers went out as they came off
the decoder and every reader downstream had to guess. A 601 clip beside a 709
one went out as two spaces in one file, and nothing said so.

Now every export declares a space -- BT.709 at 720 lines and up, BT.601 below,
the same rule a reader with no tags applies -- in the Matroska `Colour` element
and the mp4 `colr` box, and a clip coded against the other matrix is rewritten
into it before it is graded. Same-space clips take the path they always did and
not a byte is touched.
✨ 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.
🩹 fix(subtitles): the grafts off the losing PGS laneAhmet Kaan Gümüş · bf65371
🩹 fix(subtitles): the grafts off the losing PGS lane

- The overlay is a flex box with the canvas as its one growing item,
  fitted (Contain) the way the picture under it is: size_full inside an
  absolutely placed box has nothing to be a percentage of, and Fill put
  every cue somewhere the disc did not.
- One way out of subtitle_overlay, and it lets the drawn picture go on
  the way: the toggle going off leaked an 8 MB atlas tile per press.
- A track is pictures because of its codec id, not because its first cue
  happens to be one: an all-erase or empty PGS track passed for text and
  an export promised words it has none of.
- The sup handed to the decoder stops at the end of the first display
  set that composes something, so a muxer packing the erase into the
  same block no longer blanks the cue.
- The film-gated session test: the row a click picks, the map a repaint
  asks for twice (under 16 ms warm), the picture it draws.
✨ feat(subtitles): a PGS cue is a picture the timeline carries, not a row that says noAhmet Kaan Gümüş · c45b18e
✨ feat(subtitles): a PGS cue is a picture the timeline carries, not a row that says no

The four S_HDMV/PGS tracks of a BluRay remux were listed and greyed: pictures,
and nothing here could draw one. Now the cue IR carries a picture beside its
text -- `Cue::image`, a `CueImage` holding the display set the Matroska block
held -- and the rows are rows a click can pick.

The decoding is `oxideav-sub-image`: the run-length walk, the palette, the
YCbCr and the object fragmentation are not this project's to re-derive. What is
written here is the framing between the two -- a Matroska block is a `.sup`'s
segments with the `PG` magic and the timestamps taken off, so they go back on --
and the pairing PGS needs and text does not: half the blocks compose nothing,
which is the disc clearing the screen, and that is where the cue before them
ends. `BlockDuration` is zero on every one of them, so `end_of` now reads a zero
the way it reads a missing one.

Kept encoded, decoded when something is about to draw it: this film's canvas is
8 MB of RGBA and its four tracks carry eleven thousand display sets, so the IR
holds the thirty megabytes the file already spends and the front-end keeps one
decoded picture for as long as its cue is up.

An export still writes a text track, so a track of pictures writes none and the
card says "drawn, not written" before the button. A `.edith` is unchanged: it
held a file and a track number and never a cue, which is why a bitmap track
round-trips without the format knowing it exists.
✨ 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.
🐛 fix(subs+eos): the plate reads the map the file is written from, and a knob past the end leaves the end aloneAhmet Kaan Gümüş · 2bee9c3
🐛 fix(subs+eos): the plate reads the map the file is written from, and a knob past the end leaves the end alone

The overlay and the timeline strip drew every subtitle track on the raw
timeline clock while the export carried an embedded track through the cuts
(export::timeline_cues), so a rippled timeline previewed one thing and wrote
another. Both now ask that one map through PlaybackSession::timeline_cues --
preview and file agree by construction, and a standalone .srt keeps the
timeline clock it always had.

And the end of stream: is_eos promised that "any edit after the end revives
the session", which a sound-only edit never did. The transport's own model
says it should not -- eos means the picture worker ran out, reseek_audio
starts no picture worker, and reviving on an EQ tweak would spend the Ended
state that makes the next press restart from the top. The doc now states that
rule and a test pins it.
✨ feat(export): the subtitles leave with the fileAhmet Kaan Gümüş · df92458
✨ feat(export): the subtitles leave with the file

A Matroska export now carries the picked subtitle track as S_TEXT/UTF8:
a TrackEntry beside the picture and the sound, and one BlockGroup per cue
— Block plus BlockDuration, because a SimpleBlock has nowhere to say when
a line goes away. Interleaved into the clusters as the AAC packets are,
so a player has the cue by the time it needs it.

The cues are put on the exported timeline first. A track that came out of
a media file is timed against that file, so it is carried through the
spans that still play it: a cue over a stretch that was cut out is gone,
one straddling the cut keeps the half that is still there, and everything
after a rippled delete moves back with the picture it belongs to. A
standalone .srt has no clip to hang on and no offset to shift by, so it
stays on the timeline's own clock — the one the overlay drew it at —
clipped to the exported length. A cue nothing clipped keeps its own
microseconds, so an untouched timeline exports the times the source
states, to the millisecond the file is written in.

An mp4 says so instead of pretending: tx3g is a different beast and
nothing here writes one, so the export card carries a Subtitles row that
reads "test_subs.srt → embedded", "mkv only — an mp4 carries none" or
"none" before the button is pressed.

Exports without a picked track are the files they always were: the track
entry and the blocks are written only when there is one.
✨ 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(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): HEVC leaves the way it came in — intra, in either boxAhmet Kaan Gümüş · 12f8cb7
✨ feat(export): HEVC leaves the way it came in — intra, in either box

The one codec edith could read and never write. OxideAV's pure-Rust H.265,
vendored from git master (its released 0.0.9 is pre-encoder) with one marked
patch: the intra SPS writer had no conformance window and refused any dimension
off the 16-sample CTB grid, so 1920x1080 could not be written at all. It is now
coded padded to 1088 with the edge replicated and cropped back by the SPS, which
is what ffprobe reads out of the bitstream.

Intra-only, and every row says so: the inter modes code 1080p at 0.81 fps across
twelve cores and the intra path does 4.30 on the same picture, so the export is
an intraframe master — ProRes-shaped, large files, every frame a cut point —
rather than a delivery file nobody would wait for. The AU is a stateless
function of one frame, so frames fan out across twelve lanes and are collected
back in display order.

Two rows, `h` and `x`, because a codec and a container are two choices: the
`hvcC` record built from the encoder's own VPS/SPS/PPS goes into a Matroska
`CodecPrivate` and into an mp4 `hvc1` sample entry unchanged, so the two files
are one stream written twice. Both re-open in edith through the plugin, sound
and all.
🔀 merge(T4): every video format carries sound meets the hw/sw indicator and mixed fpsAhmet Kaan Gümüş · cf10a7c
🔀 merge(T4): every video format carries sound meets the hw/sw indicator and mixed fps

Four seams, all kept whole:

- export.rs copy_audio — T4's routing (two lanes, a speeded lane, an equalizer,
  an uncopyable source all fall through to encode_audio) composed with T3's
  conformed-lane comment, which is now the reason a *rate* is NOT one of them:
  a conformed lane still copies, and `tests/mixed_fps.rs
  an_export_of_two_rates_runs_at_the_speed_it_was_shot` is what says so.
- export.rs labels — hw_seat/video_label take both AV1 containers (a container
  is not an encoder), audio_label gained MP3 and stopped calling AV1 soundless.
  It is now a *measurement*: copy_audio hands back an `ExportAudio` that says
  whether the packets were copied, so a progress line naming "AAC copy" is what
  really happened rather than what the edit predicted.
- main.rs — the FORMATS key column meets export_line's seat, and an audio-only
  format now CLEARS the cached video seat instead of showing the last picture
  format's: picking MP3 after AV1 read "SW encode (rav1e) · MP3 · SW
  (rusty_mp3)", which named an encoder that would not run. Same shape for WAV
  and FLAC, which had it before this branch.
- tests/backends.rs — the card==job pin now runs over all three picture formats
  and all three audio-only ones.

Green: engine --lib, --test export/av1/backends/mixed_fps/audio_export/eq_audio
(--test-threads=1), edith --bin, cargo check --workspace. No duplicate keys in
the merged engine manifest.
✨ 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).
🔀 merge(T3): mixed frame rates meet mkv HEVC, zero-source survival and the zoomAhmet Kaan Gümüş · 6b5fa2e
🔀 merge(T3): mixed frame rates meet mkv HEVC, zero-source survival and the zoom

`main`'s `open_project` now walks every source with the scaffold in its own
slot (T6), so the per-source `rates` table is built there frame by frame beside
`counts` -- one table in two vectors, grown and shortened together. The codec
gate T1 leans on stays; the frame-rate gate is still gone, and a Matroska file
shot at another rate imports through the very same door an mp4 does, its rate
read off the demuxer's `default_duration`.

Grafted from the losing branch, which had the better arithmetic:

* `Rate::from_fps` is exact. Built on `mux::frame_timing` -- the pair the muxer
  already counts an export's frames in -- divided by that pair and reduced, so
  24000/1001 over 30 is `800/1001` and stays it however far the timeline runs.
  The milli-fps rounding it replaces was a frame off after seven hours; that
  ponytail is gone rather than documented.
* A rate no timescale can *name* is an `Err` in `frame_timing`'s own words
  rather than a silent 1:1, and `matches_timeline` is where a file carrying one
  is refused -- it hands back the `Rate` it accepted the file at, so the number
  the refusal was decided on is the number the file plays by.
* `file_frames` and `file_rate` ask one `source_of`, so a path that names a
  length names a rate too.
* Five more tests in `tests/mixed_fps.rs`, in timeline frames: the exactness of
  the NTSC ratio, a trim of an off-rate clip to the room it was dragged to, the
  neighbouring 30 fps clip still read frame for frame, the linked sound placed
  at its picture's length, and the exported pictures measured against the
  file's own frames rather than merely counted.

...and the note the next builder needs in `copy_audio`: a lane holding a clip
at another rate stays a packet copy on purpose. A clip counts the *timeline's*
frames, so the window the copy trims a source's sound to is whole timeline
seconds and the packets are already in sync; re-encoding it would buy nothing
and cost a generation of loss. A speed is different, and still refused there.
✨ feat(backends): the decoder and the encoder say which one is runningAhmet Kaan Gümüş · bdcc2fb
✨ feat(backends): the decoder and the encoder say which one is running

A source names its decoder in the library row before anything plays, the
transport line names the running one while it does, and the export card
names the encoders it would open before the button — the progress line
naming the ones it did.

Every answer is measured, never promised: `decode::probe` picks a seat by
the very rules `open_worker` picks one, the worker publishes what it
actually opened (so a hardware session that falls back to software says
so), and `export::planned_video` opens the very VA-API encoder the export
would and closes it again. `hw_seat` is now the single place that choice
is made, so a card and a running job cannot drift apart.

2026-08-10

🔀 merge(T1): mkv HEVC + 5.1 AAC import meets the EQ exportAhmet Kaan Gümüş · 1dc163e
🔀 merge(T1): mkv HEVC + 5.1 AAC import meets the EQ export

One rusty_aac, not two: the branch's vendored 0.5.0 (patched IMDCT) is what the
workspace patch table points every dependant at, so T5's encoder and this
branch's decoder are the same crate. The auto-merge had left two identical
`rusty_aac` keys in the engine manifest, which is a duplicate-key error -- one
entry now, its comment naming both halves.

The three prose conflicts were all one shape: this branch wrote 'no AAC encoder
is wired here' while T5 was busy wiring one. T5's wording wins in each. Where
main's Av1 doc said this engine's reader 'refuses Matroska audio' the claim is
now false the other way round, so that sentence keeps main's writer half and
takes this branch's reader half.
✨ feat(import): a Matroska film opens, its 10-bit picture and its 5.1 sound alikeAhmet Kaan Gümüş · b083a3b
✨ feat(import): a Matroska film opens, its 10-bit picture and its 5.1 sound alike

mkv HEVC demux (Main/Main10), a P010 pool in the hardware path read back to
I420, mkv audio through symphonia's Matroska reader with rusty_aac decoding
what symphonia's own AAC refuses (anything wider than stereo), and a BS.775
fold of 5.1 down to the stereo the output device takes.

vendor/rusty_aac is 0.5.0 with one local patch: its decoder's IMDCT caches the
cosine matrix instead of calling cos() per term, 11x faster and the difference
between playable and not.
✨ 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.
🐛 fix(timeline): a hole punched into a slow clip leaves no overlapAhmet Kaan Gümüş · c892972
🐛 fix(timeline): a hole punched into a slow clip leaves no overlap

`place` punches a hole with `clear`, and `clear` handed the remainder
whatever source range rounding produced. At a quarter speed one source
frame *is* four timeline frames, so a punch three frames into such a clip
left a head that reached past the hole and overlapped what was placed --
the lane invariant, broken by the one edit that is allowed to overwrite.
`Speed::fit` now answers `None` for a room nothing fits in and both
remainders go through it: no fit, no remainder.

The sweep that found it found a second of the same shape. `set_speed` put
one rate on a whole linked group without asking whether the group still
covered one span: two halves of *different source lengths* can occupy the
same frames at 4x (rounding collapses neighbouring lengths onto one
footprint) and re-rating them pulls the halves apart, which is a project
that will not load again. Refused by name now, like the collision is.

The trim walls move with it: one frame of clip always survives, and at a
rate below real time one frame of clip is several frames of timeline
(`Speed::room`). A trim that cannot fit refuses before it snapshots rather
than writing a range wider than its room.

Both fuzz sweeps go to 2000 seeds -- 200 walked straight past this, and a
sweep this cheap has no business being the narrow one -- and place now
lands speeded clips over speeded clips on purpose. Falsified: with the
guard removed, `place`'s own `sorted_disjoint` assert fires.

Grafted from the rival build of this feature, which the judge preferred on
these three points:

- floor/ceil pairing on `Speed`: `source_at` (floor) is what an export
  encodes, `timeline_at` (ceil) is the stamp playback puts on a decoded
  frame, and the pair makes the frame the pump is holding *exactly* the
  frame the export writes, at every rate (`speed_maps_both_ways`, 3751
  speeds). The floor/floor this had put the preview a whole held frame off
  the export at slow rates.
- the picture now **honours** a rate: the export walk takes the source
  frame each timeline frame shows and encodes a held one again rather than
  decoding it twice. `Span::source_len` reads the last shown frame's own
  source frame and not one more.
- the refusal narrows to the mp4's *copied audio lane* only. AV1 has no
  audio to copy and honours a speeded take whole; WAV and FLAC always did.

EVIDENCE: a mixed-rate mp4 (2x then 1x on one lane) reopens as 135 frames
at 30 fps and its bright frames are exactly [15, 16, 75, 76, 77, 78] --
the fixture's four-frame flash halved inside the fast clip, whole inside
the slow one -- read back both by the engine's own decoder and by ffmpeg.
✨ 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.
Merge branch 'main' into worktree-agent-ae7a2aef268502a46Ahmet Kaan Gümüş · 934361c
Merge branch 'main' into worktree-agent-ae7a2aef268502a46

# Conflicts:
#	crates/engine/Cargo.toml
✨ 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.
✨ feat(export): AV1 comes back out, in a Matroska file this editor reopensAhmet Kaan Gümüş · dd3a2a8
✨ feat(export): AV1 comes back out, in a Matroska file this editor reopens

The export card's second picture format. AV1 already *arrives* here as
Matroska (`mp4 0.14` has no `av01` sample entry at all, so `demux` walks
the EBML by hand); it now leaves the same way, through an `MkvMuxer`
written beside the mp4 one -- EBML header, `Info`, one `V_AV1` track whose
`CodecPrivate` is a real `av1C` record built from the first keyframe's
sequence header OBU, then clusters that open on every keyframe. The
segment size and the duration are the only two fields patched at `finish`.
Matroska rather than AV1-in-mp4 because the reader for it already exists:
the round trip closes against this project's own `Demuxer`.

Picture only, and said so on the row before a destination is picked ("AV1
picture in .mkv — no sound: export WAV or FLAC for that"). Matroska
carries no sound this project can *write* -- no AAC or Opus encoder here
-- and an AAC track copied in would be one this engine's own reader leaves
silent (`AudioSession::open` refuses Matroska audio). A silent track
written anyway is the one failure a user would not notice.

The encoder pair mirrors H.264's: `rav1e` in software, the plugin's new
`vh_enc_av1_open` on the GPU. The hardware seat is wired, tested and
**opt-in** (`VE_HW_AV1=1`): the vendored cros-codecs AV1 encoder took the
radeonsi box this was written on into an amdgpu hard recovery, and a
driver reset is not an export. `rav1e` is not a new dependency at all --
`ravif` already locks the same 0.8.1 -- and is built with `asm` off (no
`nasm` in this build) and `threading` on: 39 s for the 5 s 720p fixture,
progress reported the whole way.

HEVC and VP9 are rows too, refused by name: no encoder in this stack and
patent-encumbered, and superseded by the AV1 row above.
✨ feat(audio): a song opens as a timeline of its ownAhmet Kaan Gümüş · eb9a278
✨ feat(audio): a song opens as a timeline of its own

An audio file could not start a project: `PlaybackSession::open` refused
every `is_audio` path because a timeline was scaffolded from source 0's
*picture*. It now scaffolds the canvas instead -- 1080p at 30 fps H.264,
the rate a later video import is held to -- takes its length from the
audio, puts the one clip on `A1` and leaves the video lane empty, so the
existing gap path plays it black while the song keeps the clock.

`open_project` does the same when source 0 has no picture, so an
audio-only `.edith` loads. An mp4 of such a timeline is refused by name
in `export::start` (it would be black over the sound) and the export
card says so on the MP4 row before a destination is picked; WAV and FLAC
export as they always did. The Export button now re-asks that question
too, since mp4 is the default and a timeline can lose its picture after
the format was chosen.
🔒 fix(export): an empty timeline is refused by the engine, in every formatAhmet Kaan Gümüş · dc82aff
🔒 fix(export): an empty timeline is refused by the engine, in every format

Grafted from the rival empty-timeline candidate: the app's `is_empty`
refusal was the only fence, so an export started by anything that is not
that button still wrote a file of no frames. The refusal now lives in
`export::start`, in the rival's exact words.

Placed ahead of the format match rather than inside `run`, so a WAV and a
FLAC refuse in the same words an mp4 does -- `run_audio` would otherwise
have written a zero-sample file or refused as "no audio to export", which
names the wrong thing. The app keeps its own check: two fences, and only
the app's has a keystroke to blame.

The end-to-end test asserts the exact message for all three formats and
that no file is left behind.
✨ 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(video): per-clip color grade is live in render and exportAhmet Kaan Gümüş · bd89527
✨ feat(video): per-clip color grade is live in render and export

The grade a clip carries now reaches the picture. `Project::composite_clip_at`
names the clip the composite shows at a frame and `composite_color_at` its
grade, so playback's decode worker (folded into `i420_to_bgra_with`, free in
the loop that was reading those samples anyway) and the export's encoder (onto
per-span scratch, since the planes are borrowed) grade from one answer.

`PlaybackSession::set_color` is an edit like any other, so it reseeks -- which
is what repaints the frame already on screen, paused or playing.

The card: `k` (or the clip menu's Colour…) opens four sliders on the selected
video clip, or on the clip under the playhead when nothing is selected, so it
is reachable with no pointer at all. Arrows pick and move a slider, r resets,
esc closes; a slider walked back to the middle takes the grade off, which keeps
an ungraded project byte-identical -- verified: the same two-clip export before
and after this slice is md5 98522c19cefac2f7851b51de6416a493 both times.
✨ feat(audio): per-clip equalizer is live in playback and exportAhmet Kaan Gümüş · 4d92155
✨ feat(audio): per-clip equalizer is live in playback and export

The model, the format and the filter have all existed with no callers. This
wires them: `Project::audio_eqs_from` hands one curve per segment beside the
play list `audio_segments_from` already builds, `open_mixed_streams_eq` gives
each lane's worker those curves, and `emit` -- the one place both readers hand
their samples over -- filters a segment after it is trimmed and before it is
sent. Playback and an audio export therefore get the same filtered stream by
construction rather than by two call sites agreeing.

A parallel list, not a fourth element of the segment tuple: that tuple is what
every opener, the packet-copy path and a dozen tests speak, and an effect is not
part of which samples a segment names. A short list plays flat, so a mismatch
can neither panic nor shift a curve onto the wrong clip.

Live editing needs no channel into a running worker: `set_eq` is an edit and
every edit reseeks, so the workers are rebuilt from the new curves where the
playhead is standing.

An mp4 export copies AAC packets and no filter can reach a copy, so an
equalized clip is refused by name and by timecode rather than written flat.

The card is the third of its kind (same scrim, width and rows as keys and
export): a row per band, dragged from the middle out, with `q` to open it and
1-5 / up / down / r as its own keyboard, every one of them listed in the keys
menu by the registry the guard test reads.
🐛 fix(engine): the mp4 audio copy follows the lane that holds the soundAhmet Kaan Gümüş · 000621a
🐛 fix(engine): the mp4 audio copy follows the lane that holds the sound

The refusal gate counted non-empty audio lanes but the copy still read A1's
play list, so a project that leaves A1 empty and places everything on A2 passed
the gate as "one lane", played its sound, and exported an mp4 with no audio
track at all -- silently, which is the one failure nobody notices until they
play the file back.

The copy now takes the single list `audio_segments_from` already resolved for
playback, so "which lane holds the sound" is asked once and answered the same
way everywhere. The gate keeps its wording: that list is never empty, so the
refusal is still exactly the >1-lane case.
✨ feat(engine): N-lane compositing in playback and exportAhmet Kaan Gümüş · 08af6bc
✨ feat(engine): N-lane compositing in playback and export

Video: the topmost video lane with a clip there wins, topmost being the last
lane in display order (V2 over V1, the overlay convention). No blending, so
exactly one lane is visible per frame and the composite is itself a span list
-- Project::composite_span_at -- which one decoder plays. N video lanes never
mean N decoders; a lane change costs the one decoder reopen a cut already
costs.

Audio: every audio lane that holds something gets a play list
(Project::audio_segments_from) and AudioSession::open_mixed_streams sums them,
clamped, each lane keeping its own gap rule so the master clock counts a sample
per sample of timeline. One lane skips the mixer entirely and is the byte-for-
byte path it always was.

Export walks the same composite and mixes the same lanes for WAV/FLAC. The mp4
path copies AAC packets and cannot mix, so a timeline whose sound is spread
over two lanes is refused there by name rather than silently exported without
half of it.
♻️ 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.
✨ feat(engine): HEVC import via the VA-API pluginAhmet Kaan Gümüş · 85c152d
✨ feat(engine): HEVC import via the VA-API plugin

The demuxer takes a hev1 track alongside avc1 and vp09. Its parameter sets are
read out of the file by hand: mp4 0.14 reads one byte of hvcC and skips the
rest, so the VPS, SPS and PPS an HEVC decoder cannot start without are
unreachable through the crate. A small ISO-BMFF walk finds the track's hvcC and
the record gives both the parameter sets and the NAL length prefix width -- the
avcC one is now read the same way instead of assumed to be four bytes, which is
one hardcoded guess less on the H.264 path too.

Samples are repacked to Annex-B exactly as H.264's are, parameter sets ahead of
every sync sample, because a hardware decoder that joins the stream at a seek
has nothing else to configure itself from.

Main 10 is refused at open by name: the plugin's NV12 pool and its vaGetImage
read-back are 8-bit, and a 10-bit stream decoded into them would be garbage
shown as a picture rather than an honest no. Same reasoning as the software
refusal, which is now one message shared by every codec that has no software
decoder at all.

The C ABI is unchanged again: the plugin demuxes the file it is given, so an
older libengine_hw.so still loads, still decodes H.264, and simply returns null
for an HEVC path.