superconvert / smart_rtmpd

RTMP server, smart, compact, high performance(c, c++), high concurrency, easy to maintain, easy to deploy, (supports multiple operating systems Windows and Linux, ARM, FreeBSD)
http://www.qiyicc.com
425 stars 74 forks source link
dash ffmpeg gb28181 h264 h265 hevc hls http-flv m3u8 mpegts nginx nvr obs opus rtmp rtsp srs vmix webrtc wowza

smart rtmpd 简介

smart_rtpmd 是一款用于直播,录播性能卓越的服务器。如果您不理解,可以理解为和 nginx-rtmp, srs ,并与此功能类似,特点是性能卓越,跨平台,无依赖,部署和维护十分方便,解压既能运行。
smart rtmpd is a streaming media server. It can run on multiple systems ubuntu, centos, freebsd, windows & arm64. It is small, independent, easy to deploy, and has high performance.

说明

特点

支持哪些 OS

益处

最大的益处就是极大的节约您的运营成本,维护成本,迁移成本,

smart rtmpd 下载地址

站点 地址
official http://www.qiyicc.com/download/rtmpd.zip
github https://github.com/superconvert/smart_rtmpd
gitee https://gitee.com/superconvert/smart_rtmpd

smart rtmpd 支持哪些音视频编码

support media codec

video codec audio codec
h264, h265 aac
h264, h265 pcmu/pcma
vp8 ( webrtc ) opus ( webrtc )
h264 ( webrtc ) pcmu/pcma ( webrtc )

support protocol

client server protocol
srt smart_rtmpd rtmp[s], http[s]-flv, ws(s)-flv, http[s]-hls, https[s]-dash, rtsp[s], webrtc, srt
rtmp[s] smart_rtmpd rtmp[s], http[s]-flv, ws(s)-flv, http[s]-hls, https[s]-dash, rtsp[s], webrtc, srt
rtsp[s] smart_rtmpd rtmp[s], http[s]-flv, ws(s)-flv, http[s]-hls, https[s]-dash, rtsp[s], webrtc, srt

input & output detail

input video audio output rtmp rtsp( udp/tcp ) flv( http/websocket ) hls dash srt webrtc( video baseline level 3.1 )
rtmp h264 pcma/pcmu yes yes yes only video onlyvideo only video h264/vp8, pcma/pcmu
rtmp h264 aac yes yes yes yes yes yes h264/vp8, aac - opus
rtmp hevc pcma/pcmu yes yes yes only video only video only video only audio = pcma/pcmu
rtmp hevc aac yes yes yes yes yes yes only audio = aac - opus
rtsp h264 pcma/pcmu yes yes yes only video only video only video h264/vp8, pcma/pcmu
rtsp h264 aac yes yes yes yes yes yes h264/vp8, aac - opus
rtsp hevc pcma/pcmu yes yes yes only video only video only video only audio = pcma/pcmu
rtsp hevc aac yes yes yes yes yes yes only audio = aac - opus
srt h264 aac yes yes yes yes yes yes h264/vp8, aac - opus
srt hevc aac yes yes yes yes yes yes only audio = aac - opus

URL description

URL description isok
rtmp://192.168.1.1:1935/live/stream live stream yes
rtmp://192.168.1.1:1935/rec/stream record stream yes
rmtp://192.168.1.1:1935/sky/camera bad format no
rtsp://192.168.1.105:9554/live/music live stream yes
rtsp://192.168.1.105:9554/rec/music live stream yes
rtsp://192.168.1.105:9554/class/music bad format no
srt://192.168.1.105:9000/live/space record stream yes
srt://192.168.1.105:9000/rec/space record stream yes
srt://192.168.1.105:9000/record/space bad format no

only support "live" or "rec" app tag, but no support "sky", "class" or "record" other app tag !!!

怎么使用 smart rtmpd

最快部署

  1. 下载软件包,解压 rtmpd.zip, 解压后得到 windows 的 smart_rtmpd 服务器
  2. 运行 smart_rtmpd.exe 如下图,既表示成功 image
  3. 推流验证,运行 ffmpeg.exe ( Windows下的 ffmpeg.exe 下载地址:https://github.com/BtbN/FFmpeg-Builds/releases ) image
  4. 播流验证 image image

例子 ( example )

说明 链接
推拉流 ( pull/pull stream ) https://github.com/superconvert/smart_rtmpd/tree/master/example
web接口 ( web interface ) https://github.com/superconvert/smart_rtmpd/blob/master/web_dev.md
auth接口 ( web authentication ) https://github.com/superconvert/smart_rtmpd/blob/master/web_auth.md
集群 待续 ...
webrtc https://github.com/superconvert/smart_rtmpd/blob/master/webrtc.md
webrtc im https://github.com/superconvert/smart_rtmpd/blob/master/webrtc_im.md
录像 ( recording ) https://blog.csdn.net/freeabc/article/details/103360588
nat模式 ( nat mode ) https://blog.csdn.net/freeabc/article/details/113446129
重写 ( rewrite ) 待续 ...
vod配置 ( vod config) 待续 ...

推拉流

https://blog.csdn.net/freeabc/article/details/117403471?spm=1001.2014.3001.5501

build ffmpeg support rtmps, see this link:

https://www.iiwnz.com/compile-ffmpeg-with-rtmps-for-facebook/
you can play rtmps with vlc player.

smart rtmpd recorder stream

https://github.com/superconvert/smart_rtmpd/blob/master/recording.md

smart rtmpd 商业支持

联系方式

name description
QQ 99766553
QQ 群 190583317, 300474021, 271191746
WebChat(微信) 99766553
E-mail(邮箱) cwf12345@sina.com

download file or vod mode :

  1. you can put a video file into /vod directory, for example: test.mkv
  2. use player ffplay http://192.168.1.1:8080/vod/test.mkv
  3. you can make a sub directory in the /vod, for example: /vod/discovery
  4. put a video file into /vod/discovery directory, for example: space.mkv
  5. use player play it, ffplay http://192.168.1.1:8080/vod/discovery/space.mkv

more web interface, see this link : https://my.oschina.net/u/4249347/blog/5529704

nat map mode :

image

outer user can push stream rtmp://61.180.166.16/live/stream, inner user can play with rtmp://192.168.1.1/live/stream

build cluster or cdn distribution :

  if you have two server
  server A (intranet ip: 192.168.1.1, domain: www.qiyicc.com) 
  server B (intranet ip: 192.168.1.2, domain: www.qiyicc.com)

  you can modify policy.xml file in server A:
  ... ...
  <vhosts>
      <vhost name="rtmp://www.qiyicc.com/live">
      <forward rewrite="">192.168.1.2</forward>         
  </vhost>
  </vhosts>

 if you push stream rtmp://www.qiyicc.com/live/stream to server A, the server A will forward this stream to server B, 
 if you push stream rtmp://www.qiyicc.com/live/sport to server A, it is also forard this stream to server B.
 user can pull url rtmp://www.qiyicc.com/live/stream or rtmp://www.qiyicc.com/live/sport from server B, 
 for many server repeat this proccess or each other forward.
 this is call app forward!

image

forward thirtparty :

 if you have rmtp url rtmp://www.qiyicc.com/live/sport, you cank distribution this stream to other service.
 for example : rtmp://www.espn.com/live/sport, thirtypart server address : 54.230.173.30

 you can modify policy.xml file
 ... ...
 ... ...
 <urls>         
     <url name="rtmp://www.qiyicc.com/live/sport">      
    <forward rewrite="rtmp://www.espn.com/live/sport">54.230.173.30:1935</forward>          
    <forward rewrite="rtmps://www.espn.com/live/sport">54.230.173.32:1935</forward>
    <forward></forward>
 </url>
 </urls>

thirtpart user can play this stream.
this is call url forward!   
good luck. 

image

web portal

web browser <-------> nodejs server ( source code ) <----> smart_rtmpd see https://github.com/superconvert/smart_rtmpd/tree/master/web/src

web development interface : https://my.oschina.net/u/4249347/blog/5529704

web player

you can put all file ( see below url ) to smart_rtmpd html dir https://github.com/superconvert/smart_rtmpd/tree/master/h5%20player/demo input url http://192.168.1.1:8080 ,good luck!