diff --git a/README.md b/README.md index 0693202..f31a6c1 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ You must also create and JSON file with the RTMP rebroadcasting configuration yo * `endpoint`- This is the name of the RTMP ingest endpoint that the source stream will be pushed to. Defaults to `live` if not specified. * `rebroadcastList`- _Required_ Contains a list of JSON objects that each configure a distinct RTMP destination that the stream pushed to the ingest endpoint will be rebroadcasted to. At least one destination should be configured. There is no specific limit on the number of destinations except for the hardware limitations of your host. Each destination is configured with the following JSON elements: * `name` - _Required_ A distinct label for this destination. Can be any alphanumeric string with no white space. Must be distinct from all the other destination names in this list. - * `platform` - _Required_ The platform that this specific rebroadcast stream should be pushed to. The default RTMP destinations will be used for each platform. Supported platforms values are: `youtube`, `facebook`, `twitch`, `instagram`, `periscope`, `microsoft-stream`, and `custom`. Note that specifying `microsoft-stream` or `custom` will cause the `streamKey` element to be ignored if present and instead use the `fullRTMPURL` + * `platform` - _Required_ The platform that this specific rebroadcast stream should be pushed to. The default RTMP destinations will be used for each platform. Supported platforms values are: `youtube`, `facebook`, `twitch`, `instagram`, `periscope`, `microsoft-stream`, `mixcloud`, `dlive` and `custom`. Note that specifying `microsoft-stream` or `custom` will cause the `streamKey` element to be ignored if present and instead use the `fullRTMPURL` * `regionCode` - If `periscope` is specified as the platform for this destination, this is the two letter region code that is part of the Periscope server URL. If undefined, it will default to `ca` (the "US West" region) * `streamKey` - This is the stream key that identifies the unique stream on the specified platform. This value is provided by the platform. This element must be provided for all `platform` types except for `custom` and `microsoft-stream`. * `fullRTMPURL` - If `custom` or `microsoft-stream` is specified in the `platform`, the URL specified in this element is used for the forming destination URL. This should include the `rtmp://` prefix. For the `microsoft-stream` platform, this is the full URL provided in their stream set up. This element is ignored for all other platform types. diff --git a/multistreaming-server/rtmp-conf-generator.py b/multistreaming-server/rtmp-conf-generator.py index fa3ed9b..3a4aadb 100644 --- a/multistreaming-server/rtmp-conf-generator.py +++ b/multistreaming-server/rtmp-conf-generator.py @@ -71,6 +71,8 @@ PUSH_URL_INSTAGRAM = "rtmp://127.0.0.1:19351/rtmp/%%STREAM_KEY%%" PUSH_URL_PERISCOPE = "rtmp://%%REGION_CODE%%.pscp.tv:80/x/%%STREAM_KEY%%" PUSH_URL_MICROSOFT_STREAM = "%%RTMP_URL%% app=live/%%APP_NAME%%" +PUSH_URL_MIXCLOUD = "rtmp://rtmp.mixcloud.com/broadcast/%%STREAM_KEY%%" +PUSH_URL_DLIVE = "rtmp://stream.dlive.tv/live/%%STREAM_KEY%%" # # # @@ -108,6 +110,10 @@ def generatePlatormPushURL(block_config): ).replace( '%%APP_NAME%%', ms_app_name ) + elif block_config['platform'] == 'mixcloud': + push_url = PUSH_URL_MIXCLOUD.replace('%%STREAM_KEY%%', block_config['streamKey']) + elif block_config['platform'] == 'dlive': + push_url = PUSH_URL_DLIVE.replace('%%STREAM_KEY%%', block_config['streamKey']) else: print("ERROR - an unsupported platform type was provided in destination configation", file=sys.stderr) exit(1)