OvenMediaEngine
0.16.[1-3]
0.16.[1-3]
  • Introduction
  • Quick Start
    • Online Demo
  • Getting Started
    • Getting Started with Docker
    • Getting Started with OME Docker Launcher
  • Configuration
    • TLS Encryption
    • IPv6
  • Live Source
    • RTMP
    • WebRTC / WHIP
    • SRT
    • MPEG-2 TS
    • RTSP Pull
  • ABR and Transcoding
    • Enable GPU Acceleration
  • Streaming
    • WebRTC Streaming
    • Low-Latency HLS
    • Low-Latency DASH and Legacy HLS streaming
  • Access Control
    • SignedPolicy
    • AdmissionWebhooks
  • Clustering
  • Thumbnail
  • Recording
  • Push Publishing
  • REST API
    • v1
      • VirtualHost
        • Reload Certificate
        • Application
          • Output Profile
          • Record
          • Push
          • Stream
            • Send Event
            • HLS Dump
      • Statistics
        • Current
  • Alert
  • Performance Tuning
  • Logs and Statistics
  • Troubleshooting
  • P2P Delivery (Experiment)
Powered by GitBook
On this page
  • Configuration
  • Bind
  • Application
  • URL Pattern
  • Self-defined Signaling URL
  • WHIP URL
  • WebRTC over TCP
  • WebRTC Producer
  • Self-defined WebRTC Ingest Signaling Protocol

Was this helpful?

Export as PDF
  1. Live Source

WebRTC / WHIP

Was this helpful?

User can send video/audio from web browser to OvenMediaEngine via WebRTC without plug-in. Of course, you can use any encoder that supports WebRTC transmission as well as a browser.

Configuration

Bind

OvenMediaEngine supports self-defined signaling protocol and for WebRTC ingest.

<Bind>
    <Providers>
        ...
        <WebRTC>
            <Signalling>
                <Port>3333</Port>
                <TLSPort>3334</TLSPort>
            </Signalling>
            <IceCandidates>
                <TcpRelay>*:3478</TcpRelay>
                <TcpForce>false</TcpForce>
                <IceCandidate>*:10000-10005/udp</IceCandidate>
            </IceCandidates>
        </WebRTC>
    </Providers>

You can set the port to use for signaling in <Bind><Provider><WebRTC><Signaling>. <Port> is for setting an unsecured HTTP port, and <TLSPort> is for setting a secured HTTP port that is encrypted with TLS.

For WebRTC ingest, you must set the ICE candidates of the OvenMediaEnigne server to <IceCandidates>. The candidates set in <IceCandate> are delivered to the WebRTC peer, and the peer requests communication with this candidate. Therefore, you must set the IP that the peer can access. If the IP is specified as *, OvenMediaEngine gathers all IPs of the server and delivers them to the peer.

Application

WebRTC input can be turned on/off for each application. As follows Setting enables the WebRTC input function of the application. The <CrossDomains> setting is used in WebRTC signaling.

<Applications>
    <Application>
        <Name>app</Name>
        <Providers>
            <WebRTC>
                <Timeout>30000</Timeout>
                <CrossDomains>
                    <Url>*</Url>
                </CrossDomains>
            </WebRTC>

URL Pattern

OvenMediaEnigne supports self-defined signaling protocol and WHIP for WebRTC ingest.

Self-defined Signaling URL

The signaling URL for WebRTC ingest uses the query string ?direction=send as follows to distinguish it from the url for WebRTC playback. Since the self-defined WebRTC signaling protocol is based on WebSocket, you must specify ws[s] as the scheme.

ws[s]://<host>[:signaling port]/<app name>/<stream name>?direction=send

WHIP URL

For ingest from the WHIP client, put ?direction=whip in the query string in the signaling URL as in the example below. Since WHIP is based on HTTP, you must specify http[s] as the scheme.

http[s]://<host>[:signaling port]/<app name>/<stream name>?direction=whip

WebRTC over TCP

ws[s]://<host>[:port]/<app name>/<stream name>?direction=send&transport=tcp

http[s]://<host>[:port]/<app name>/<stream name>?direction=whip&transport=tcp

To use WebRTC/tcp, <TcpRelay> must be turned on in <Bind> setting.

If <TcpForce> is set to true, it works over TCP even if you omit the ?transport=tcp query string from the URL.

WebRTC Producer

We provide a demo page so you can easily test your WebRTC input. You can access the demo page at the URL below.

Self-defined WebRTC Ingest Signaling Protocol

<TcpRelay> means OvenMediaEngine's built-in TURN Server. When this is enabled, the address of this turn server is passed to the peer via self-defined signaling protocol or WHIP, and the peer communicates with this turn server over TCP. This allows OvenMediaEngine to support WebRTC/TCP itself. For more information on URL settings, check out .

WebRTC transmission is sensitive to packet loss because it affects all players who access the stream. Therefore, it is recommended to provide WebRTC transmission over TCP. OvenMediaEngine has a built-in TURN server for WebRTC/TCP, and receives or transmits streams using the TCP session that the player's TURN client connects to the TURN server as it is. To use WebRTC/TCP, use transport=tcp query string as in WebRTC playback. See for more information.

The getUserMedia API to access the local device only works in a . So, the WebRTC Input demo page can only work on the https site **** . This means that due to you have to install the certificate in OvenMediaEngine and use the signaling URL as wss to test this. If you can't install the certificate in OvenMediaEngine, you can temporarily test it by allowing the insecure content of the demo.ovenplayer.com URL in your browser.

To create a custom WebRTC Producer, you need to implement OvenMediaEngine's Self-defined Signaling Protocol or WHIP. Self-defined protocol is structured in a simple format and uses the.

When the player connects to ws[s]://host:port/app/stream?direction=send through a web socket and sends a request offer command, the server responds to the offer sdp. If transport=tcp exists in the query string of the URL, information is included in offer sdp, which contains the information of OvenMediaEngine's built-in TURN server, so you need to set this in RTCPeerConnection to use WebRTC/TCP. The player then setsRemoteDescription and addIceCandidate offer sdp, generates an answer sdp, and responds to the server.

WHIP
secure context
https://demo.ovenplayer.com/demo_input.html
mixed content
iceServers
WebRTC over TCP
WebRTC/tcp playback
same method as WebRTC Streaming
OvenPlayer