- SRS Wiki 首页
- SRS Arch
- ARM转码
- 带宽测试
- 安装
- 客户端 SDK
- 开源的客户端 SDK
- DeliveryHDS
- Delivery HLS
- Delivery HTTP FLV Stream
- Delivery Method
- 分发 RTMP 流
- HttpServer
- DRM
- DVR
- Edge Server
- 功能列表
- Live Streaming Transcode
- 点播 FLV 流
- Forward For Small Cluster
- GIT
- GPERF 内存和性能分析
- gprof 性能分析
- 心跳
- SRS 支持 HEVC 编码
- SRS 简介
- HTTP API
- HTTP Callback
- SRS Embeded HTTP Server
- 集成开发环境
- 采集
- K8S
- Kafka
- SRS 系统服务
- LiveShow
- LogRotate
- 低延时直播应用
- Exec
- OriginCluster
- Perf性能分析
- Performance Banchmark
- Project
- Performance benchmark for SRS on RaspberryPi
- Reload
- REUSE PORT
- WebRTC
- ATC支持HLS/HDS热备
- 分发方式比较
- RTMP Handshake
- URL Specification
- Use Scenarios
- ARM上部署SRS实例
- DASH部署实例
- Demo的部署
- FFMPEG转码部署实例
- RTMP流转发(Forward)部署实例
- HLS部署实例
- SRS-HTTP服务部署实例
- SRS-HTTP-FLV部署实例
- SRS-HTTP-FLV集群部署实例
- Ingest采集实例
- RTMP源站集群部署实例
- RTMP低延时配置
- RTMP部署实例
- RTMP边缘集群部署实例
- SRT deploy example
- 转码后分发HLS部署实例
- Security
- 服务器端开发脚本
- 开始使用
- Snapshot
- SpecialControl
- SRS提供的librtmp
- SRS for linux-arm
- SRS Log System
- SRT媒体编码支持格式
- SRT参数配置
- SRT直播地址格式简介
- SRT
- Streamer
- TimeJitter
- Web P2P
- Windows下的SRS
Streamer
Streamer是SRS作为服务器侦听并接收其他协议的流(譬如RTSP,MPEG-TS over UDP等等),将这些协议的流转换成RTMP推送给自己,以使用RTMP/HLS/HTTP分发流。
Use Scenario
常见的应用场景包括:
- Push MPEG-TS over UDP to SRS:通过UDP协议,将MPEG-TS推送到SRS,分发为RTMP/HLS/HTTP流。
- Push RTSP to SRS:通过RTSP协议,将流推送到SRS,分发为RTMP/HLS/HTTP流。
- POST FLV over HTTP to SRS: 通过HTTP协议,将FLV流POST到SRS,分发为RTMP/HLS/HTTP流。
备注:Streamer将其他支持的协议推送RTMP给SRS后,所有SRS的功能都能支持。譬如,推RTSP流给Streamer,Streamer转成RTMP推送给SRS,若vhost是edge,SRS将RTMP流转发给源站。或者将RTMP流转码,或者直接转发。另外,所有分发方法都是可用的,譬如推RTSP流给Streamer,Streamer转成RTMP推给SRS,以RTMP/HLS/HTTP分发。
Build
编译SRS时打开StreamCaster支持,参考Build:
./configure --with-stream-caster
Protocols
目前Streamer支持的协议包括:
- MPEG-TS over UDP:已支持,可使用FFMPEG或其他编码器
push MPEG-TS over UDP
到SRS上。 - Push RTSP to SRS:已支持,可以使用FFMPEG或其他编码器
push rtsp to SRS
。 - POST FLV over HTTP to SRS: 已支持,可用于AndroidPublisher推流。
Config
The config for stream casters:
# the streamer cast stream from other protocol to SRS over RTMP.
# @see https://github.com/ossrs/srs/tree/develop#stream-architecture
stream_caster {
# whether stream caster is enabled.
# default: off
enabled off;
# the caster type of stream, the casters:
# mpegts_over_udp, MPEG-TS over UDP caster.
# rtsp, Real Time Streaming Protocol (RTSP).
# flv, FLV over HTTP POST.
caster mpegts_over_udp;
# the output rtmp url.
# for mpegts_over_udp caster, the typically output url:
# rtmp://127.0.0.1/live/livestream
# for rtsp caster, the typically output url:
# rtmp://127.0.0.1/[app]/[stream]
# for example, the rtsp url:
# rtsp://192.168.1.173:8544/live/livestream.sdp
# where the [app] is "live" and [stream] is "livestream", output is:
# rtmp://127.0.0.1/live/livestream
output rtmp://127.0.0.1/live/livestream;
# the listen port for stream caster.
# for mpegts_over_udp caster, listen at udp port. for example, 8935.
# for rtsp caster, listen at tcp port. for example, 554.
# for flv caster, listen at tcp port. for example, 8936.
# TODO: support listen at <[ip:]port>
listen 8935;
# for the rtsp caster, the rtp server local port over udp,
# which reply the rtsp setup request message, the port will be used:
# [rtp_port_min, rtp_port_max)
rtp_port_min 57200;
rtp_port_max 57300;
}
Push MPEG-TS over UDP
SRS可以侦听一个udp端口,编码器将流推送到这个udp端口(SPTS)后,SRS会转成一路RTMP流。后面RTMP流能支持的功能都支持。
配置如下,参考conf/push.mpegts.over.udp.conf
:
# the streamer cast stream from other protocol to SRS over RTMP.
# @see https://github.com/ossrs/srs/tree/develop#stream-architecture
stream_caster {
enabled on;
caster mpegts_over_udp;
output rtmp://127.0.0.1/live/livestream;
listen 1935;
}
参考:https://github.com/ossrs/srs/issues/250
Push RTSP to SRS
SRS可以侦听一个tcp端口,编码器将流推送到这个tcp端口(RTSP)后,SRS会转成一路RTMP流。后面RTMP流能支持的功能都支持。
配置如下,参考conf/push.rtsp.conf
:
# the streamer cast stream from other protocol to SRS over RTMP.
# @see https://github.com/ossrs/srs/tree/develop#stream-architecture
stream_caster {
enabled on;
caster rtsp;
output rtmp://127.0.0.1/[app]/[stream];
listen 554;
rtp_port_min 57200;
rtp_port_max 57300;
}
参考:https://github.com/ossrs/srs/issues/133
Push HTTP FLV to SRS
SRS可以侦听一个HTTP端口,编码器将流推送到这个http端口后,SRS会转成一路RTMP流。所有RTMP流的功能都能支持。
配置如下,参考conf/push.flv.conf
:
# the streamer cast stream from other protocol to SRS over RTMP.
# @see https://github.com/ossrs/srs/tree/develop#stream-architecture
stream_caster {
enabled on;
caster flv;
output rtmp://127.0.0.1/[app]/[stream];
listen 8936;
}
这个配置时,客户端推流的地址,例如:http://127.0.0.1:8936/live/sea.flv
播放RTMP流地址是:rtmp://127.0.0.1/live/sea
播放HLS流地址是:http://127.0.0.1:8080/live/sea.m3u8
注意:需要配置HTTP服务器和HLS,参考conf/push.flv.conf
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论