Skip to content

RTMP to WebRTC

Introduction

Currently, mms-server supports pushing H.264 video streams via RTMP and repackaging them into WebRTC streams using H.264 and Opus.

Configuration

  1. First, enable the WebRTC service in mms.yaml:
yaml
webrtc:
  enabled: true
  udp_port: 8878                # UDP port for WebRTC (port 3348 is used for STUN and enabled by default)
  ip: 192.168.108.211           # IP address to listen on
  internal_ip: 192.168.108.211  # Internal IP for isolated environments like Alibaba Cloud
  1. Next, enable RTMP to WebRTC conversion in the stream domain configuration:
yaml
type: publish
name: test.publish.com
apps:
  - name: app                     # Entry point name
    bridge:                       # Protocol bridging settings
      no_players_timeout_ms: 10s  # Timeout for ending conversion when no viewers are connected
      rtmp:
        to_webrtc: on             # Enable RTMP to WebRTC conversion

Note

  • Protocol conversion currently supports only on-demand conversion (continuous conversion is not supported yet). That is, the conversion starts only when someone is watching, which helps reduce server load.

Playback

You can use our standalone console tool to play the stream: Console Playback

Released under the MIT License.