Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

Merge remote-tracking branch 'upstream/main' into gap-mp2-decoder

vangel76bad190d234f6
diff --cc crates/codecs/src/audio.rs
index bc937efaa,daba8f4cd..dab8a49fe
--- a/crates/codecs/src/audio.rs
+++ b/crates/codecs/src/audio.rs
@@@ -20,6 -20,9 +20,9 @@@ enum Inner
Aac { dec: Box<filmcraft_aac::Decoder>, asc: Vec<u8>, up: Option<Box<Upsample2x>> },
/// AAC whose configuration arrives with the first frame (ADTS / LATM).
AacPending,
+ /// MPEG audio at this rate whose layer arrives with the first frame (MP4 / QuickTime name the
- /// codec, not the layer, and symphonia's decoder reads only the layer it was made for).
++ /// codec, not the layer; layers I / II go to our decoder, layer III to symphonia's).
+ MpegPending(u32),
/// Our own Opus decoder (always 48 kHz output; pre-skip is left to container timestamps).
/// `order` maps output channel → decoded channel (Vorbis → WAV/SMPTE order for surround).
Opus { dec: Box<filmcraft_opus::Decoder>, order: Option<&'static [usize]> },
diff --cc docs/codec-parity.md
index ecbf6d724,8aaa76551..a81b3e714
--- a/docs/codec-parity.md
+++ b/docs/codec-parity.md
@@@ -42,7 -42,7 +42,7 @@@ contents). Percent is ready-for-real-wo
| AAC (LC, HE, LATM) | decode + encode | own decoder (LC, HE core), LATM | own LC encoder | loudness oracle vs ffmpeg | 90% | 3–5 h |
| AC-3 | decode (licensed) | own decoder (ATSC A/52) | none | conformance | 80% | — |
| E-AC-3 (Dolby Digital Plus) | decode | own decoder (ATSC A/52 Annex E, #647): independent substream, 1–6 blocks, spectral extension; **no** adaptive hybrid transform, enhanced coupling or 7.1 dependent substreams (plays the 5.1 core) | none | SNR vs ffmpeg 65–91 dB (raw, MP4, MOV, Matroska, TS) | 75% | 10–20 h |
- | MP3 / MP2 | decode + MP3 encode | MP3: symphonia (MPL-2.0); MP1 / MP2: own decoder (ISO/IEC 11172-3 / 13818-3, #809), also the bit rate / mode combinations ffmpeg writes by default (mono 384 kbit/s) | **none** | MP1 / MP2: SNR vs ffmpeg 73–84 dB | 65% | 10–20 h (MP3 encoder) |
-| MP3 / MP2 | decode + MP3 encode | decode (symphonia, MPL-2.0; own MP2) in raw, MP4, MOV (#800), Matroska, TS, PS; **not** MP2 mono above 192 kbit/s or stereo below 64 kbit/s (ffmpeg's mono default; symphonia rejects them) | **none** | MP2 sample-exact vs ffmpeg (raw, MP4, MOV, TS, PS) | 60% | 10–20 h (MP3 encoder) |
++| MP3 / MP2 | decode + MP3 encode | MP3: symphonia (MPL-2.0); MP1 / MP2: own decoder (ISO/IEC 11172-3 / 13818-3, #809), also the bit rate / mode combinations ffmpeg writes by default (mono 384 kbit/s); in raw, MP4, MOV (#800), Matroska, TS, PS | **none** | MP1 / MP2: SNR vs ffmpeg 73–84 dB; MP2 in MP4 / MOV within 1e-4 of ffmpeg, also after a seek (#800) | 65% | 10–20 h (MP3 encoder) |
| Opus | — (not a Premiere import format) | own decoder, RFC 8251 range-exact | none | conformance vectors | ahead | — |
| FLAC, ALAC, Vorbis | partial | decode (symphonia); FLAC in MP4 silent (#603) | none | — | 70% | 3–6 h |
| WMA | decode on Windows | none | none | — | 0% | 10–20 h |
diff --cc docs/gaps.md
index fca996d6e,83fb12b36..b98c2a3eb
--- a/docs/gaps.md
+++ b/docs/gaps.md
@@@ -156,12 -156,13 +156,13 @@@ platforms** G4, G9, G17; **performance*
## G10. Container and codec gaps on import
- **Have:** E-AC-3 (Dolby Digital Plus) in MP4, MOV, Matroska and MPEG-TS (#647): independent
- substream, 1–6 blocks per syncframe, spectral extension. MP2 (MPEG audio layer II) in MP4 and
- MOV, sample-exact against ffmpeg (#800).
-- **Missing:** MP2 at bit rates ISO/IEC 11172-3 disallows: mono above 192 kbit/s (ffmpeg's default
- for mono MP2 is 384 kbit/s) and stereo below 64 kbit/s; the bootstrap decoder (symphonia, also
- 0.6) rejects every such frame, so the track plays silent: needs our own layer I/II decoder.
- E-AC-3 adaptive hybrid transform, enhanced coupling and the extra channels of 7.1 dependent
- substreams (played as the 5.1 core), AVI (#598; listed as an extension but no
+ substream, 1–6 blocks per syncframe, spectral extension. MP1 / MP2 (MPEG audio Layer I / II):
- own decoder (#809) in raw files, MPEG-TS / PS and Matroska, including the bit rate / mode
- combinations ISO/IEC 11172-3 disallows but ffmpeg writes (its mono default is 384 kbit/s).
++ own decoder (#809) in raw files, MP4 and MOV (#800), MPEG-TS / PS and Matroska, including the
++ bit rate / mode combinations ISO/IEC 11172-3 disallows but ffmpeg writes (its mono default is
++ 384 kbit/s).
+- **Missing:** free-format MPEG audio, MP1 in Matroska (`A_MPEG/L1`), E-AC-3 adaptive hybrid
+ transform, enhanced coupling and the extra channels of 7.1 dependent substreams (played as the
+ 5.1 core), AVI (#598; listed as an extension but no
demuxer), WMV / ASF, DV / DVCPRO / DV100, MPEG-4 Part 2, FLAC in MP4 (#603), camera RAW (R3D
incl. R3D NE, ARRIRAW, Sony RAW / X-OCN, Canon RAW, BRAW, ProRes RAW; #345, #383), JPEG 2000 /
JPEG XS MXF, Cinema DNG; stills: PSD, EXR, DPX, Targa, HEIF / HEIC, Radiance HDR, AI / EPS;