您的位置:首页 > 其它

simple-rtmp-server安装

2016-05-24 16:33 288 查看
安装分以下几部:

step 1: build srs

tar xf simple-rtmp-server-*.*.tar.gz

cd simple-rtmp-server-*.*/trunk
./configure --with-ssl --with-hls  

/*根据需求,命令不同,

--with-ssl                enable rtmp complex handshake, requires openssl-devel installed.

                            to delivery h264 video and aac audio to flash player.

--with-hls                enable hls streaming, mux RTMP to m3u8/ts files.*/

make

make install   // 默认安装在/usr/local/srs

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

step 2: start srs

./objs/srs -c conf/srs.conf

step 4: publish live stream

FMS URL: rtmp://127.0.0.1:1935/live

Stream: livestream

For example, use ffmpeg to publish:

ffmpeg -re -i source.flv -vcodec copy -acodec copy -f flv -y rtmp://127.0.0.1:1935/live/livestream

step 5: play live stream
rtmp url: rtmp://127.0.0.1:1935/live/livestream

调试

前台运行

daemon              on;

#以daemon的方式启动,如果要启动在console,那么需要配置daemon off;并且,需要配置srs_log_tank console;

rtmp 延时约3秒,苹果不支持。

http-flv延时约3秒,苹果不支持。

hls切片/转码延时月6秒。

测试HTTP-FLV

1 编译./configure && make


2 启动

./objs/srs -c conf/http.flv.live.conf


3 推流

ffmpeg -re  -i   171.flv  -c copy -f flv rtmp://10.80.3.17/live/1

4 播放

ffplay http://10.80.3.17:8080/live/1.flv
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: