Skip to content

nttcom/moq-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

754 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MoQ WASM

Both server and browser client are written in Rust.

Demo page

Being Deployed to Github Pages.

Implementation

Supported version: draft-ietf-moq-transport-10

  • Control Messages
    • CLIENT_SETUP / SERVER_SETUP
    • GOAWAY
    • ANNOUNCE
    • SUBSCRIBE
    • SUBSCRIBE_UPDATE
    • UNSUBSCRIBE
    • ANNOUNCE_OK
    • ANNOUNCE_ERROR
    • ANNOUNCE_CANCEL
    • TRACK_STATUS_REQUEST
    • SUBSCRIBE_ANNOUNCES
    • UNSUBSCRIBE_ANNOUNCES
    • SUBSCRIBE_OK
    • SUBSCRIBE_ERROR
    • SUBSCRIBE_DONE
    • MAX_SUBSCRIBE_ID
    • ANNOUNCE
    • UNANNOUNCE
    • TRACK_STATUS
    • SUBSCRIBE_ANNOUNCES_OK
    • SUBSCRIBE_ANNOUNCES_ERROR
    • FETCH
    • FETCH_OK
    • FETCH_ERROR
    • FETCH_CANCEL
  • Data Streams
    • Datagram
    • Subgroup Stream
  • Features
    • Manage Publisher / Subscriber
    • Forword Messages
    • Priorities
    • Object Cache

Modules

moqt-core

  • Core module for both server and client
  • Includes handlers and data structures

media-streaming-format

  • MSF (Media Streaming Format) catalog structures (draft-ietf-moq-msf-00)

moqt-server

  • Module for server application

moqt-server-sample

  • Sample server application
    • Supported Roles: PubSub

moqt-client-wasm

  • Module for browser client and sample browser client application
    • Supported Roles: Publisher, Subscriber, PubSub
  • Exposes MSF catalog JSON helpers for browser integration

moqt-client-onvif

  • Client for IP cameras over RTSP/ONVIF (Raspberry Pi and Mac)
  • Includes moqt-onvif-client to bridge RTSP video + ONVIF commands over MoQ

How to run

Generating public and private keys for the server

cd moqt-server-sample
mkdir keys
cd keys
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -out cert.pem -subj '/CN=Test Certificate' -addext "subjectAltName = DNS:localhost"

Run moqt-server-sample

  • make server

if you want to watch tokio tasks, use tokio-console

cargo install tokio-console
tokio-console

Specify the log level

make server-trace

or

# Default setting is `DEBUG`
cargo run -p moqt-server-sample -- --log <Log Level>

Run moqt-client-wasm

cd js && npm install
make client
  • Add a certificate and Enable WebTransport feature in Chrome
# For Mac users
make chrome

# For Linux users
make chrome:linux

One-command Linux setup for media E2E

The automated Media Publisher → Subscriber E2E flow is supported on Linux.

node scripts/setup-media-e2e.mjs

This command:

  • generates moqt-server-sample/keys/key.pem and cert.pem when missing
  • installs js dependencies
  • builds moqt-client-wasm into js/pkg
  • installs Playwright Chromium for the E2E browser run

One-command Linux run for media E2E

node scripts/run-media-e2e.mjs

This command starts moqt-server-sample, starts the Vite server for js, runs the Playwright E2E for the Media Publisher / Subscriber examples, and cleans up the child processes.

GitHub Actions also runs the same Linux media E2E flow in .github/workflows/media-e2e.yml.

The Playwright test itself can also be run directly:

cd js
npm run e2e:media

Environment variables for advanced runs:

  • MEDIA_E2E_WEB_PORT (default: 4173)
  • MEDIA_E2E_MOQT_URL (default: https://127.0.0.1:4433)
  • MEDIA_E2E_NAMESPACE (default: auto-generated by run-media-e2e.mjs)

Validation commands

cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features
cargo test
cd js && npm run lint
cd js && npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}"
cd js && npm run e2e:media

Run moqt-client-onvif

cp .env.example .env
make onvif

ONVIF_IP / ONVIF_USERNAME / ONVIF_PASSWORD are read from .env.

MoQ bridge:

make onvif-moq

MOQT_URL is read from .env.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors