Help Center/ Live/ FAQs/ Live Streaming/ Which Streaming Protocols Are Supported?
Updated on 2022-03-31 GMT+08:00

Which Streaming Protocols Are Supported?

HUAWEI CLOUD Live supports three streaming protocols: RTMP, HTTP-FLV, and HLS.

  • RTMP can be used to push and play live streams. It splits large video frames and audio frames, encrypts them, and transmits them as small data packets. However, packet disassembly and assembly are complex. Therefore, unexpected problems may occur if there are a large number of concurrent requests. RTMP based on Flash does not support iOS browsers, but its real-time performance is better than HLS.
  • HTTP-FLV works by adding some tag header information to large video frames and audio and video headers. Due to its simple working mode, HTTP-FLV is stable when there are a large number of concurrent requests and the latency is low. It works well on mobile apps, but may not well enough on mobile browsers.
  • HLS works by breaking the overall stream into a sequence of small HTTP-based segments (5s to 10s) and uses the M3U8 index table to manage these segments. The videos downloaded by the client are complete segments. Therefore, videos play smoothly, but a high latency is introduced, usually about 10s to 30s. Compared with FLV, HLS is better compatible with browsers and supports cross-device sharing. Therefore, HLS is commonly used for URL sharing in social software.
Table 1 Comparison between RTMP, HTTP-FLV, and HLS

Streaming Protocol

Protocol

Principle

Latency

Advantage and Disadvantage

RTMP

Long-lived TCP connections

The data received at each moment is sent immediately.

Related to the GOP on the streaming device end:

  • If the keyframe interval is 1s, the stream latency is 1s to 3s.
  • If the keyframe interval is 2s, the stream latency is 2s to 4s.
  • Advantage: low latency
  • Disadvantage: unstable in high concurrency scenarios. It cannot be used on the iOS platform. A non-standard TCP port is used.

HTTP-FLV

Long-lived TCP connections

A flag is added to the data header, and the data packet is played after being decapsulated using HTML5.

  • Advantage: low latency
  • Disadvantage: The SDK needs to be integrated for playback.

HLS

Non-persistent HTTP connections

Collect data of a period of time to generate TS segment files and update the M3U8 file.

10s to 30s

  • Advantage: cross-platform sharing is supported.
  • Disadvantage: high latency