Skip to content

docs(doc): document moq-video and moq-audio - #2567

Merged
kixelated merged 3 commits into
mainfrom
claude/moq-issue-2481-next-f289cf
Jul 30, 2026
Merged

docs(doc): document moq-video and moq-audio#2567
kixelated merged 3 commits into
mainfrom
claude/moq-issue-2481-next-f289cf

Conversation

@kixelated

@kixelated kixelated commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Neither moq-video nor moq-audio had a documentation page, so the renderer (feat(moq-video): render decoded frames on the GPU, and carry color spaces end to end #2552), playback (feat(moq-audio): play decoded PCM out a speaker #2529), and echo cancellation (feat(moq-audio): cancel the speaker's echo out of the microphone #2538) that landed over the last two weeks are undiscoverable outside docs.rs. This is the last non-hardware item on the Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481 adoption gate: iroh-live's users need to find this stack before they delete theirs.
  • Each page covers the whole crate rather than appending a section, since there was nothing to append to: the role modules, the feature flags and what pulling each one in costs, the backend set and the dlopen-and-degrade rule, plus short examples for publish, subscribe, render, playback, and AEC.
  • moq-video documents the zero-copy story as a per-platform matrix rather than a blanket claim: macOS decodes to a PixelBuffer and both transcodes and renders zero-copy, Linux transcodes NVDEC straight into NVENC but downloads for render, and the Media Foundation decoder downloads its DXVA texture today. The gaps point at Merge iroh-live's native media stack into moq-video/moq-audio (upstreaming plan) #2481. Also covers Surface::into_i420() as the universal fallback and the wgpu::Texture integration seam.
  • Capability claims are scoped to what actually ships: openh264 is the fallback for H.264 only (H.265 returns NoEncoder/NoDecoder with no usable hardware backend), dlopen applies to the Linux backends, and the renderer infers color from resolution when a surface carries none, since VUI does not survive decoding.
  • moq-audio documents the Engine/Sink split, Sink::buffered() as the A/V pacing signal, and the AEC wiring (Engine::canceller -> capture::Config::aec) with its 10 ms cost and microphone-only scope.
  • Registered both pages in the VitePress sidebar, the crate index table, and the Rust libraries landing page under a new "Native Media" section.

Public API changes

None. Documentation only; no crate touched.

Cross-package sync

No rows apply: nothing under rs/ changed, so there is no paired package or draft to update. This PR is the doc/ half of the #2481 gate for work that already landed.

Test plan

  • bun run check in doc/ (tsc + VitePress build, which fails the build on dead links) passes.
  • bun remark doc --quiet --frail passes.
  • bun biome check doc/.vitepress/config.ts passes.
  • A /codex:adversarial-review pass challenged the capability claims; all three findings were verified against the backend registrations and the renderer's import path, and the prose was corrected in a follow-up commit.
  • Every example was written against the current source rather than the issue's description of it; two drafts that would not have typechecked were corrected (capture::Config::source is a Source, not an Option<Source>, and decode::Consumer::new takes the rendition's VideoConfig, not the catalog producer).

Refs #2481

(Written by Opus 5)

Neither crate had a documentation page, despite the renderer (#2552),
playback (#2529), and echo cancellation (#2538) all landing in the last
two weeks. That is the last non-hardware item on the #2481 adoption gate:
iroh-live's users have to be able to find this stack before they delete
theirs.

Each page covers the whole crate rather than appending a section, since
there was nothing to append to: the role modules, the feature flags and
what pulling each one in costs, the backend set and its degrade-at-runtime
rule, and short examples for publish, subscribe, render, playback, and
AEC.

Refs #2481

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @kixelated, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@kixelated, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 06c4682b-38ee-4d2d-87dc-a08080588861

📥 Commits

Reviewing files that changed from the base of the PR and between b754351 and bd50470.

📒 Files selected for processing (3)
  • doc/lib/rs/crate/moq-audio.md
  • doc/lib/rs/crate/moq-video.md
  • doc/lib/rs/index.md

Walkthrough

Adds documentation for the moq-video and moq-audio Rust crates, covering their pipelines, configuration, APIs, device handling, rendering, playback, and integration paths. Updates the Rust library overview, crate table, API documentation links, next steps, and VitePress sidebar to reference both crates.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states the docs update for moq-video and moq-audio, matching the main change.
Description check ✅ Passed The description accurately describes the documentation-only changes and matches the updated pages and navigation.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/moq-issue-2481-next-f289cf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@doc/lib/rs/crate/moq-audio.md`:
- Around line 77-89: Make the playback example self-contained by importing the
required decode module and initializing audio as the documented decode::Consumer
before it is used for sample_rate, channels, and read. Keep the existing
playback::Engine, playback::Config, playback::Input, and sink.write flow
unchanged.
- Around line 26-29: The native dependency descriptions in both pages overstate
the stack as entirely pure Rust with no system requirements. Update the wording
at doc/lib/rs/crate/moq-audio.md lines 26-29 and doc/lib/rs/index.md lines 92-95
to consistently distinguish Rust-based components from platform audio
dependencies, codec requirements, and possible native/toolchain needs,
preserving the references to unsafe-libopus, cpal, rubato, sonora, and ALSA
where applicable.

In `@doc/lib/rs/index.md`:
- Around line 87-88: Update the crate overview description to explicitly limit
system-audio capture to macOS, using wording such as “microphone and macOS
system-audio capture” while preserving the existing codec, playback, and
echo-cancellation details.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b69f71c-8ccb-49bd-8b5a-f8725830c57d

📥 Commits

Reviewing files that changed from the base of the PR and between e087980 and b754351.

📒 Files selected for processing (5)
  • doc/.vitepress/config.ts
  • doc/lib/rs/crate/index.md
  • doc/lib/rs/crate/moq-audio.md
  • doc/lib/rs/crate/moq-video.md
  • doc/lib/rs/index.md

Comment thread doc/lib/rs/crate/moq-audio.md Outdated
Comment thread doc/lib/rs/crate/moq-audio.md
Comment thread doc/lib/rs/index.md Outdated
kixelated and others added 2 commits July 30, 2026 09:26
An adversarial review caught three places where the new page promised
more than the backends deliver:

- openh264 was described as the end of every fallback chain. It registers
  for H.264 only, so H.265 with no usable hardware backend returns
  NoEncoder / NoDecoder rather than degrading.
- Zero-copy was written as a property of hardware decoding generally. The
  renderer imports only Surface::PixelBuffer, so it is macOS-only today;
  a CUDA frame is downloaded before upload, and the Media Foundation
  decoder downloads its DXVA texture and hands back I420. Replaced with a
  per-platform matrix separating transcode from render, pointing at #2481
  for the Vulkan/EGL importers and the Windows surface retention.
- Color was described as carried end to end. VUI does not survive
  decoding and neither Windows nor CUDA surfaces report color, so the
  renderer infers from resolution. Documented the fallback and pointed at
  render::Config::color.

Also drops a "pure-Rust fallbacks" line: openh264 is vendored C++, unlike
moq-audio's stack.

Refs #2481

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- "Everything is pure Rust ... no system codec anywhere in the graph" read
  as a promise that a Linux build needs nothing installed. The codecs and
  DSP really are Rust, but cpal links ALSA, so a build with `capture` or
  `playback` needs libasound headers. Says which part is which now.
- System-audio capture is macOS-only (ScreenCaptureKit); the crate page
  scoped it but the library overview did not.
- The playback example used an `audio` that appeared from nowhere. It now
  builds the decode::Consumer it documents, matching the subscribe example
  on the video page.

Refs #2481

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kixelated
kixelated merged commit cb8d628 into main Jul 30, 2026
2 checks passed
@kixelated
kixelated deleted the claude/moq-issue-2481-next-f289cf branch July 30, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant