mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-14 22:42:46 +00:00
Write AVI files: hdrl with avih and one strl (strh, strf, strn, indx) per stream, odml/dmlh, an interleaved movi and idx1. Past the RIFF limit (default 1 GiB) the file continues in OpenDML RIFF AVIX extensions with ix## standard indexes and an indx super index per stream. - VideoSpec::for_codec builds the stream from CodecParams; MPEG-4 Part 2 is tagged FMP4. - Audio is timed by bytes (PCM-style) or one packet per chunk. - Bad options and chunks are errors; finish() closes a readable file after a failed write. Tests read the files back through this crate's demuxer by every index, and through ffmpeg (decode identical to the sources, seeks through the index, ffprobe fields), in one RIFF and across AVIX extensions. The MPEG-4 encoder tests play its packets from an AVI file.
85 lines
1.9 KiB
TOML
85 lines
1.9 KiB
TOML
[package]
|
|
name = "craft-media"
|
|
description = "Bit-level I/O, clean-room ISO BMFF (MP4), QuickTime (MOV) and Matroska (MKV, WebM) and MXF demuxers and muxers, and Ogg, AVI and MPEG-TS/PS demuxers."
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
repository.workspace = true
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = ["isobmff"]
|
|
bitstream = []
|
|
isobmff = ["bitstream", "dep:thiserror"]
|
|
matroska = []
|
|
# AVI (RIFF) and OpenDML demuxer and muxer (`craft_media::avi`).
|
|
avi = []
|
|
# MXF demuxer and writer (`craft_media::mxf`); the writer formats dates with chrono.
|
|
mxf = ["dep:chrono"]
|
|
# MPEG-2 Systems demuxer: transport streams and program streams (`craft_media::mpegts`).
|
|
mpegts = []
|
|
# Ogg demuxer (Ogg Opus and Vorbis mapping, `craft_media::ogg`).
|
|
ogg = []
|
|
# Serialize and Deserialize for `Container`, `CodecId`, `CodecParams` and `PcmFormat`.
|
|
serde = ["dep:serde"]
|
|
|
|
[dependencies]
|
|
thiserror = { workspace = true, optional = true }
|
|
serde = { workspace = true, optional = true }
|
|
chrono = { workspace = true, optional = true }
|
|
|
|
[dev-dependencies]
|
|
craft-media-testkit = { workspace = true }
|
|
proptest = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
|
|
[[test]]
|
|
name = "fuzz"
|
|
required-features = ["isobmff"]
|
|
|
|
[[test]]
|
|
name = "fuzz_matroska"
|
|
required-features = ["matroska"]
|
|
|
|
[[test]]
|
|
name = "oracle_avi"
|
|
required-features = ["avi"]
|
|
|
|
[[test]]
|
|
name = "oracle_avi_mux"
|
|
required-features = ["avi"]
|
|
|
|
[[test]]
|
|
name = "oracle_demux"
|
|
required-features = ["isobmff"]
|
|
|
|
[[test]]
|
|
name = "oracle_matroska"
|
|
required-features = ["matroska"]
|
|
|
|
[[test]]
|
|
name = "oracle_mpegts"
|
|
required-features = ["mpegts"]
|
|
|
|
[[test]]
|
|
name = "oracle_mux"
|
|
required-features = ["isobmff"]
|
|
|
|
[[test]]
|
|
name = "oracle_mxf"
|
|
required-features = ["mxf"]
|
|
|
|
[[test]]
|
|
name = "oracle_ogg"
|
|
required-features = ["ogg"]
|
|
|
|
[[test]]
|
|
name = "roundtrip"
|
|
required-features = ["isobmff"]
|