Migrate from LiveSwitch Connect to RTMP
If you are using LiveSwitch Connect for broadcasting over RTMP with a command like the following, you now have a better option to accomplish this.
lsconnect ffrender \
--gateway-url https://v1.liveswitch.fm:8443/sync \
--application-id my-app-id
--shared-secret=--replaceThisWithYourOwnSharedSecret-- \
--channel-id {CHANNEL_ID}
--connection-id {CONNECTION_ID or "mcu"} \
--output-args="-f flv rtmp://a.rtmp.youtube.com/live2/<YouTube Stream Key>"
Use this guide to migrate your application from LiveSwitch Connect to in-product RTMP.
Configure a LiveSwitch Channel to Allow Broadcasting Directly to an RTMP Service
When you migrate your application from LiveSwitch Connect to in-product RTMP, you gain the following benefits:
- You won’t have to manage starting or stopping LiveSwitch Connect processes.
- You can reduce infrastructure costs. You won’t need as large or as many servers because you don’t need to handle any media.
- RTMP is simpler to configure.
Prerequisites
Contact Sales to ensure you have RTMP enabled on your account. RTMP is available for customers on the Standard, Professional, and Enterprise subscriptions plans, as well as those with Developer licenses.
Note
Regardless of the service being used, your app must be updated to the latest SDK (version 1.15.0 at a minimum) if you intend to use the SDK controls to start or stop RTMP.
Steps
To configure a LiveSwitch Channel to allow broadcasting directly to an RTMP server, do the following:
- Log in to your LiveSwitch Cloud Console.
Note
You can enable RTMP at either the application level or channel level.
- Go to the Channel settings of a channel pattern for which you want to enable RTMP.
- Ensure that the channel pattern matches the channel used in your LiveSwitch Connect command.
- Enabling RTMP at the application level enables RTMP for all channels in that application unless any channel has its own setting configured.
Warning
Enabling RTMP on channels with the wildcard character asterisk (*) allows reusing the RTMP URL on multiple channels. See RTMP Simultaneous Stream.
- To enable RTMP, do the following:
- Enter the connection URL of the service you want to stream to (for example, rtmp://a.rtmp.youtube.com/live2/).
- Enter the stream key for the connection URL.
- Optionally, to automatically start RTMP when the channel is activated (that is, when the first user joins the channel), turn the toggle switch on.
- Update your integration that currently triggers LiveSwitch Connect.
- If you have built an application that has a button to trigger RTMP (for example, by calling an API on your server that starts LS Connect), you can update this button to use the SDK to send a ChannelUpdate message, which starts RTMP on the specified channel.
Note
To be able to start RTMP, the user must be registered with a ChannelClaim that has the
CanUpdate
flag set to true. By default, theCanUpdate
flag is set as false.var channelConfig = new fm.liveswitch.ChannelConfig(); channelConfig.setEnableRtmp(true) channel.update(channelConfig);
- If your application is currently automatically starting RTMP by listening for channel activation webhook events, then you can configure RTMP to automatically start on channel activation by turning the toggle switch on.
- If you have built an application that has a button to trigger RTMP (for example, by calling an API on your server that starts LS Connect), you can update this button to use the SDK to send a ChannelUpdate message, which starts RTMP on the specified channel.
- Add webhooks as needed. Configure the RTMP started and stopped webhooks to allow your application to know when RTMP streaming is active.