-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add moq-sub to subscribe to media from moq relays
- Loading branch information
Showing
10 changed files
with
438 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[workspace] | ||
members = ["moq-transport", "moq-relay", "moq-pub", "moq-api", "moq-clock"] | ||
members = ["moq-transport", "moq-relay", "moq-pub", "moq-api", "moq-clock", "moq-sub"] | ||
resolver = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# Change directory to the root of the project | ||
cd "$(dirname "$0")/.." | ||
|
||
# Use debug logging by default | ||
export RUST_LOG="${RUST_LOG:-debug}" | ||
|
||
# Connect to localhost by default. | ||
HOST="${HOST:-localhost}" | ||
PORT="${PORT:-4443}" | ||
ADDR="${ADDR:-$HOST:$PORT}" | ||
|
||
# Generate a random 16 character name by default. | ||
#NAME="${NAME:-$(head /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 16)}" | ||
|
||
# JK use the name "dev" instead | ||
# TODO use that random name if the host is not localhost | ||
NAME="${NAME:-dev}" | ||
|
||
# Combine the host and name into a URL. | ||
URL="${URL:-"https://$ADDR/$NAME"}" | ||
|
||
cargo run --bin moq-sub -- "$URL" "$@" | ffplay - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[package] | ||
name = "moq-sub" | ||
description = "Media over QUIC" | ||
authors = [] | ||
repository = "https://github.com/kixelated/moq-rs" | ||
license = "MIT OR Apache-2.0" | ||
|
||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
keywords = ["quic", "http3", "webtransport", "media", "live"] | ||
categories = ["multimedia", "network-programming", "web-programming"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
# iroh = ["iroh-net"] | ||
|
||
[dependencies] | ||
moq-transport = { path = "../moq-transport" } | ||
|
||
# QUIC | ||
quinn = "0.10" | ||
webtransport-quinn = "0.6.1" | ||
url = "2" | ||
|
||
# Crypto | ||
rustls = { version = "0.21", features = ["dangerous_configuration"] } | ||
rustls-native-certs = "0.6" | ||
rustls-pemfile = "1" | ||
|
||
# Async stuff | ||
tokio = { version = "1", features = ["full"] } | ||
|
||
# CLI, logging, error handling | ||
clap = { version = "4", features = ["derive"] } | ||
log = { version = "0.4", features = ["std"] } | ||
env_logger = "0.9" | ||
mp4 = "0.13" | ||
anyhow = { version = "1", features = ["backtrace"] } | ||
serde_json = "1" | ||
rfc6381-codec = "0.1" | ||
tracing = "0.1" | ||
tracing-subscriber = "0.3" | ||
|
||
[build-dependencies] | ||
clap = { version = "4", features = ["derive"] } | ||
clap_mangen = "0.2" | ||
url = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# moq-sub | ||
|
||
A command line tool for subscribing to media via Media over QUIC (MoQ). | ||
|
||
Takes an URL to MoQ relay with a broadcast name in the path part of the URL. It will connect to the relay, subscribe to | ||
the broadcast, and dump the media segments of the first video and first audio track to STDOUT. | ||
|
||
``` | ||
moq-sub https://localhost:4443/dev | ffplay - | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod media; |
Oops, something went wrong.