3 Star 6 Fork 4

winlinvip / srs.wiki

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
v1_EN_RTMP.PK.HTTP.md 3.17 KB
一键复制 编辑 原始数据 按行查看 历史
winlinvip 提交于 2022-01-06 11:57 . Update

HOME > EN > Delivery Method

RTMP PK HTTP

The two major delivery methods on internet, HLS and RTMP.

Ignore other delivery protocol, which is not used on internet:

  • UDP: Private protocols, realtime protocol, latence in ms.
  • P2P: FlashP2P of Adobe, others are private protocol. Large latence, in minutes.
  • RTSP: Private protocol not for internet.

And the protocol base on HTTP:

  • HTTP progressive: Ancient protocol, not used now.
  • HTTP stream: Support seek in query string, for instance, http://x/x.mp4?start=x.
  • HLS: The HLS is developed by Apple. Both Apple and Android support it.
  • HDS: The HLS like developed by Adobe, shit.
  • DASH: The HLS like developed by some companies, not used in China.

Compare the delivery methods on internet:

  • HLS: Apple HLS, for both live and vod.
  • HTTP: HTTP stream, private http stream, for vod.
  • RTMP: Adobe RTMP, for live stream.

RTMP

The RTMP is stream protocol, good for:

  • Realtime: RTMP latency can be 0.8-3s.
  • DRM: RTMPE/RTMPS encrypt protocol.
  • Stable for PC flash.
  • Server input: The actual industrial standard for encoder to output to server is RTMP.
  • Fault Tolerance: The RTMP edge-origin can support fault tolerance for stream protocol.
  • Monitor: The stream protocol can be monitored.

RTMP is bad for:

  • Complex: RTMP is more complex than HTTP, especially the edge.
  • Hard to cache: Must use edge to cache.

HTTP

The HTTP stream is the vod stream used for some video website:

HTTP is delivery files, good for:

  • High performance: There are lots of good HTTP server, such as nginx, squid, traffic server.
  • No small piece of file: The large file is good than pieces of file for HTTP cache.
  • Firewall traverse: Almost all firewall never block the HTTP protocol.

HTTP is bad for:

  • Large lantency: The http stream atleast N10s latency.
  • Player does not support: Only PC flash can play http stream. Mobile platform does not support http stream.

HLS

HLS is the open standard of Apple. HLS is supported by Android3+.

HLS is good for:

  • High performance: Same to HTTP stream.
  • Firewall traverse: Same to HTTP stream.
  • Mobile Platform standard: Apple IOS/OSX, Android and PC/flash support HLS.

HLS is bad for:

  • Large lantency: The http stream atleast N10s latency.
  • Pieces of file: CDN does not like small file.

Use Scenario

See HTTP and RTMP

I recomment to use these delivery protocols in:

  • Encoder always output RTMP for internet server.
  • Server always accept RTMP from encoder.
  • The cluster use RTMP as internal delivery protocol.
  • The low latency application on PC: Use flash to play RTMP.
  • Application without low latency required: RTMP or HLS.
  • The vod stream on PC: Use HLS or HTTP stream.
  • Apple IOS/OSX: Always use HLS. Or use library to play RTMP, like https://www.vitamio.org
  • Android: Always use HLS. Or use library to play RTMP.

Winlin 2014.11

1
https://gitee.com/winlinvip/srs-wiki.git
git@gitee.com:winlinvip/srs-wiki.git
winlinvip
srs-wiki
srs.wiki
master

搜索帮助