Skip to content

v3_EN_ClientSDK

winlin edited this page Apr 21, 2017 · 28 revisions

HOME > EN(3.0) > Client SDK

The workflow of live streaming:

+---------+      +-----------------+       +---------+
| Encoder +-->---+ SRS/CDN Network +--->---+ Player  |
+---------+      +-----------------+       +---------+

The architecture of Encoder(publish/push stream) and Player(play/pull stream):

+-------------------------------------------+
|           Device(Out/In YUV/PCM)          |
+-------------------------------------------+
|   Codec(YUV/PCM to/from H.264/AAC stream) |
+-------------------------------------------+
|   Muxer(H.264/AAC to/from FLV/MP4/HLS)    |
+-------------------------------------------+
|          Transport(RTMP/HTTP/UDP)         |
+-------------------------------------------+

There are two different types of codec, one is hardware encoder, and the other is software encoder. Hardware encoder is inside the mobile device; while software encoder is FFMPEG/libx264. The performance of hardware encoder is high; while there are more available parameters expored in software encoder.

KSVC

KSVC(Kingsoft Video Cloud) is mobile SDK of ksyun.

The basic features of encoder:

Android iOS Codec Transport Hardware
Encoder
Software
Encoder
Lowlatency
YES YES H.264+AAC
H.265
RTMP YES YES NO

The advanced features of encoder:

美颜 横竖屏 摄像头
切换
对焦 动态码率 水印 贴纸
YES YES YES YES YES YES YES

Other features of encoder:

  • 美声。
  • 背景音乐。
  • 混音。

H.265是单独的项目,参考ks265codec

The latency is only refined in encoder KSYLive_Android.

The basic features of player:

Android iOS Codec Transport Lowlatency
YES YES H.264+AAC RTMP/FLV/HLS YES

The advanced features of player:

秒开 硬件
解码
软件
解码
音量 缩放 截图 旋转 HTTPS 弱网
丢帧
YES YES YES YES YES YES YES NO NO

Other features of player:

  • H.265
  • 反交错

All SDKs are listed bellow:

PILI

PILI engineering is mobile SDK of qiniu.

The basic features of encoder:

Android iOS Codec Transport Hardware
Encoder
Software
Encoder
Lowlatency
YES YES H.264+AAC RTMP YES YES NO

The advanced features of encoder:

美颜 横竖屏 摄像头
切换
对焦 动态码率 水印 贴纸
YES YES YES YES YES NO NO

The basic features of player:

Android iOS Codec Transport Lowlatency
YES YES H.264+AAC RTMP/FLV/HLS NO

The advanced features of player:

秒开 硬件
解码
软件
解码
音量 缩放 截图 旋转 HTTPS 弱网
丢帧
YES YES YES YES YES YES YES YES NO

All SDKs are listed bellow:

ALIYUN

阿里云提供了推流和播放的SDK,下载地址和文档。SDK是zip格式,目前没有开放源码,但是可以向其他CDN推流。

编码器特性:

Android iOS Codec Transport Hardware
Encoder
Software
Encoder
Lowlatency
YES YES H.264+AAC RTMP YES NO NO
美颜 横竖屏 摄像头
切换
对焦 动态码率 水印 贴纸
NO NO NO NO NO NO NO

播放器特性:

Android iOS Codec Transport Lowlatency
YES YES H.264+AAC RTMP/FLV/HLS YES

播放器高级特性:

秒开 硬件
解码
软件
解码
音量 缩放 截图 旋转 HTTPS 弱网
丢帧
YES NO NO NO NO NO NO YES YES

SDK链接:

YASEA

YASEASRS-SEA的超级升级版。YASEA是一个可商用的版本,关注的人也非常多,无比强大,有RTMP推流和美颜。SRS-SEA只是一个原型,想了解Android推流可以看这个代码。

编码器特性:

Android iOS Codec Transport Hardware
Encoder
Software
Encoder
Lowlatency
YES NO H.264+AAC RTMP/FLV YES YES NO

编码器高级特性:

美颜 横竖屏 摄像头
切换
对焦 动态码率 水印 贴纸
YES NO NO NO NO NO NO

编码器其他特性:

  • 回声抑制。

版本要求:Android SDK level 16+, Android 4.1, the JELLY_BEAN

SDK链接:

EXOPlayer

EXOPlayer是基于Android新的播放器框架的新播放器,支持众多的协议,包括HTTP-FLV和HLS。虽然不支持RTMP,但是支持FLV,因此延迟可以比HLS低很多。

播放器特性:

Android iOS Codec Transport Lowlatency
YES NO H.264+AAC FLV/HLS YES

YASEA可以和EXOPlayer配合,实现Android上的推流和播放,基于RTMP/FLV的方案,是3秒左右直播的一个可选方案。

LIBRTMP

LIBRTMP或者SRS-LIBRTMP,只是提供了Transport(RTMP)的功能,用于只需要做传输的场景,比如一些安防摄像头厂商,Transport之前是用RTSP/RTP做的,如果需要接入互联网,将流送到CDN给PC和移动端观看,直接使用H5或者Flash,不需要装插件时,可以用librtmp将已经编码的流MUX成FLV(RTMP传输实际上用的是FLV格式),然后通过librtmp发送出去。

SRS-LIBRTMP是SRS导出的库,为何要导出这个库呢?参考WIKI

PC

PC端已经日落西山了啊,一年不如一年,被移动端给闹的啊。

不过对于有些应用场景,还是会用PC端推流,当然是用OBS或者OBS Studio

PC的播放器,要么是Flash(RTMP, FLV, HLS),要么是MSE(H5, DASH, videojs, FLV)。

Low Latency

对于低延迟直播,下面的场景是验证过的,可以在1s左右:

+-----------------+         +-------+         +-----------+
| OBS/FMLE/FFMPEG +---->----+  SRS  +----->---+   Flash   +
+-----------------+         +-------+         +-----------+

当两端改成Android/iOS后,竟然没有一个SDK或者端考虑了如何支持低延迟,延迟他妈的全部都不考虑了,艹。

Winlin 2017.4

Welcome to SRS wiki!

SRS 5.0 wiki

Please select your language:

SRS 4.0 wiki

Please select your language:

SRS 3.0 wiki

Please select your language:

SRS 2.0 wiki

Please select your language:

SRS 1.0 wiki

Please select your language:

Clone this wiki locally