mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-14 06:22:24 +00:00
* craft-video: MPEG-2 and MPEG-1 video decoder from FilmCraft (`mpeg2`) FilmCraft's crates/mpeg2v at 4bec22bd moves to craft_video::mpeg2 behind the decoder-only feature `mpeg2`: sources, README and tests (unit, synthetic streams checked by ffmpeg, the ffmpeg oracle fixtures, hostile sweeps). Changes in the move: craft-media-testkit instead of filmcraft-testkit, one test target (tests/mpeg2), crate paths, rustfmt at this repo's width. New: a memory budget (Decoder::set_memory_budget, craft_video::budget) checked when a sequence becomes active, and a mutation test over the synthetic field-picture, 16x8 and dual-prime streams, which ffmpeg's encoder cannot produce and the hostile sweep therefore never reached. * craft-video mpeg2: write the restart check without a negated conjunction (clippy nonminimal_bool)
craft-video
Clean-room pure-Rust video codecs for the Craft apps, one feature per codec: DNxHD/DNxHR, VP8, ProRes and H.264.
- Input and output are byte slices and planar sample buffers; the crate opens no files itself and performs no filesystem I/O.
- Implemented from published standards and RFCs (SMPTE ST 2019-1, RFC 6386, SMPTE RDD 36 and ITU-T H.264).
- Tested against ffmpeg as an external oracle with roundtrips, hostile fuzzing, and conformance vectors.
No
unsafe, no panics on corrupt streams. Builds forwasm32-unknown-unknown. - Containers (MP4/MOV, Matroska/WebM), bit-level I/O (
craft_media::bitstream) and shared identifiers (CodecId,CodecParams) come fromcraft-media.
Cargo features
No codec feature is on by default.
| Feature | Module | Codec |
|---|---|---|
dnx |
dnx |
Avid DNxHD / DNxHR (SMPTE ST 2019-1 VC-3): decoder and encoder |
apv |
apv |
APV (Advanced Professional Video, RFC 9924): decoder (apv-decode alone) and encoder (apv-encode alone) |
vp8 |
vp8 |
VP8 (RFC 6386): decoder |
mpeg2 |
mpeg2 |
MPEG-2 video (ITU-T H.262) and MPEG-1 video (ISO/IEC 11172-2): decoder |
prores |
prores |
Apple ProRes (SMPTE RDD 36): decoder and encoder |
h264 |
h264 |
ITU-T H.264 / AVC: decoder (h264-decode alone) and encoder (h264-encode alone) |
hevc |
hevc |
ITU-T H.265 / HEVC: decoder (hevc-decode alone) and encoder (hevc-encode alone) |
vp9 |
vp9 |
VP9: decoder (vp9-decode alone) and encoder (vp9-encode alone) |
av1 |
av1 |
AV1 (AOMedia Video 1): encoder |
threads |
— | Multi-threaded slice/row parallelism via rayon |