edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | [package] |
| 2 | name = "engine" |
| 3 | version.workspace = true |
| 4 | edition.workspace = true |
| 5 | |
| 6 | [lib] |
| 7 | # No runnable doc examples; skip the rustdoc test pass. |
| 8 | doctest = false |
| 9 | |
| 10 | # No UI dependency here, ever: the engine must stay reusable across front-ends. |
| 11 | [dependencies] |
| 12 | bytemuck = "1.25" |
| 13 | # The WAV writer and reader, the family's own (`ec-riff`): RIFF for the usual |
| 14 | # sizes and RF64 past 4 GiB, WAVE_FORMAT_EXTENSIBLE for the layouts that need it. |
| 15 | # `ec-flac` encodes FLAC (RFC 9639), the family's own encoder. |
| 16 | ec-riff = { path = "../../../edith_codecs/crates/ec-riff" } |
| 17 | ec-flac = { path = "../../../edith_codecs/crates/ec-flac" } |
| 18 | # The noise reduction's STFT (`crate::voice`). Already in the lock file via ec-opus. |
| 19 | rustfft = "6.4" |
| 20 | # edith-stt speaks JSON lines ([`crate::speech`]); the server already builds this crate. |
| 21 | serde_json = "1" |
| 22 | # `libc` for the constants the hardware-encode child's parent reads (`SIGKILL`, |
| 23 | # `ExitStatus` signals) and for the tests and examples that use it directly. |
| 24 | # Not a new crate tree: it was already in this workspace's lock file. |
| 25 | libc = "0.2" |
| 26 | # `memfd_create` and `recvmsg` with `SCM_RIGHTS` for the hardware-encode child |
| 27 | # (`crate::hwproc`), through rustix's safe APIs: the shared staging buffer and the |
| 28 | # descriptors the child hands back. "fs" and "net" are the two features those take. |
| 29 | rustix = { version = "1", features = ["fs", "net", "process"] } |
| 30 | # `sendmsg` with `SCM_RIGHTS` for the hardware-encode child. rustix's send side |
| 31 | # takes `BorrowedFd`s, and the DMA-BUF descriptors the parent forwards are the |
| 32 | # raw ints a decoder frame owns, which no safe code can borrow; nix takes raw |
| 33 | # descriptors in a safe API. Already in the lock file (0.29.0), pulled in by |
| 34 | # the rest of the tree, so this line compiles nothing new. |
| 35 | nix = { version = "0.29", features = ["socket", "uio"] } |
| 36 | # Still images: `ec-image`, the family's own decoder (PNG, JPEG, WebP, GIF, BMP, |
| 37 | # TIFF), decodes every picture `decode::Still` places, reads the header-only |
| 38 | # EXIF orientation and size (`probe_reader`), and makes the quarter turn of a |
| 39 | # turned still (`transform`). The `image` crate is no longer a dependency. |
| 40 | ec-image = { path = "../../../edith_codecs/crates/ec-image" } |
| 41 | # The MP4/MOV demuxer and muxer. |
| 42 | ec-mp4 = { path = "../../../edith_codecs/crates/ec-mp4" } |
| 43 | # The MPEG transport stream demuxer (`.ts`, `.mts`, `.m2ts`): H.264, HEVC, MPEG-2, AAC, AC-3, MP2, MP3, LPCM, PGS. |
| 44 | ec-mpegts = { path = "../../../edith_codecs/crates/ec-mpegts" } |
| 45 | # The MPEG-1/2 video decoder (a software seat, always). |
| 46 | ec-mpeg2 = { path = "../../../edith_codecs/crates/ec-mpeg2" } |
| 47 | # (ec-prores, below, is also the decoder.) The intra-only professional picture codecs, each a software seat (`decode::prores`, |
| 48 | # `decode::dnxhd`, `decode::mjpeg`): Apple ProRes, Avid DNxHD/DNxHR, Motion JPEG. |
| 49 | ec-dnxhd = { path = "../../../edith_codecs/crates/ec-dnxhd" } |
| 50 | ec-mjpeg = { path = "../../../edith_codecs/crates/ec-mjpeg" } |
| 51 | # DV video (DV25, DVCPRO50, DVCPRO HD) with its audio and raw `.dv` files, and MPEG-4 Part 2 |
| 52 | # (Simple / Advanced Simple) with H.263: software seats (`decode::dv`, `decode::mpeg4`). |
| 53 | ec-dv = { path = "../../../edith_codecs/crates/ec-dv" } |
| 54 | ec-mpeg4 = { path = "../../../edith_codecs/crates/ec-mpeg4" } |
| 55 | # zlib, for the one Matroska `ContentEncodings` scheme that is not a byte off |
| 56 | # the front of every block: mkvmerge compressed subtitle tracks with it for |
| 57 | # years. `ec-inflate`, the family's own decoder, with a ceiling on the output. |
| 58 | ec-inflate = { path = "../../../edith_codecs/crates/ec-inflate" } |
| 59 | # The software H.264 seats, both of them the project's own: `ec-h264` (I/P/B |
| 60 | # encode, CAVLC and CABAC, full DPB decode, weighted prediction, in-loop |
| 61 | # deblocking), bit-exact against the JVT conformance suite. The decode seat |
| 62 | # moved on 2026-09-12; the encode seat followed the same day, which retired the |
| 63 | # last of `rusty_h264` -- whose `rusty_h264-common` installed its authors' |
| 64 | # `rusty_alloc`, a pure-Rust mimalloc remake, as the process-wide |
| 65 | # `#[global_allocator]` of whatever application linked it, no downstream |
| 66 | # feature choice being able to decline it, and that allocator segfaulted the |
| 67 | # editor on a new decode-worker thread's first allocation (2026-08-13). It had |
| 68 | # been survivable only through a vendored patch, which is gone with the crate. |
| 69 | # |
| 70 | # Decode throughput, measured at the decode swap (demux+decode, no render, best |
| 71 | # of three warm passes, otherwise idle machine): 1.5x `rusty_h264` on a 1080p |
| 72 | # Main export and a 4K Main render, 1.0x on a 1440p High screen recording, |
| 73 | # 1.17x on a CAVLC Baseline fixture; 0.80x on the two B-picture CABAC streams |
| 74 | # measured (a 720p High fixture and a 720p Blu-ray episode) -- the price of the |
| 75 | # full DPB the old seat skipped with its decode-order corner-cut, which |
| 76 | # scrambled exactly those streams. It hands pictures back in display order, |
| 77 | # which is what every reader of `frame.index` already assumed (the hardware |
| 78 | # backend always did). |
| 79 | ec-h264 = { path = "../../../edith_codecs/crates/ec-h264" } |
| 80 | # Its shared IR (packets, frames, the registry decoder contract the seat is |
| 81 | # written against), direct because decode.rs names those types itself. |
| 82 | ec-core = { path = "../../../edith_codecs/crates/ec-core" } |
| 83 | # The AAC seat, both ways: every AAC stream edith decodes -- mono to 7.1, LC and |
| 84 | # HE-AAC, from mp4, Matroska or ADTS -- goes through this decoder. symphonia's |
| 85 | # refuses HE-AAC outright ("aac: aac too complex", `aac/mod.rs:91-96`), so its |
| 86 | # AAC decoder is not in the tree at all. 5.1 and 7.1 come back already reordered |
| 87 | # into FL, FR, FC, LFE, BL, BR, the order the downmix in `audio` folds. It is |
| 88 | # also the *encode* seat: every re-encoded track's sound leaves through |
| 89 | # `export.rs`'s `encode_audio` on this encoder. |
| 90 | ec-aac = { path = "../../../edith_codecs/crates/ec-aac" } |
| 91 | # The software AV1 decode seat, the project's own: a whole AV1 decoder |
| 92 | # (entropy, prediction, transforms, loop filters, film grain) with no |
| 93 | # third-party codec library under it, the same claim `ec-h264` makes for H.264. |
| 94 | # The seat decodes one GOP chunk at a time off the demuxer's reassembled OBU |
| 95 | # stream (`decode::run_av1`), so peak memory is one output picture plus the |
| 96 | # reference bank, and seeks stay the demuxer's job. |
| 97 | ec-av1 = { path = "../../../edith_codecs/crates/ec-av1" } |
| 98 | # The software VP9 decode seat, the project's own: `ec-vp9`, every frame of a |
| 99 | # profile 0 or 2 stream decoded in this process (`decode::vp9`). It is handed one |
| 100 | # block or superframe at a time, the way the demuxer already delivers them, so the |
| 101 | # span needs no reassembly and seeks stay the demuxer's job. |
| 102 | ec-vp9 = { path = "../../../edith_codecs/crates/ec-vp9" } |
| 103 | # The software VP8 decode seat, the project's own: `ec-vp8` (RFC 6386), every |
| 104 | # frame of a stream, the same role `ec-vp9` plays for VP9. |
| 105 | ec-vp8 = { path = "../../../edith_codecs/crates/ec-vp8" } |
| 106 | # The MP3 encode seat, the family's own: MPEG-1/2/2.5 Layer III, CBR and true |
| 107 | # VBR (a quality in [0, 1] whose mean tracks its own bitrate ladder), with a |
| 108 | # Xing/Info gapless header whose delay/padding fields are *measured* correct. |
| 109 | # It took the seat the registry crate `rusty_mp3` held -- same public shape |
| 110 | # (`Mp3EncoderConfig { bitrate_kbps, vbr_quality }`, push/finish/next_packet), |
| 111 | # which is why the swap stops at this line and the use sites. The decoder side |
| 112 | # of mp3 is symphonia's below -- an mp3 has always been importable here, and |
| 113 | # until 2026-08 this was the one format the editor could read and never write. |
| 114 | ec-mp3 = { path = "../../../edith_codecs/crates/ec-mp3" } |
| 115 | # The Vorbis encode seat, the family's own: a full Vorbis I encoder -- its own |
| 116 | # floor fit, residue quantiser and per-stream codebooks, block switching |
| 117 | # included -- where the registry crates with encoders are either C bindings |
| 118 | # (`vorbis_rs`, `vorbis-encoder`: the project's no-install rule forbids both) |
| 119 | # or bitstream writers with no analysis stage at all (`oxideav-vorbis`, whose |
| 120 | # own manifest calls itself an "orphan-rebuild scaffold"). It took the seat the |
| 121 | # first permissively-licensed pure-Rust encoder, `rusty_vorbis`, held. The old |
| 122 | # seat emitted long blocks only and numbered its first packet a hop early, so |
| 123 | # [`crate::export::write_ogg`] carried a pre-roll and two granule corrections |
| 124 | # around it; this one reports spec granules and clamps its final one to the |
| 125 | # sample count fed, which let the workaround go. See [`crate::export::write_ogg`] |
| 126 | # for the measurement that decided it. |
| 127 | ec-vorbis = { path = "../../../edith_codecs/crates/ec-vorbis" } |
| 128 | # Symphonia has no Opus at any version -- its codec features stop at ALAC, FLAC and MP3 and |
| 129 | # there is no `symphonia-codec-opus` crate -- while both of its containers *read* |
| 130 | # the format already: `A_OPUS` and `OpusHead` have always mapped to |
| 131 | # `CODEC_ID_OPUS`. The decoder was the one missing half, and the reason a 5.1 |
| 132 | # Opus film played silent while its picture was fine. |
| 133 | # |
| 134 | # Both Opus seats are `ec-opus`, the codec family built in the sibling |
| 135 | # workspace this checkout expects beside it (`edith_codecs`): the multistream |
| 136 | # decoder a surround track needs -- a 5.1 packet is four elementary Opus |
| 137 | # streams, all but the last **self-delimited** (RFC 6716 App. B), and this one |
| 138 | # strips that framing per stream -- and the CELT encoder the export seat codes |
| 139 | # with. The path is the first edge across that workspace boundary, and a path |
| 140 | # is the whole story: the family is not a registry crate, so there is no |
| 141 | # version to pin -- the working tree is exactly as pinned as a decoder that is |
| 142 | # a bit-exactness dependency can be. |
| 143 | # |
| 144 | # What it replaced, and why the move is measured rather than hoped for: |
| 145 | # `ruopus 0.1.2` decoded (it matched ffmpeg's own decode of a real 5.1 Opus |
| 146 | # remux to correlation 1.0000 on all six channels) but ran the export |
| 147 | # fidelity path's stereo decode at 0.2x real time (measured, 24.2 s for 121.5 s |
| 148 | # of stereo), and `opus-rs 0.1.26` encoded -- into packets that only |
| 149 | # its own decoder read back above roughly 165 kbps stereo, the edge moving with |
| 150 | # the content (correlation 0.06 at 256 kbps against the source; its own round |
| 151 | # trip read 0.9999 at 160), and mono worse still at every rate. That is what |
| 152 | # held [`crate::export::OPUS_MAX_KBPS`] at 128 and a mono mix on the AAC path. |
| 153 | # Both replaced seats are measured where they used to fail: `export::tests` |
| 154 | # round-trips the top of the new band and the mono path, and |
| 155 | # `tests/opus_export.rs` exports and re-reads the files through this project's |
| 156 | # own decoder door. |
| 157 | ec-opus = { path = "../../../edith_codecs/crates/ec-opus" } |
| 158 | # The AC-3 / E-AC-3 decode seat, the family's own decoder taking the seat the |
| 159 | # registry crate `oxideav-ac3` held. One decoder reads both syntaxes, dispatching |
| 160 | # per packet on `bsid`, and hands back interleaved f32 in the coded layout or -- |
| 161 | # what the seat asks for on anything wider than mono -- its own A/52 §7.8.2 |
| 162 | # stereo fold, per-position coefficients from the frame's own `acmod` and mix |
| 163 | # levels: the same shape and the same loudness the old seat served. One named |
| 164 | # coverage edge, witnessed, not silent: Annex E dependent substreams and |
| 165 | # enhanced coupling (7.1 DD+ assembled as 5.1-plus-dependents) are refused by |
| 166 | # name where `oxideav-ac3` walked them; every single-substream AC-3 and E-AC-3 |
| 167 | # track decodes. |
| 168 | ec-ac3 = { path = "../../../edith_codecs/crates/ec-ac3" } |
| 169 | # The Dolby TrueHD and MLP decode seat, the family's own: `ec-truehd`, the |
| 170 | # lossless substream decode bit-exact against ffmpeg. Every access unit is one |
| 171 | # Matroska block and comes back as S32 at the rate and layout of its major sync. |
| 172 | # It hands out the highest presentation the unit carries (7.1 where the stream |
| 173 | # has it, else 5.1, else stereo); the audio worker folds that to the pair the |
| 174 | # timeline carries, as it does for every multichannel source. An Atmos track's |
| 175 | # 4th (object) substream is refused by name by the decoder, and so is the open. |
| 176 | ec-truehd = { path = "../../../edith_codecs/crates/ec-truehd" } |
| 177 | # DTS core / XCH / X96 decode (`ec-dts`) and the family's audio reader and codec |
| 178 | # registry (`ec-probe`: IMA/MS ADPCM, ima4, A-law, mu-law, AMR-NB/WB, and the |
| 179 | # mp4 / Matroska / WAVE / raw readers that carry them), seated in `extaudio`. |
| 180 | ec-dts = { path = "../../../edith_codecs/crates/ec-dts" } |
| 181 | ec-probe = { path = "../../../edith_codecs/crates/ec-probe" } |
| 182 | # The Ogg container, the family's own: `ec-ogg`, the RFC 3533 demuxer and muxer |
| 183 | # with the Vorbis, Opus (RFC 7845) and FLAC mappings. `xiph_lace` builds the |
| 184 | # three-header blob and the muxer pages those ahead of the audio, which is the |
| 185 | # encapsulation order a Vorbis decoder needs and the part that is easy to get |
| 186 | # wrong by hand. |
| 187 | ec-ogg = { path = "../../../edith_codecs/crates/ec-ogg" } |
| 188 | symphonia-core = "0.6" |
| 189 | # The umbrella crate for the standalone audio files: one dependency instead of |
| 190 | # seven, and its `default::get_probe`/`get_codecs` are the registries this would |
| 191 | # otherwise hand-build. Explicit feature list rather than the default one -- no |
| 192 | # ape, no adpcm: what is listed here is exactly what `is_audio` admits, plus |
| 193 | # `mkv`, which is not an `is_audio` container at all -- it is how the *sound* of |
| 194 | # a Matroska video file is read, the picture having its own demuxer here. |
| 195 | # There is no opus/ac3/dts feature at any symphonia version: AC-3 comes from |
| 196 | # `ec-ac3` and Opus from `ec-opus` above, both plugged into this crate's |
| 197 | # own readers, and DTS is the one that really is refused. |
| 198 | symphonia = { version = "0.6", default-features = false, features = [ |
| 199 | "alac", |
| 200 | "flac", |
| 201 | "id3v1", |
| 202 | "id3v2", |
| 203 | "isomp4", |
| 204 | "mkv", |
| 205 | "mp3", |
| 206 | "ogg", |
| 207 | "pcm", |
| 208 | "wav", |
| 209 | ] } |
| 210 | # The family's own subtitle parsers: SRT and WebVTT in `ec-subs`, ASS/SSA in |
| 211 | # `ec-ass` (which shares its cue IR), and the PGS picture decoder in `ec-pgs`. |
| 212 | # Pure Rust, and nothing here draws a cue yet (see `crate::subtitle`), so no |
| 213 | # rendering stack comes in with them. |
| 214 | ec-subs = { path = "../../../edith_codecs/crates/ec-subs" } |
| 215 | # Closed captions (CEA-608/708) out of the picture track's SEI / user data: the embedded caption tracks |
| 216 | # `demux::captions` lists and imports beside the container's own subtitle tracks. |
| 217 | ec-cc = { path = "../../../edith_codecs/crates/ec-cc" } |
| 218 | ec-ass = { path = "../../../edith_codecs/crates/ec-ass" } |
| 219 | ec-pgs = { path = "../../../edith_codecs/crates/ec-pgs" } |
| 220 | ec-dvdsub = { path = "../../../edith_codecs/crates/ec-dvdsub" } |
| 221 | ec-dvbsub = { path = "../../../edith_codecs/crates/ec-dvbsub" } |
| 222 | # The software AV1 encoder, and the only new name in this list that was already |
| 223 | # in the lock file: `ravif` pulls the very same rav1e 0.8.1 in through the image |
| 224 | # crate, so this links what the build already compiled. BSD-2 with the AOM |
| 225 | # patent grant. `asm` wants `nasm` at build time (this machine has nasm 3.x); it |
| 226 | # is what makes the software export near realtime at 1080p (see `export::Enc::open_av1`). |
| 227 | # `threading` is rayon inside rav1e itself. |
| 228 | rav1e = { version = "0.8.1", default-features = false, features = ["threading", "asm"] } |
| 229 | # The software HEVC encoder, intra-only: the project's own `ec-h265`, the seat |
| 230 | # that replaces OxideAV's vendored intra encoder. Every picture is an IDR |
| 231 | # carrying its own VPS/SPS/PPS -- an intraframe master, ProRes-shaped, large |
| 232 | # files and all, the same file the old seat wrote -- and the wavefront inside |
| 233 | # one picture (WPP, a worker per CTB row) spends every core on it, where the |
| 234 | # old seat fanned one core across each of twelve frames in flight. The rate |
| 235 | # knob stays a quality dial: the seat maps the bitrate row to a constant QP |
| 236 | # ([`crate::export`]) and the encoder's own target-bits correction pass stays |
| 237 | # unreached headroom. |
| 238 | ec-h265 = { path = "../../../edith_codecs/crates/ec-h265" } |
| 239 | # The HEVC bitstream syntax the encoder's config speaks -- the VUI types the |
| 240 | # seat builds the SPS's colour description from. Same family, same workspace. |
| 241 | ec-h265-syntax = { path = "../../../edith_codecs/crates/ec-h265-syntax" } |
| 242 | # The ProRes encoder (`Format::ProRes`, [`crate::export`]): all six profiles, 10-bit, software. |
| 243 | ec-prores = { path = "../../../edith_codecs/crates/ec-prores" } |
| 244 | # The H.264 SPS parser, for the profile a stream states (`video_profile`). |
| 245 | ec-h264-syntax = { path = "../../../edith_codecs/crates/ec-h264-syntax" } |
| 246 | # Text in the picture (`crate::text`): the glyph rasteriser behind burned-in |
| 247 | # captions and title cards. Pure Rust; default features stay on, because without |
| 248 | # `std` (or `libm`) its rasteriser does not build. It reads the bundled TTF |
| 249 | # straight out of `assets/fonts`. Its only dependencies are `ab_glyph_rasterizer` and |
| 250 | # `owned_ttf_parser`, both small and pure Rust. |
| 251 | ab_glyph = "0.2.29" |
| 252 | # The system font database a caption's family name is looked up in (`crate::text::family_face`). |
| 253 | # Already in the lock file through the GUI's text stack, so no new crate is compiled. |
| 254 | fontdb = "0.23" |
| 255 | # Script shaping for `crate::text`: Arabic joins, Devanagari reorders and forms |
| 256 | # conjuncts, and the Thai and Hebrew faces need their own GSUB/GPOS. `rustybuzz` |
| 257 | # is the HarfBuzz port ab_glyph has no door to. Pinned exactly: 0.20.1 is from |
| 258 | # 2024-11-12, well past any two-week rule, and it is the version the lock file |
| 259 | # already holds. |
| 260 | rustybuzz = "=0.20.1" |
| 261 | # The Unicode bidi algorithm (UAX #9), for the right-to-left runs of a line. 0.3.18 |
| 262 | # (2024-12-16), already in the lock file. |
| 263 | unicode-bidi = "=0.3.18" |
| 264 | # Colour emoji: the system colour font's COLR layers are read straight off its |
| 265 | # tables, and each layer's outline is rasterised here. Both are the versions |
| 266 | # ab_glyph already pulls in, so no new crate is compiled. |
| 267 | ttf-parser = "=0.25.1" |
| 268 | ab_glyph_rasterizer = "=0.1.10" |