[package] name = "engine" version.workspace = true edition.workspace = true [lib] # No runnable doc examples; skip the rustdoc test pass. doctest = false # No UI dependency here, ever: the engine must stay reusable across front-ends. [dependencies] bytemuck = "1.25" # The WAV writer and reader, the family's own (`ec-riff`): RIFF for the usual # sizes and RF64 past 4 GiB, WAVE_FORMAT_EXTENSIBLE for the layouts that need it. # `ec-flac` encodes FLAC (RFC 9639), the family's own encoder. ec-riff = { path = "../../../edith_codecs/crates/ec-riff" } ec-flac = { path = "../../../edith_codecs/crates/ec-flac" } # The noise reduction's STFT (`crate::voice`). Already in the lock file via ec-opus. rustfft = "6.4" # edith-stt speaks JSON lines ([`crate::speech`]); the server already builds this crate. serde_json = "1" # `libc` for the constants the hardware-encode child's parent reads (`SIGKILL`, # `ExitStatus` signals) and for the tests and examples that use it directly. # Not a new crate tree: it was already in this workspace's lock file. libc = "0.2" # `memfd_create` and `recvmsg` with `SCM_RIGHTS` for the hardware-encode child # (`crate::hwproc`), through rustix's safe APIs: the shared staging buffer and the # descriptors the child hands back. "fs" and "net" are the two features those take. rustix = { version = "1", features = ["fs", "net", "process"] } # `sendmsg` with `SCM_RIGHTS` for the hardware-encode child. rustix's send side # takes `BorrowedFd`s, and the DMA-BUF descriptors the parent forwards are the # raw ints a decoder frame owns, which no safe code can borrow; nix takes raw # descriptors in a safe API. Already in the lock file (0.29.0), pulled in by # the rest of the tree, so this line compiles nothing new. nix = { version = "0.29", features = ["socket", "uio"] } # Still images: `ec-image`, the family's own decoder (PNG, JPEG, WebP, GIF, BMP, # TIFF), decodes every picture `decode::Still` places, reads the header-only # EXIF orientation and size (`probe_reader`), and makes the quarter turn of a # turned still (`transform`). The `image` crate is no longer a dependency. ec-image = { path = "../../../edith_codecs/crates/ec-image" } # The MP4/MOV demuxer and muxer. ec-mp4 = { path = "../../../edith_codecs/crates/ec-mp4" } # The MPEG transport stream demuxer (`.ts`, `.mts`, `.m2ts`): H.264, HEVC, MPEG-2, AAC, AC-3, MP2, MP3, LPCM, PGS. ec-mpegts = { path = "../../../edith_codecs/crates/ec-mpegts" } # The MPEG-1/2 video decoder (a software seat, always). ec-mpeg2 = { path = "../../../edith_codecs/crates/ec-mpeg2" } # (ec-prores, below, is also the decoder.) The intra-only professional picture codecs, each a software seat (`decode::prores`, # `decode::dnxhd`, `decode::mjpeg`): Apple ProRes, Avid DNxHD/DNxHR, Motion JPEG. ec-dnxhd = { path = "../../../edith_codecs/crates/ec-dnxhd" } ec-mjpeg = { path = "../../../edith_codecs/crates/ec-mjpeg" } # DV video (DV25, DVCPRO50, DVCPRO HD) with its audio and raw `.dv` files, and MPEG-4 Part 2 # (Simple / Advanced Simple) with H.263: software seats (`decode::dv`, `decode::mpeg4`). ec-dv = { path = "../../../edith_codecs/crates/ec-dv" } ec-mpeg4 = { path = "../../../edith_codecs/crates/ec-mpeg4" } # zlib, for the one Matroska `ContentEncodings` scheme that is not a byte off # the front of every block: mkvmerge compressed subtitle tracks with it for # years. `ec-inflate`, the family's own decoder, with a ceiling on the output. ec-inflate = { path = "../../../edith_codecs/crates/ec-inflate" } # The software H.264 seats, both of them the project's own: `ec-h264` (I/P/B # encode, CAVLC and CABAC, full DPB decode, weighted prediction, in-loop # deblocking), bit-exact against the JVT conformance suite. The decode seat # moved on 2026-09-12; the encode seat followed the same day, which retired the # last of `rusty_h264` -- whose `rusty_h264-common` installed its authors' # `rusty_alloc`, a pure-Rust mimalloc remake, as the process-wide # `#[global_allocator]` of whatever application linked it, no downstream # feature choice being able to decline it, and that allocator segfaulted the # editor on a new decode-worker thread's first allocation (2026-08-13). It had # been survivable only through a vendored patch, which is gone with the crate. # # Decode throughput, measured at the decode swap (demux+decode, no render, best # of three warm passes, otherwise idle machine): 1.5x `rusty_h264` on a 1080p # Main export and a 4K Main render, 1.0x on a 1440p High screen recording, # 1.17x on a CAVLC Baseline fixture; 0.80x on the two B-picture CABAC streams # measured (a 720p High fixture and a 720p Blu-ray episode) -- the price of the # full DPB the old seat skipped with its decode-order corner-cut, which # scrambled exactly those streams. It hands pictures back in display order, # which is what every reader of `frame.index` already assumed (the hardware # backend always did). ec-h264 = { path = "../../../edith_codecs/crates/ec-h264" } # Its shared IR (packets, frames, the registry decoder contract the seat is # written against), direct because decode.rs names those types itself. ec-core = { path = "../../../edith_codecs/crates/ec-core" } # The AAC seat, both ways: every AAC stream edith decodes -- mono to 7.1, LC and # HE-AAC, from mp4, Matroska or ADTS -- goes through this decoder. symphonia's # refuses HE-AAC outright ("aac: aac too complex", `aac/mod.rs:91-96`), so its # AAC decoder is not in the tree at all. 5.1 and 7.1 come back already reordered # into FL, FR, FC, LFE, BL, BR, the order the downmix in `audio` folds. It is # also the *encode* seat: every re-encoded track's sound leaves through # `export.rs`'s `encode_audio` on this encoder. ec-aac = { path = "../../../edith_codecs/crates/ec-aac" } # The software AV1 decode seat, the project's own: a whole AV1 decoder # (entropy, prediction, transforms, loop filters, film grain) with no # third-party codec library under it, the same claim `ec-h264` makes for H.264. # The seat decodes one GOP chunk at a time off the demuxer's reassembled OBU # stream (`decode::run_av1`), so peak memory is one output picture plus the # reference bank, and seeks stay the demuxer's job. ec-av1 = { path = "../../../edith_codecs/crates/ec-av1" } # The software VP9 decode seat, the project's own: `ec-vp9`, every frame of a # profile 0 or 2 stream decoded in this process (`decode::vp9`). It is handed one # block or superframe at a time, the way the demuxer already delivers them, so the # span needs no reassembly and seeks stay the demuxer's job. ec-vp9 = { path = "../../../edith_codecs/crates/ec-vp9" } # The software VP8 decode seat, the project's own: `ec-vp8` (RFC 6386), every # frame of a stream, the same role `ec-vp9` plays for VP9. ec-vp8 = { path = "../../../edith_codecs/crates/ec-vp8" } # The MP3 encode seat, the family's own: MPEG-1/2/2.5 Layer III, CBR and true # VBR (a quality in [0, 1] whose mean tracks its own bitrate ladder), with a # Xing/Info gapless header whose delay/padding fields are *measured* correct. # It took the seat the registry crate `rusty_mp3` held -- same public shape # (`Mp3EncoderConfig { bitrate_kbps, vbr_quality }`, push/finish/next_packet), # which is why the swap stops at this line and the use sites. The decoder side # of mp3 is symphonia's below -- an mp3 has always been importable here, and # until 2026-08 this was the one format the editor could read and never write. ec-mp3 = { path = "../../../edith_codecs/crates/ec-mp3" } # The Vorbis encode seat, the family's own: a full Vorbis I encoder -- its own # floor fit, residue quantiser and per-stream codebooks, block switching # included -- where the registry crates with encoders are either C bindings # (`vorbis_rs`, `vorbis-encoder`: the project's no-install rule forbids both) # or bitstream writers with no analysis stage at all (`oxideav-vorbis`, whose # own manifest calls itself an "orphan-rebuild scaffold"). It took the seat the # first permissively-licensed pure-Rust encoder, `rusty_vorbis`, held. The old # seat emitted long blocks only and numbered its first packet a hop early, so # [`crate::export::write_ogg`] carried a pre-roll and two granule corrections # around it; this one reports spec granules and clamps its final one to the # sample count fed, which let the workaround go. See [`crate::export::write_ogg`] # for the measurement that decided it. ec-vorbis = { path = "../../../edith_codecs/crates/ec-vorbis" } # Symphonia has no Opus at any version -- its codec features stop at ALAC, FLAC and MP3 and # there is no `symphonia-codec-opus` crate -- while both of its containers *read* # the format already: `A_OPUS` and `OpusHead` have always mapped to # `CODEC_ID_OPUS`. The decoder was the one missing half, and the reason a 5.1 # Opus film played silent while its picture was fine. # # Both Opus seats are `ec-opus`, the codec family built in the sibling # workspace this checkout expects beside it (`edith_codecs`): the multistream # decoder a surround track needs -- a 5.1 packet is four elementary Opus # streams, all but the last **self-delimited** (RFC 6716 App. B), and this one # strips that framing per stream -- and the CELT encoder the export seat codes # with. The path is the first edge across that workspace boundary, and a path # is the whole story: the family is not a registry crate, so there is no # version to pin -- the working tree is exactly as pinned as a decoder that is # a bit-exactness dependency can be. # # What it replaced, and why the move is measured rather than hoped for: # `ruopus 0.1.2` decoded (it matched ffmpeg's own decode of a real 5.1 Opus # remux to correlation 1.0000 on all six channels) but ran the export # fidelity path's stereo decode at 0.2x real time (measured, 24.2 s for 121.5 s # of stereo), and `opus-rs 0.1.26` encoded -- into packets that only # its own decoder read back above roughly 165 kbps stereo, the edge moving with # the content (correlation 0.06 at 256 kbps against the source; its own round # trip read 0.9999 at 160), and mono worse still at every rate. That is what # held [`crate::export::OPUS_MAX_KBPS`] at 128 and a mono mix on the AAC path. # Both replaced seats are measured where they used to fail: `export::tests` # round-trips the top of the new band and the mono path, and # `tests/opus_export.rs` exports and re-reads the files through this project's # own decoder door. ec-opus = { path = "../../../edith_codecs/crates/ec-opus" } # The AC-3 / E-AC-3 decode seat, the family's own decoder taking the seat the # registry crate `oxideav-ac3` held. One decoder reads both syntaxes, dispatching # per packet on `bsid`, and hands back interleaved f32 in the coded layout or -- # what the seat asks for on anything wider than mono -- its own A/52 ยง7.8.2 # stereo fold, per-position coefficients from the frame's own `acmod` and mix # levels: the same shape and the same loudness the old seat served. One named # coverage edge, witnessed, not silent: Annex E dependent substreams and # enhanced coupling (7.1 DD+ assembled as 5.1-plus-dependents) are refused by # name where `oxideav-ac3` walked them; every single-substream AC-3 and E-AC-3 # track decodes. ec-ac3 = { path = "../../../edith_codecs/crates/ec-ac3" } # The Dolby TrueHD and MLP decode seat, the family's own: `ec-truehd`, the # lossless substream decode bit-exact against ffmpeg. Every access unit is one # Matroska block and comes back as S32 at the rate and layout of its major sync. # It hands out the highest presentation the unit carries (7.1 where the stream # has it, else 5.1, else stereo); the audio worker folds that to the pair the # timeline carries, as it does for every multichannel source. An Atmos track's # 4th (object) substream is refused by name by the decoder, and so is the open. ec-truehd = { path = "../../../edith_codecs/crates/ec-truehd" } # DTS core / XCH / X96 decode (`ec-dts`) and the family's audio reader and codec # registry (`ec-probe`: IMA/MS ADPCM, ima4, A-law, mu-law, AMR-NB/WB, and the # mp4 / Matroska / WAVE / raw readers that carry them), seated in `extaudio`. ec-dts = { path = "../../../edith_codecs/crates/ec-dts" } ec-probe = { path = "../../../edith_codecs/crates/ec-probe" } # The Ogg container, the family's own: `ec-ogg`, the RFC 3533 demuxer and muxer # with the Vorbis, Opus (RFC 7845) and FLAC mappings. `xiph_lace` builds the # three-header blob and the muxer pages those ahead of the audio, which is the # encapsulation order a Vorbis decoder needs and the part that is easy to get # wrong by hand. ec-ogg = { path = "../../../edith_codecs/crates/ec-ogg" } symphonia-core = "0.6" # The umbrella crate for the standalone audio files: one dependency instead of # seven, and its `default::get_probe`/`get_codecs` are the registries this would # otherwise hand-build. Explicit feature list rather than the default one -- no # ape, no adpcm: what is listed here is exactly what `is_audio` admits, plus # `mkv`, which is not an `is_audio` container at all -- it is how the *sound* of # a Matroska video file is read, the picture having its own demuxer here. # There is no opus/ac3/dts feature at any symphonia version: AC-3 comes from # `ec-ac3` and Opus from `ec-opus` above, both plugged into this crate's # own readers, and DTS is the one that really is refused. symphonia = { version = "0.6", default-features = false, features = [ "alac", "flac", "id3v1", "id3v2", "isomp4", "mkv", "mp3", "ogg", "pcm", "wav", ] } # The family's own subtitle parsers: SRT and WebVTT in `ec-subs`, ASS/SSA in # `ec-ass` (which shares its cue IR), and the PGS picture decoder in `ec-pgs`. # Pure Rust, and nothing here draws a cue yet (see `crate::subtitle`), so no # rendering stack comes in with them. ec-subs = { path = "../../../edith_codecs/crates/ec-subs" } # Closed captions (CEA-608/708) out of the picture track's SEI / user data: the embedded caption tracks # `demux::captions` lists and imports beside the container's own subtitle tracks. ec-cc = { path = "../../../edith_codecs/crates/ec-cc" } ec-ass = { path = "../../../edith_codecs/crates/ec-ass" } ec-pgs = { path = "../../../edith_codecs/crates/ec-pgs" } ec-dvdsub = { path = "../../../edith_codecs/crates/ec-dvdsub" } ec-dvbsub = { path = "../../../edith_codecs/crates/ec-dvbsub" } # The software AV1 encoder, and the only new name in this list that was already # in the lock file: `ravif` pulls the very same rav1e 0.8.1 in through the image # crate, so this links what the build already compiled. BSD-2 with the AOM # patent grant. `asm` wants `nasm` at build time (this machine has nasm 3.x); it # is what makes the software export near realtime at 1080p (see `export::Enc::open_av1`). # `threading` is rayon inside rav1e itself. rav1e = { version = "0.8.1", default-features = false, features = ["threading", "asm"] } # The software HEVC encoder, intra-only: the project's own `ec-h265`, the seat # that replaces OxideAV's vendored intra encoder. Every picture is an IDR # carrying its own VPS/SPS/PPS -- an intraframe master, ProRes-shaped, large # files and all, the same file the old seat wrote -- and the wavefront inside # one picture (WPP, a worker per CTB row) spends every core on it, where the # old seat fanned one core across each of twelve frames in flight. The rate # knob stays a quality dial: the seat maps the bitrate row to a constant QP # ([`crate::export`]) and the encoder's own target-bits correction pass stays # unreached headroom. ec-h265 = { path = "../../../edith_codecs/crates/ec-h265" } # The HEVC bitstream syntax the encoder's config speaks -- the VUI types the # seat builds the SPS's colour description from. Same family, same workspace. ec-h265-syntax = { path = "../../../edith_codecs/crates/ec-h265-syntax" } # The ProRes encoder (`Format::ProRes`, [`crate::export`]): all six profiles, 10-bit, software. ec-prores = { path = "../../../edith_codecs/crates/ec-prores" } # The H.264 SPS parser, for the profile a stream states (`video_profile`). ec-h264-syntax = { path = "../../../edith_codecs/crates/ec-h264-syntax" } # Text in the picture (`crate::text`): the glyph rasteriser behind burned-in # captions and title cards. Pure Rust; default features stay on, because without # `std` (or `libm`) its rasteriser does not build. It reads the bundled TTF # straight out of `assets/fonts`. Its only dependencies are `ab_glyph_rasterizer` and # `owned_ttf_parser`, both small and pure Rust. ab_glyph = "0.2.29" # The system font database a caption's family name is looked up in (`crate::text::family_face`). # Already in the lock file through the GUI's text stack, so no new crate is compiled. fontdb = "0.23" # Script shaping for `crate::text`: Arabic joins, Devanagari reorders and forms # conjuncts, and the Thai and Hebrew faces need their own GSUB/GPOS. `rustybuzz` # is the HarfBuzz port ab_glyph has no door to. Pinned exactly: 0.20.1 is from # 2024-11-12, well past any two-week rule, and it is the version the lock file # already holds. rustybuzz = "=0.20.1" # The Unicode bidi algorithm (UAX #9), for the right-to-left runs of a line. 0.3.18 # (2024-12-16), already in the lock file. unicode-bidi = "=0.3.18" # Colour emoji: the system colour font's COLR layers are read straight off its # tables, and each layer's outline is rasterised here. Both are the versions # ab_glyph already pulls in, so no new crate is compiled. ttf-parser = "=0.25.1" ab_glyph_rasterizer = "=0.1.10"