Skip to main content

Crate sheathe

Crate sheathe 

Source
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

ModuleCratePurpose
top levelsheathe-packageEnd-to-end package / probe / origin
coresheathe-coreMedia model: streams, samples, timing, errors
mp4sheathe-mp4ISO-BMFF / fMP4 / CMAF box writing + fragmentation
tssheathe-tsMPEG-2 TS demux + mux
essheathe-esRaw elementary stream demux
mkvsheathe-mkvWebM/Matroska (EBML) demux
textsheathe-textWebVTT + CEA-608/708
dashsheathe-dashMPEG-DASH .mpd generation
hlssheathe-hlsHLS master + media playlist generation
cryptosheathe-cryptoCommon 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§

ClosedCaption
One --closed_captions channel.
CpixConfig
CPIX document / SPEKE exchange.
EncryptionSpec
Raw-key content encryption for a package run.
FileSink
Local filesystem sink.
HttpOptions
TLS / HTTP options for push, CPIX, and Widevine.
HttpPushSink
HTTP/1.1 PUT sink — pushes each object to {base_url}/{relative}.
LabeledKey
A labeled raw key (--keys).
OriginConfig
Configuration for serve.
PackageKnobs
HLS / DASH / mux / DRM / IO knobs layered on crate::PackageOptions.
PackageOptions
Options controlling a package run.
PackageOutput
What a package run produced.
ProbeReport
Result of probe: the detected container and its streams.
ProbeStream
One stream discovered by probe.
Scte35Marker
A SCTE-35 cue placement relative to the presentation timeline.
StreamDescriptor
Per-stream overrides mirroring Shaka Packager stream_descriptor fields.
WidevineConfig
Widevine Common Encryption key-server request.

Enums§

DrmSystem
A DRM protection system a pssh box can be generated for.
EncScheme
A CENC protection scheme (the schm scheme_type).
PresentationMode
How the presentation should be signalled in DASH/HLS manifests.
SegmentFormat
Container / segment format for packaged media.
StreamSelector
Which tracks of an input to package.

Traits§

ObjectSink
Where packaged objects (segments, manifests) are written.

Functions§

build_splice_insert
Build a binary SCTE-35 splice_info_section for marker.
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=value descriptor.
probe
Inspect an input and report the container + streams sheathe detects, without writing anything. The library form of the sheathe probe CLI command.
read_input
Read an input path: plain filesystem, or udp://bind_host:port for a short live capture (collects datagrams for duration or 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 0x prefix (HLS SCTE35-OUT style).