Expand description
Encode captured video and publish it as a moq video track.
The output codec is selected via Codec (H.264 or H.265); see its docs
for which backends cover each on this platform.
Entry points, high to low level:
publish_capturecaptures and publishes a webcam (turnkey).Encoderencodes rawFrames you supply intoEncodedaccess units, andProducerpublishes those (bring your own frames). Build both for the sameCodec.Sinkis anEncoderthat owns the thread it runs on, for an encoder outliving a single thread’s stack (a shared object, an FFI handle, a task that migrates between workers).Produceralone publishes frames you already encoded.
Options / Kind / Config configure them. The decode/consume
counterpart (mirror of moq-audio’s consumer) lives in the sibling
decode module.
rate holds the policy mapping a congestion-control bandwidth estimate
onto the encoder’s bitrate, which publish_capture drives for you.
Modules§
- rate
- Rate control: turning a congestion-control bandwidth estimate into the bitrate the encoder should actually produce at.
Structs§
- Config
- Encoder configuration.
width/height/framerateare the encoded output; input frames must already be at this resolution. - Encoded
- One encoded video frame: a whole access unit in the codec’s wire framing
(Annex-B with in-band parameter sets), plus the presentation time of the raw
Frameit came from. - Encoder
- Video encoder. Build one with
Encoder::new, feed it rawFrames viaencode, and publish the resultingEncodedaccess units through aProducerbuilt for the sameCodec. - Options
- Source-agnostic encode knobs for
publish_capture, where the geometry (width / height / framerate) comes from the capture source, not the caller. For the bring-your-own-framesEncoderpath, where you must specify geometry, useConfiginstead. - Producer
- Publishes encoded video frames as a moq track (avc3 / hev1 depending on the codec).
- Sink
- An
Encoderconfined to one thread, driven from anywhere.
Enums§
- Codec
- Output video codec.
#[non_exhaustive]so new codecs can be added without breaking externalmatches. - Kind
- Which encoder implementation to use.
#[non_exhaustive]so new selection strategies can be added without breaking externalmatches.
Functions§
- publish_
capture - Capture a webcam and publish it as an on-demand video track.