Expand description
§sheathe — pure-Rust HLS / DASH / CMAF media packager
This is the facade crate for the sheathe workspace. It re-exports the
packaging pipeline (package, probe, serve_origin) and each
format crate as a module so you can depend on a single sheathe crate
instead of a dozen sheathe-* crates.
The command-line tool lives in the separate sheathe-cli crate, which
installs a sheathe binary: cargo install sheathe-cli.
§Quick start
use sheathe::{package, PackageOptions};
use std::path::PathBuf;
let opts = PackageOptions {
out_dir: PathBuf::from("out"),
dash: true,
hls: true,
segment_duration: 6.0,
..Default::default()
};
let output = package(&[PathBuf::from("movie.mp4")], &opts).unwrap();§Modules
| Module | Crate | Purpose |
|---|---|---|
| top level | sheathe-package | End-to-end package / probe / origin |
core | sheathe-core | Media model: streams, samples, timing, errors |
mp4 | sheathe-mp4 | ISO-BMFF / fMP4 / CMAF box writing + fragmentation |
ts | sheathe-ts | MPEG-2 TS demux + mux |
es | sheathe-es | Raw elementary stream demux |
mkv | sheathe-mkv | WebM/Matroska (EBML) demux |
text | sheathe-text | WebVTT + CEA-608/708 |
dash | sheathe-dash | MPEG-DASH .mpd generation |
hls | sheathe-hls | HLS master + media playlist generation |
crypto | sheathe-crypto | Common Encryption (cenc / cbcs) |
Re-exports§
pub use sheathe_core as core;pub use sheathe_crypto as crypto;pub use sheathe_dash as dash;pub use sheathe_es as es;pub use sheathe_hls as hls;pub use sheathe_mkv as mkv;pub use sheathe_mp4 as mp4;pub use sheathe_text as text;pub use sheathe_ts as ts;
Modules§
- descriptor
- Shaka-style stream descriptors (
in=file,stream=audio,language=eng,…). - io
- Output sinks and input sources for packaging (Phase 5 IO backends).
- knobs
- Extra packaging knobs that map 1:1 onto Shaka Packager flags.
- origin
- JIT / origin mode — package on HTTP request (Phase 5).
Structs§
- Closed
Caption - One
--closed_captionschannel. - Cpix
Config - CPIX document / SPEKE exchange.
- Encryption
Spec - Raw-key content encryption for a
packagerun. - File
Sink - Local filesystem sink.
- Http
Options - TLS / HTTP options for push, CPIX, and Widevine.
- Http
Push Sink - HTTP/1.1 PUT sink — pushes each object to
{base_url}/{relative}. - Labeled
Key - A labeled raw key (
--keys). - Origin
Config - Configuration for
serve. - Package
Knobs - HLS / DASH / mux / DRM / IO knobs layered on
crate::PackageOptions. - Package
Options - Options controlling a
packagerun. - Package
Output - What a
packagerun produced. - Probe
Report - Result of
probe: the detected container and its streams. - Probe
Stream - One stream discovered by
probe. - Scte35
Marker - A SCTE-35 cue placement relative to the presentation timeline.
- Stream
Descriptor - Per-stream overrides mirroring Shaka Packager stream_descriptor fields.
- Widevine
Config - Widevine Common Encryption key-server request.
Enums§
- DrmSystem
- A DRM protection system a
psshbox can be generated for. - EncScheme
- A CENC protection scheme (the
schmscheme_type). - Presentation
Mode - How the presentation should be signalled in DASH/HLS manifests.
- Segment
Format - Container / segment format for packaged media.
- Stream
Selector - Which tracks of an input to package.
Traits§
- Object
Sink - Where packaged objects (segments, manifests) are written.
Functions§
- build_
splice_ insert - Build a binary SCTE-35
splice_info_sectionformarker. - describe
- One-line human description of a stream (re-exported for CLI/probe use).
- dump_
stream - Multi-line dump of one probed stream, modelled on Shaka Packager
--dump_stream_info. - package
- Package one or more inputs into CMAF segments + DASH and/or HLS manifests under
opts.out_dir. - parse_
descriptor - Parse a Shaka stream_descriptor string.
- parse_
input_ arg - Parse a CLI argument: a filesystem path, or a Shaka
key=value,key=valuedescriptor. - probe
- Inspect an input and report the container + streams sheathe detects, without
writing anything. The library form of the
sheathe probeCLI command. - read_
input - Read an input path: plain filesystem, or
udp://bind_host:portfor a short live capture (collects datagrams fordurationor until ~4 MiB). - scheme_
str - Human-readable name for a
Scheme(matches the CLI/DASH spelling). - serve_
origin - Run the origin until the process is killed. Spawns one thread per connection.
- to_
base64 - Standard base64 (no padding strip) for DASH Event message data.
- to_
hex_ 0x - Hex encoding with a
0xprefix (HLSSCTE35-OUTstyle).