startRtmpStreamWithTranscodingEx abstract method
- required String url,
- required LiveTranscoding transcoding,
- required RtcConnection connection,
Starts pushing streams with transcoding settings.
Agora recommends using the more comprehensive server-side streaming feature. See Implement Server-Side Streaming. You can call this method to push live audio and video streams to a specified CDN streaming URL with transcoding settings. This method can only push to one URL at a time. To push to multiple URLs, you must call this method multiple times. After calling this method, the SDK triggers the onRtmpStreamingStateChanged callback locally to report the streaming status. Make sure the CDN streaming service is enabled. Call this method after joining a channel. Only hosts in live streaming scenarios can call this method. If the stream fails to start and you want to restart it, you must call stopRtmpStreamEx before calling this method again. Otherwise, the SDK returns the same error code as the previous failure.
urlThe CDN streaming URL. The format must be RTMP or RTMPS. The character length must not exceed 1024 bytes. Special characters such as Chinese are not supported.transcodingThe transcoding settings for the CDN stream. See LiveTranscoding.connectionConnection information. See RtcConnection.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> startRtmpStreamWithTranscodingEx(
{required String url,
required LiveTranscoding transcoding,
required RtcConnection connection});