mrtp

package module
v0.0.0-...-bd33cbc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 5 Imported by: 0

README

MRTP

Overview

MRTP consists of several subcommands that support different transport protocols.

RTP over QUIC (RoQ)

The send and receive subcommands can send and receive video streams and data. They support RoQ and plain RTP over UDP.

If RoQ is activated, the video stream is sent using RTP over QUIC, according to the RoQ Internet-Draft and data is sent over a reliable data channel based on the QUIC Data Channels Internet-Draft.

Without RoQ, it sends the RTP packets over UDP without any signaling.

GStreamer is used for handling the video stream.

graph LR
  S["send<br/>cmd"] -->|roq| R["receive<br/>cmd"]
Experimental: RoQ without GStreamer

The send-go and receive-go subcommand use a custom video pipeline instead of GStreamer.

graph LR
  S["send-go<br/>cmd"] -->|roq| R["receive-go<br/>cmd"]
WebRTC

Uses Pion WebRTC to send a video stream using RTP and data using WebRTC data channels. One of the peers must act as the offerer.

graph LR
  S["webrtc<br/>cmd"] -->|rtp| R["webrtc<br/>cmd"]
Chrome

The browser command can send a video stream and data using Chrome’s WebRTC library. As the congestion controller, Chrome uses its own GCC implementation.

graph LR
  S["browser<br/>cmd"] -->|rtp| R["webrtc<br/>cmd"]

Setup

Setup SCReAM Gstreamer plugin
  • Clone with submodules
  • In root directory, set GST_PLUGIN_PATH=./scream/gstscream/target/debug/ and LD_LIBRARY_PATH=./scream/code/wrapper_lib/
Setup gopipe

Only required for the experimental send-go and receive-go commands.

h264

Installation encoder:

  • Mac: brew install x264
  • Ubuntu: apt install libx264-dev

Installation decoder:

  • install libav
vpx

Installation:

  • Mac: brew install libvpx
  • Ubuntu: apt install libvpx-dev

Usage

RTP over QUIC (RoQ)

Start the receiver:

go run cmd/main.go receive -roq-server -roq-mapping 1

Start the sender:

go run cmd/main.go send -roq-client -roq-mapping 1 -bwe gcc

Add -source-location <path/to/video> to send a custom video instead of videotestsrc.

WebRTC

Start the receiver:

go run cmd/main.go webrtc -local-port 8081 -remote-port 8080 -pion-ccfb

Start the sender:

go run cmd/main.go webrtc -local-port 8080 -remote-port 8081 -pacing -bwe gcc -send-track - offer -pion-read-ccfb

Add -source-location <path/to/video> to send a custom video instead of videotestsrc.

Chrome

Start the webrtc command as receiver:

go run cmd/main.go webrtc -local-port 8081 -remote-port 8080 -sink-codec VP8 -pion-twcc

Start Chrome:

go run cmd/main.go browser -source-location <path/to/video> -local-port 8080 -remote-port 8081

Congestion Control Combinations

commands NADA GCC SCReAMv1 SCReAMv2
WebRTC webrtc ❌[^1] ❌[^1]
QUIC (RoQ) send, receive, send-go, receive-go ❌[^2] ❌[^2]
UDP (Gst) send, receive without roq enabled ?[^3]

[^1]: There are two ways to implement this: Using the SCReAM Gstreamer plugin or using SCReAM directly from Pion interceptors. SCReAMs RFC8888 feedback is currently not compatible with Pion. One issue is https://github.com/EricssonResearch/scream/pull/66. Another one is some SSRC rewriting going on in SCReAM or Pion, which makes it impossible to pass feedback correctly. Should be possible to fix, but no idea when. [^2]: SCReAM will not work over RTP over QUIC because it is implemented with RTP in mind and requires access to packet queues from which it might try to drop packets. QUIC does not like dropping queued stuff (and does not even queue data in packets, packets are only created from queued stuff when it is send). [^3]: Should work, but behaves weird, possibly misconfigured parameters.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BWE

type BWE interface {
	OnAck(sequenceNumber uint64, size int, departure, arrival time.Time, ecn ECN)
	OnLoss(sequenceNumber uint64, size int, departure time.Time)
	UpdateRTT(rtt time.Duration)
	UpdateECNCounts(ect0, ect1, ce uint64)
	UpdateTargetRate(time.Time) int
}

type Codec

type Codec int
const (
	H264 Codec = iota
	VP8
)

func NewCodec

func NewCodec(s string) (Codec, error)

func (Codec) ClockRate

func (c Codec) ClockRate() int

func (Codec) MediaType

func (c Codec) MediaType() string

func (Codec) String

func (c Codec) String() string

type ECN

type ECN uint8
const (
	ECNNonECT ECN = iota
	ECNECT1
	ECNECT0
	ECNCE
)

type GCC

type GCC struct {
	// contains filtered or unexported fields
}

func NewGCC

func NewGCC(initialRate, minRate, maxRate uint) (*GCC, error)

func (*GCC) OnAck

func (g *GCC) OnAck(sequenceNumber uint64, size int, departure time.Time, arrival time.Time, _ ECN)

OnAck implements BWE.

func (*GCC) OnLoss

func (g *GCC) OnLoss(uint64, int, time.Time)

OnLoss implements BWE.

func (*GCC) UpdateECNCounts

func (g *GCC) UpdateECNCounts(uint64, uint64, uint64)

UpdateECNCounts implements BWE.

func (*GCC) UpdateRTT

func (g *GCC) UpdateRTT(rtt time.Duration)

UpdateRTT implements BWE.

func (*GCC) UpdateTargetRate

func (g *GCC) UpdateTargetRate(time time.Time) int

UpdateTargetRate implements BWE.

type Nada

type Nada struct {
	// contains filtered or unexported fields
}

func NewNada

func NewNada(initRate, minRate, maxRate uint, feedbackInterval time.Duration) *Nada

func NewNadaWithConfig

func NewNadaWithConfig(config nada.Config) *Nada

func (*Nada) OnAck

func (n *Nada) OnAck(sequenceNumber uint64, size int, departure time.Time, arrival time.Time, ecn ECN)

OnAck implements BWE.

func (*Nada) OnLoss

func (n *Nada) OnLoss(sequenceNumber uint64, size int, departure time.Time)

OnLoss implements BWE.

func (*Nada) UpdateECNCounts

func (n *Nada) UpdateECNCounts(ect0 uint64, ect1 uint64, ce uint64)

UpdateECNCounts implements BWE.

func (*Nada) UpdateRTT

func (n *Nada) UpdateRTT(rtt time.Duration)

UpdateRTT implements BWE.

func (*Nada) UpdateTargetRate

func (n *Nada) UpdateTargetRate(time.Time) int

UpdateTargetRate implements BWE.

Directories

Path Synopsis
cmd
pubsub command
Package cmdmain implements commands and subcommands.
Package cmdmain implements commands and subcommands.
internal
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL