您的位置:首页 > 其它

rtsp2rtmp程序,从rtsp摄像机获取流,转换为rtmp push到FMS

2016-04-18 10:12 113 查看
/article/3631872.html


分类:

流媒体开发(12)


版权声明:可自由转载。

软件功能:

1、从rtsp摄像机(rtsp server)获取流,然后转换为rtmp协议,将流推送到FMS(Flash Media Server)上面。

2、支持2000路以上rtsp摄像机(受限于CPU能力),只需要编辑rtsp2rtmp.conf文件即可,如下:

[0]

rtsp_url=rtsp://192.168.2.10:554/stream/1

rtmp_url=rtmp://192.168.2.9/live/720P

;rtsp_url=rtsp://username:password@192.168.2.10:554/stream/1

;[1]

;rtsp_url=rtsp://192.168.2.10:554/stream/2

;rtmp_url=rtmp://192.168.2.9/live/CIF

3、可运行于windows or linux平台。

4、可根据用户要求提供操作界面。

应用场景:

1、幼儿园等小型商业客户,将N台rtsp摄像机数据通过一台rtmp服务器推送到FMS进行直播。

2、openwrt路由器,将N台wifi ipcam收敛后传送给FMS作为直播。

调试过程,用一台hi3518E摄像机作为流,用srs作为FMS。用ubuntu虚拟机作为运行环境。

先把srs跑起来,srs就是Flash Media Server。

binaries @see: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_Build
you can:

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

to start the srs server, with config conf/srs.conf.

make[1]: Leaving directory `/home/srs/trunk'

root@freeman-desktop:/home/srs/trunk# vi run.sh

root@freeman-desktop:/home/srs/trunk# chmod +x run.sh

root@freeman-desktop:/home/srs/trunk# ./run.sh

[2015-10-10 19:57:13.976][trace][3130][0] config parse complete

[2015-10-10 19:57:13.976][trace][3130][0] write log to file ./objs/srs.log

[2015-10-10 19:57:13.976][trace][3130][0] you can: tailf ./objs/srs.log

[2015-10-10 19:57:13.976][trace][3130][0] @see: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SrsLog
root@freeman-desktop:/home/srs/trunk# ps

PID TTY TIME CMD

2433 pts/0 00:00:00 su

2443 pts/0 00:00:00 bash

3132 pts/0 00:00:00 srs

3133 pts/0 00:00:00 ps

运行rtsp2rtmp&时,总是发生Segmentation fault的现象。

./rtsp2rtmp &

[1] 2234

root@freeman-desktop:/home/rtsp2rtmp/master/src#

[1]+ Segmentation fault ./rtsp2rtmp

查明原因:srs编译时使用了--without-ssl。在srs/objs/下面,有一些第三方lib,包括http-parser-2.1, gtest-1.6.0,openssl-1.0.1f,st-1.9。

把它们重新配置编译一下就可以。
http://www.ossrs.net/srs.release/trunk/research/players/srs_player.html?
填入:rtmp://192.168.2.9/live/main就可以播放了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: