Skip to main content

Module encode

Module encode 

Source
Expand description

Encode captured video and publish it as a moq H.264 track.

Entry points, high to low level:

  • publish_capture captures and publishes a webcam (turnkey).
  • Encoder H.264-encodes raw RGBA frames you supply, and Producer publishes the resulting packets (bring your own frames).
  • Producer alone publishes H.264 you already encoded.

Options / Kind / Config configure them. The decode/consume counterpart (mirror of moq-audio’s consumer) will land in a sibling decode module.

Structs§

Config
Encoder configuration. width / height / framerate are the encoded output; input frames are scaled/converted to match.
Encoder
H.264 encoder. Build one with Encoder::new, feed it raw RGBA frames via encode_rgba, and publish the resulting Annex-B packets through Producer.
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-frames Encoder path, where you must specify geometry, use Config instead.
Producer
Publishes encoded H.264 frames as an avc3 moq track.

Enums§

Kind
Which encoder implementation to use. #[non_exhaustive] so new selection strategies can be added without breaking external matches.

Functions§

publish_capture
Capture a webcam and publish it as on-demand H.264.