The WHIP Restreamer plugin provides a means to restream a stream to a remote server. The plugin is designed to work with servers that handle WHIP.
sequenceDiagram
Ingest->>+ProStream: Ingested Stream (RTMP, RTSP, etc.)
ProStream->>+WHIPRestreamListener: Listen for packets
WHIPRestreamListener-->>+WHIPClient: Pass packets
WHIPClient-->>+Dolby.io: Restream
The WHIP Restreamer plugin is enabled via the restreamer-plugin.properties file; set the enable.whip field to true to enable the plugin (currently the default).
Each example below covers the serviceProvider whether it be Red5 Pro Server, Twitch, or Dolby.io.
{
"guid": "live/stream1",
"context": "live",
"name": "stream1",
"level": 0,
"parameters": {
"type": "whip-push",
"action": "create",
"endpoint": "http://localhost:5080/live/whip/endpoint/stream2",
"audio": true,
"video": true,
"datachannel": true,
"insertableStream": false,
"immediate": false,
"attempts": 3,
"delayS": 10,
"persist": false
}
}Twitch uses the bearerToken field for the stream key, which is found in your Twitch dashboard under Settings->Stream under Stream Key & Preferences.
{
"guid": "live/stream1",
"context": "live",
"name": "stream1",
"level": 0,
"parameters":{
"type": "whip-push",
"action": "create",
"serviceProvider": "twitch",
"endpoint":"https://g.webrtc.live-video.net:4443/v2/offer",
"bearerToken":"live_107484810_wnHKDftISXEIATEbGlCL2vwwaaqq",
"audio": true,
"video": true,
"datachannel": false,
"insertableStream": false,
"immediate": false,
"attempts": 3,
"delayS": 10,
"persist": false
}
}Example provisioning via curl (add your auth and update your stream key as needed)
curl -v -X POST http://localhost:5080/live/restream -H "Content-Type: application/json" -d '{"guid": "restream_twitch", "context": "live", "name": "stream1", "level": 0, "parameters": {"action": "create", "type": "whip-push", "serviceProvider": "twitch", "endpoint": "https://g.webrtc.live-video.net:4443/v2/offer", "bearerToken": "live_107484810_wnHKDftISXEIATEbGlCL2vmV5Xcmca", "audio": true, "video": true, "datachannel": false, "insertableStream": false, "immediate": "false", "attempts": "3", "delayS": "10", "persist": "false"}}'Example of the standard kill request:
curl -v -X POST http://localhost:5080/live/restream -H "Content-Type: application/json" -d '{"guid": "restream_twitch", "context": "live", "name": "stream1", "level": 0, "parameters": {"action": "kill", "type": "whip-push"}}'