mediaway 0.2.1

Convenience pipeline layer — composes encoder + container (+ device capture)
docs.rs failed to build mediaway-0.2.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

mediaway

Status: early development (0.x). Not recommended for production; public APIs may change without notice. Part of the Mediaway media stack.

The Mediaway convenience pipeline: composes encoder + container (+ device capture for input) so apps don't hand-roll the encoder → muxer poll loop. EncodeSession wraps an encoder and a muxer (fragmented MP4 by default; any MuxOpen container via open_in) behind write_frame/finish, FrameFilter gives you a mid-pipeline transform hook, and platform auto-selects the best available backend per OS. The low-level traits stay fully public and reachable without this crate.

Quick start

use mediaway::{platform, EncodeSession};
use mediaway_common::{CodecKind, Rational};
use mediaway_encoder::auto::AutoVideoEncodeConfig;

let config = AutoVideoEncodeConfig {
    bitrate_bps: 8_000_000,
    ..AutoVideoEncodeConfig::new(CodecKind::H264, 1920, 1080, Rational::new(1, 30))
};

let encoder = platform::AutoEncoder::open(&config)?; // per-OS backend selection
let mut session = EncodeSession::open(encoder)?;

session.write_frame(&nv12_frame)?;
let mp4_bytes = session.finish()?; // flush + mux flush + poll_bytes
// Long capture? Call `session.poll_bytes()` as you go and `finish_into(sink)` at the end,
// so memory is bounded by poll cadence instead of recording length.

Status

Status marks: ✅ first-class (tests for claimed scope) · ⚡ Zero-Copy path (no payload copy; implies ✅) · 🆗 best-effort / prototype · 🛠️ planned · ❌ attempted and genuinely blocked · 👻 not exercisable yet (no hardware / device / session available)

Pipeline features (OS-independent)

Area Status Notes
EncodeSession<E, M> (open / write_frame / finish) ✅ Video track; optional second audio track via open_with_audio. open / open_with_audio write fragmented MP4; open_in / open_in_with_audio take any MuxOpen muxer (e.g. webm::Muxer, or mp4::Muxer::with_fragment_batch)
EncodeSession::poll_bytes / finish_into ✅ Drain container bytes during the session — memory bounded by poll cadence, not duration (ADR-0006)
FrameFilter mid-pipeline hook ✅ CPU frames; GPU-backed frames fail loudly (GpuFrameUnsupported)
APM / VAD wiring (AEC3 + NS + AGC2, RNN VAD) ✅ attach_audio_processor / attach_vad / poll_vad_score

platform auto-dispatch by OS

platform::AutoEncoder / AutoDecoder / ScreenCapture / WindowCapture / Microphone / DesktopAudio auto-select the best backend per OS. ❌ NoBackend means the capability isn't wired into platform yet — reach the backend module directly (e.g. mediaway_encoder::web) instead.

Capability Windows Linux Web (wasm) Other (macOS / Android)
AutoEncoder::open ✅ windows::auto (path selection: Zero-Copy → CPU upload; WMF H.264/AAC, NVENC, QuickSync, Vulkan) 🆗 linux::LinuxVideoEncoder (VA-API, CPU upload only; zero real-hardware verification) ❌ NoBackend (mediaway_encoder::web WebCodecs exists, not wired) ❌ NoBackend
AutoDecoder::open ✅ windows::WindowsVideoDecoder (WMF HW decode, DX11 Zero-Copy out) 🆗 linux::LinuxVideoDecoder (VA-API CPU output; unverified) ❌ NoBackend (mediaway_decoder::web planned) ❌ NoBackend
ScreenCapture::open ✅ ⚡ DXGI Desktop Duplication (Zero-Copy out) 🆗 linux::LinuxScreenCapture (portal + PipeWire, CPU copy; unverified) ❌ NoBackend (getDisplayMedia not wired) ❌ NoBackend
WindowCapture::open → PlatformWindowCapture (concrete, not boxed — ADR-0002) ✅ ⚡ WGC (Zero-Copy out; border / even-crop options on WindowsWindowCapture::open_with) 🆗 linux::LinuxWindowCapture (portal + PipeWire) ❌ NoBackend macOS 🆗 apple::AppleWindowCapture (ScreenCaptureKit); Android ❌ NoBackend
DesktopAudio::open → PlatformDesktopAudioCapture (concrete) ✅ WASAPI system loopback or per-process loopback ❌ NoBackend ❌ NoBackend ❌ NoBackend
Microphone::open ✅ WASAPI ❌ NoBackend (Linux mic module exists, not wired) ❌ NoBackend ❌ NoBackend
encoder_support(codec) / encoder_support_at(codec, w, h) ✅ live probe (incl. Opus via mediaway-sw software path); support is resolution-dependent, so use _at for the size you will encode empty empty empty
decoder_support(codec) ✅ live probe (incl. inbox WMF Opus and AAC decoders) ✅ live probe (VA-API) NotImplemented NotImplemented
device_support / request_device_permission ✅ ✅ — —

Remaining wiring (platform dispatch for Web, Linux microphone, camera, and other platforms) follows the workspace platform order — see docs/roadmap.md.

Docs

Contributing

Contributions are welcome — open an issue or pull request at github.com/nyxways/mediaway.

License

MIT OR Apache-2.0.