moq_video/encode/mod.rs
1//! Encode captured video and publish it as a moq video track.
2//!
3//! The output codec is selected via [`Codec`] (H.264 or H.265); see its docs
4//! for which backends cover each on this platform.
5//!
6//! Entry points, high to low level:
7//! - [`publish_capture`] captures and publishes a webcam (turnkey).
8//! - [`Encoder`] encodes raw [`Frame`](crate::Frame)s you supply into
9//! [`Encoded`] access units, and [`Producer`] publishes those (bring your own
10//! frames). Build both for the same [`Codec`].
11//! - [`Sink`] is an [`Encoder`] that owns the thread it runs on, for an encoder
12//! outliving a single thread's stack (a shared object, an FFI handle, a task
13//! that migrates between workers).
14//! - [`Producer`] alone publishes frames you already encoded.
15//!
16//! [`Options`] / [`Kind`] / [`Config`] configure them. The decode/consume
17//! counterpart (mirror of `moq-audio`'s consumer) lives in the sibling
18//! [`decode`](crate::decode) module.
19//!
20//! [`rate`] holds the policy mapping a congestion-control bandwidth estimate
21//! onto the encoder's bitrate, which [`publish_capture`] drives for you.
22
23mod backend;
24mod encoded;
25mod encoder;
26mod producer;
27mod sink;
28
29pub mod rate;
30
31pub use encoded::Encoded;
32pub use encoder::{Codec, Config, Encoder, Kind};
33pub use producer::{Options, Producer, publish_capture};
34pub use sink::Sink;