Real-Time Streaming (RTS) FAQ

更新时间:
复制 MD 格式

Common questions and answers about Real-Time Streaming (RTS), including playback issues, encoding compatibility, and latency troubleshooting.

Can I use both standard live streaming and Real-Time Streaming (RTS) for the same live stream?

Yes. ApsaraVideo Live generates separate playback URLs for standard live streaming and RTS. For example, standard live streaming uses an RTMP URL: rtmp://${playback domain}/AppName/StreamName?${access token}, while RTS uses an artc URL: artc://${playback domain}/AppName/StreamName?${access token}.

Can I use a self-developed SDK to integrate with Real-Time Streaming (RTS)?

Yes, but your SDK must follow the Alibaba Cloud signaling protocol specifications. For more information, see GRTN signaling protocol specifications for standard WebRTC access.

Why can't I play a stream that is ingested from a web client by using RTS?

Native browser limitations on WebRTC impose the following restrictions on the Web RTS SDK:

  • Video with B-frames is not supported, which can cause playback to jump or stutter.

  • Audio with AAC encoding is not supported, which can cause noise.

To resolve these issues, go to Live + > RTS in the ApsaraVideo Live console. Enable Real-Time Streaming (RTS) and select Sub-second (End-to-End Latency: 400-800 ms). The system automatically detects and transcodes streams that contain B-frames or AAC audio. Transcoding fees apply. For more information, see RTS pricing.

How do I customize the video resolution in the web SDK?

For instructions on customizing the video resolution in the web SDK, see the Web co-streaming SDK API reference.

OBS stream ingest failure with an RTS URL

To ingest an RTS stream from OBS by using an artc protocol URL, you must integrate the OBS plugin SDK. The integration does not require changes to the native OBS framework. After integration, OBS can encode captured audio and video and ingest the stream into the Alibaba Cloud GRTN network in real time. For instructions, see Introduction to the OBS plugin SDK.

How to optimize OBS settings for poor networks?

To optimize OBS (Open Broadcaster Software) for stream ingest over a poor network, follow these steps:

  1. Start OBS.

  2. In the upper-left corner, click File and select Settings.

  3. In the Settings window, select Output from the left-side panel and set Output Mode to Advanced. On the Streaming tab, set Video Encoder to QuickSync H.264, Rate Control to CBR, and Bitrate to 2500 Kbps.

  4. On the Streaming tab, you can configure the encoder to handle a poor network.

  5. In the encoder settings, you can increase the keyframe interval (for example, set it to 2s) and the number of B-frames to improve smoothness.

  6. Select Video from the left-side panel. Set Base (Canvas) Resolution to 1920x1080, Output (Scaled) Resolution to 1280x720, Downscale Filter to Bicubic (Sharpened scaling, 16 samples), and Common FPS Values to 30.

  7. For a stable connection, use a wired LAN instead of Wi-Fi and close other applications that consume bandwidth.

  8. After you configure the settings, click Apply and then OK to save the changes.

Why is the latency high in Real-Time Streaming (RTS)?

RTS is designed for millisecond-level latency. If latency is significantly higher than one second, troubleshoot as follows:

  • 1. Check the network status on the ingest client.

    Log on to the ApsaraVideo Live console. In the left-side navigation pane, choose Monitoring > Real-time Monitoring.

    Enter the AppName and StreamName for the stream and check for any anomalies in the ingest frame rate, bitrate, and timestamps.

  • 2. Obtain the RTS TraceID and submit a ticket.

    If the ingest frame rate, bitrate, and timestamps are normal but you still experience high latency and stuttering, play the stream in the player demo and obtain the RTS TraceID for the session. For instructions, see Obtain the RTS TraceID in the player demo. Then, submit a ticket to Alibaba Cloud technical support as described in Contact us.

Why is audio missing in HLS/FLV playback from web RTS ingest?

Web RTS ingest encodes audio in OPUS format, which is not compatible with FLV and HLS players. To support FLV and HLS playback, use RTMP for stream ingest instead. You can still use RTS for low-latency playback alongside standard HLS and FLV playback.

Why doesn't an H.265 RTS stream play in browsers?

Native WebRTC in browsers does not support H.265. Ensure that the ingested stream uses H.264 encoding, or enable transcoding in ApsaraVideo Live to convert H.265 to H.264 for playback.

RTS browser compatibility

For the list of supported browsers, see Browser requirements.

How do I solve the problem that QQ Browser on some Android devices fail to pull and ingest streams?

Some Android devices, such as Huawei P20 and vivo iQOO, may fail to start the X5 kernel after you install QQ Browser and open the browser for the first time. As a result, the WebRTC compatibility issue occurs and streams cannot be pulled and ingested. The following error message is reported: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection. If you encounter this problem, perform the following steps to make sure that the X5 kernel is initialized:

  1. Connect to a WI-FI network.

  2. Refresh the page and wait about 30 seconds.

  3. Restart the browser and visit the page again. The problem is solved.

Why do some browsers not support Web RTS SDK?

A browser does not support Web RTS SDK due to one of the following reasons:

  • The browser does not implement WebRTC-related API operations, or implement the API operations in a flawed manner. For example, Microsoft Internet Explorer and UC Browser.

  • The browser supports WebRTC-related API operations. However, the browser supports VP8 encoding but does not support H.264 encoding. For example, the built-in browser of some Android devices.

Why does Safari on iOS report the error message "Failed to set remote answer sdp"?

Problem description: The following error message is displayed.

Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer.

Analysis: You integrated other WebRTC SDKs, which causes webrtc-adapter conflicts. To prevent the issue, RTS SDK excludes the adapter from V2.2.4. You can use RTS SDK V2.2.4 or later with other WebRTC-related SDKs.

  • You can use JavaScript to directly integrate RTS SDK V2.2.4 or later.

  • If you want to use npm to integrate RTS SDK, compile the following code:

    import { AliRTS } from 'aliyun-rts-sdk/dist/aliyun-rts-sdk-without-adapter.js';

    In the TypeScript project, you must declare the module to obtain type support.

    // Create file typings.d.ts in the root directory of the project.
    declare module 'aliyun-rts-sdk/dist/aliyun-rts-sdk-without-adapter.js' {
      import {AliRTS} from 'aliyun-rts-sdk';
      export {AliRTS}
    }

No audio in raw RTS recordings

If a raw recording of an RTS stream has no audio, troubleshoot as follows:

  1. Check whether the source stream contains audio: Log on to the ApsaraVideo Live console. In the left-side navigation pane, choose Monitoring > Real-time Monitoring. Use Stream-based Data to view the Audio Bitrate in Stream Ingest Statistics. If the audio bitrate is greater than 0, the source stream contains valid audio.

  2. Check the supported audio encoding formats of your player: We recommend that you use a player like VLC that supports almost all formats.

  3. Configure a recording transcoding template: If your player does not support the source audio format and you cannot change the source encoding or the player, configure a recording transcoding template to transcode the audio to a common format such as AAC before recording. Transcoding fees apply.