Simple Rtmp Server的安装与简单使用

简介: Simple Rtmp Server是一个国人编写的开源的RTMP/HLS流媒体服务器. 功能与nginx-rtmp-module类似, 可以实现rtmp/hls的分发.   有关nginx-rtmp-module的可参照: http://blog.

Simple Rtmp Server是一个国人编写的开源的RTMP/HLS流媒体服务器. 功能与nginx-rtmp-module类似, 可以实现rtmp/hls的分发.

  有关nginx-rtmp-module的可参照: http://blog.csdn.NET/redstarofsleep/article/details/45092147

  编译与安装过程十分的简单

 

[plain]  view plain  copy
 
 print?
  1.   ./configure --prefix=/usr/local/srs --rtmp-hls  
  2.   
  3.   make  
  4.   
  5.   make install  

  标准的三条命令就可完成安装. --rtmp-hls表示开启rtmp和hls, 其它的编译参数可通过./configure -h查看.

 

 

  安装完后,目录下有三个文件夹conf, etc, objs. 我们常用的是conf和objs两个目录下的内容, conf下是各类配置文件的例子, objs下是可执行文件.

  启动服务器是通过-c参数指定一个配置文件即可

[plain]  view plain  copy
 
 print?
  1.   ./objs/srs -c conf/hls.conf  

  

 

  如果是hls的话,配置文件大概是这样的:

 

[plain]  view plain  copy
 
 print?
  1. # the config for srs to delivery hls  
  2. # @see https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_SampleHLS  
  3. # @see full.conf for detail config.  
  4.   
  5. listen              1935;  
  6. max_connections     1000;  
  7. vhost __defaultVhost__ {  
  8.     hls {  
  9.         enabled         on;  
  10.         hls_path        /usr/local/nginx/html;  
  11.         hls_fragment    10;  
  12.         hls_window      60;  
  13.     }  
  14. }  


  其中的hls_path是存放hls分片ts文件和m3u8的目录, 我上面的例子中把它指定到nginx下.这样就可以直接播放hls视频流了.

 

  如果是ffmpeg推送,那是和nginx-rtmp-module是一样的:

 

[plain]  view plain  copy
 
 print?
  1. ffmpeg -re -i "D:\download\film\aqgy\02.mp4" -vcodec libx264 -vprofile baseline -acodec aac    
  2.  -ar 44100 -strict -2 -ac 1 -f flv -s 1280x720 -q 10 rtmp://server:1935/    
  3. myapp/test1  


  总体来说这个SimpleRtmpServer在配置使用上没有什么难度,基本都是参照nginx-rtmp-module的.

目录
相关文章
|
Web App开发 应用服务中间件 nginx
利用Simple-RTMP-Server(SRS)来进行直播
1、下载SRS 官方地址:http://www.ossrs.net/srs.release/releases/ 百度地址:http://pan.baidu.com/s/1kV8WQpx   2、编译安装SRS tar zxvf srs-2.0-b2.tar.gz cd srs-2.0-b2 mv trunk/ /usr/local/srs cd /usr/local/srs  ./configure --full     #--full,开启SRS所有的功能。
2743 0
|
4月前
|
NoSQL 容器 消息中间件
rtsp-simple-server + srs搭建流媒体服务器
rtsp-simple-server + srs搭建流媒体服务器
241 0
|
9月前
|
自然语言处理 Java
CoreNLP server的开启与使用方法
Ubuntu20.04.2系统本身不含有JDK,而CoreNLP需要依赖JDK进行运行,所以需要先安装好JDK,可以输入java,然后系统会自动提示没有安装JDK,并会推荐安装的版本
126 0
|
10月前
UE Http Server 插件说明
UE Http Server 插件说明
256 0
|
10月前
UE Http Server Plug -in description
UE Http Server Plug -in description
64 0
|
编解码
gstreamer之RTSP Server编译及注意事项
gstreamer之RTSP Server编译及注意事项
384 0
gstreamer之RTSP Server test-mp4正确运行代码
gstreamer之RTSP Server test-mp4正确运行代码
102 0
|
容器 应用服务中间件 nginx
|
Android开发
|
应用服务中间件 PHP 开发工具
Swoole based Simple HTTP Server Implementation using OSS PHP SDK
Currently, program developers are leveraging Swoole to implement network server programs in place of C++, Java and other complex programming languages.
4309 0