startRtmpStreamWithTranscoding abstract method

Future<void> startRtmpStreamWithTranscoding({
  1. required String url,
  2. required LiveTranscoding transcoding,
})

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. Each stream push represents a streaming task. The default maximum number of concurrent tasks is 200, meaning you can run up to 200 streaming tasks simultaneously under one Agora project. For higher quotas, please contact technical support. After calling this method, the SDK triggers the onRtmpStreamingStateChanged callback locally to report the streaming status. 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 stopRtmpStream before calling this method again. Otherwise, the SDK returns the same error code as the previous failure.

  • url The 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.
  • transcoding The transcoding settings for the CDN stream. See LiveTranscoding.

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> startRtmpStreamWithTranscoding(
    {required String url, required LiveTranscoding transcoding});