GithubHelp home page GithubHelp logo

junkai0531 / moq-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kixelated/moq-rs

0.0 0.0 0.0 943 KB

Rust library for Media over QUIC

License: Apache License 2.0

Shell 8.53% Rust 90.47% Makefile 0.13% Dockerfile 0.87%

moq-rs's Introduction

Media over QUIC

Media over QUIC (MoQ) is a live media delivery protocol utilizing QUIC streams. See quic.video for more information.

This repository contains a few crates:

  • moq-relay: A relay server, accepting content from publishers and fanning it out to subscribers.
  • moq-pub: A publish client, accepting media from stdin (ex. via ffmpeg) and sending it to a remote server.
  • moq-transport: An async implementation of the underlying MoQ protocol.
  • moq-api: A HTTP API server that stores the origin for each broadcast, backed by redis.
  • moq-clock: A dumb clock client/server just to prove MoQ is more than media.

There's currently no way to view media with this repo; you'll need to use moq-js for that.

Development

Launch a basic cluster, including provisioning certs and deploying root certificates:

make run

Then, visit https://quic.video/publish/?server=localhost:4443.

Alternatively, use the dev helper scripts.

Usage

moq-relay

moq-relay is a server that forwards subscriptions from publishers to subscribers, caching and deduplicating along the way. It's designed to be run in a datacenter, relaying media across multiple hops to deduplicate and improve QoS. The relays register themselves via the moq-api endpoints, which is used to discover other relays and share broadcasts.

Notable arguments:

  • --listen <ADDR> Listen on this address, default: [::]:4443
  • --tls-cert <CERT> Use the certificate file at this path
  • --tls-key <KEY> Use the private key at this path
  • --dev Listen via HTTPS as well, serving the /fingerprint of the self-signed certificate. (dev only)

This listens for WebTransport connections on UDP https://localhost:4443 by default. You need a client to connect to that address, to both publish and consume media.

moq-pub

This is a client that publishes a fMP4 stream from stdin over MoQ. This can be combined with ffmpeg (and other tools) to produce a live stream.

Notable arguments:

  • <URL> connect to the given address, which must start with https:// for WebTransport.

NOTE: We're very particular about the fMP4 ingested. See this script for the required ffmpeg flags.

moq-transport

A media-agnostic library used by moq-relay and moq-pub to serve the underlying subscriptions. It has caching/deduplication built-in, so your application is oblivious to the number of connections under the hood.

See the published crate and documentation.

moq-api

This is a API server that exposes a REST API. It's used by relays to inserts themselves as origins when publishing, and to find the origin when subscribing. It's basically just a thin wrapper around redis that is only needed to run multiple relays in a (simple) cluster.

License

Licensed under either:

moq-rs's People

Contributors

kixelated avatar dependabot[bot] avatar englishm avatar wanjohiryan avatar matteocontrini avatar rfwatson avatar zafergurel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.