Back to Mediamtx

WebRTC servers

docs/3-publish/06-webrtc-servers.md

1.20.11.2 KB
Original Source

WebRTC servers

supported codecs
videoAV1, VP9, VP8, H265, H264
audioOpus, G722, G711 (PCMA, PCMU)

In order to ingest a WebRTC stream from a remote server, add the corresponding WHEP URL into the source parameter of a path:

yml
paths:
  proxied:
    # Use whep:// for HTTP and wheps:// for HTTPS.
    source: whep://host:port/path
    # If the source is HTTPS and the source TLS certificate is self-signed
    # or invalid, you can provide the fingerprint of the certificate in order to
    # validate it anyway. It can be obtained by running:
    # openssl s_client -connect source_ip:source_port </dev/null 2>/dev/null | sed -n '/BEGIN/,/END/p' > server.crt
    # openssl x509 -in server.crt -noout -fingerprint -sha256 | cut -d "=" -f2 | tr -d ':'
    sourceFingerprint:
    # Token to insert in the Authorization: Bearer header.
    whepBearerToken: ""

If the remote server is a MediaMTX instance, remember to add a /whep suffix after the stream name, since in MediaMTX it's part of the WHEP URL:

yml
paths:
  proxied:
    source: whep://host:port/mystream/whep