Windows下Red5流媒体服务器搭建及使用(二)

搭建好流媒体服务器之后,如何使用呢。

1,更改IP与端口。

进入red5-server\conf文件夹下,打开red5.properties文件

# HTTP
http.host=172.16.129.178
http.port=3002
https.port=3003

# RTMP
rtmp.host=172.16.129.178
rtmp.port=3004

注:http是访问的地址,rtmp是推流和播放的地址。

2,使用

(1)有外置摄像头的可以使用自带的Publish进行测试使用

参考:http://www.voidcn.com/article/p-qqujspag-bms.html

(2)没有外置摄像头。

建议:以下两种我都测试过,都可以使用。可下载其它软件去推流使用,比如Flash Media Live Encoder 3.2,下载地址:https://download.csdn.net/download/iamshaofa/3629390。也可与安卓demo配合使用。我这使用的安卓demo。

到github上下载一个安卓推流的demo,然后在red5-server\webapps\live里写了一个播放的index.html和一个jwplayer.js文件。

推流摄像安卓demo:https://github.com/runner365/android_rtmppush_sdk

推流录屏安卓demo:https://github.com/eterrao/ScreenRecorder

播放:将文件复制到red5-server\webapps\live文件夹下,修改以下ip和端口

<script type='text/javascript'>
  jwplayer('mediaspace').setup({
    'flashplayer': 'player.swf',
    'file': 'abcd',
    'streamer': 'rtmp://你的ip:3004/live/',
    'controlbar': 'bottom',
    'width': '848',
    'height': '360'
  });
</script>

注:abcd  与 推流时的设置相同。推流的地址eg:rtmp://ip:端口/live/abcd

下载地址:补充

浏览器中输入  ip:端口/live/index.html 即可播放推流过来的视频。

安卓推流地址:rtmp://ip:端口/live/abcd

安卓播放地址:rtmp://ip:端口/live/abcd

结束!

参考连接:https://www.cnblogs.com/jacktang/p/4741777.html

https://blog.csdn.net/chenxupro/article/details/12287771

http://www.voidcn.com/article/p-qqujspag-bms.html

https://blog.csdn.net/qq_34194478/article/details/78978237

https://github.com/runner365/android_rtmppush_sdk

https://github.com/eterrao/ScreenRecorder

猜你喜欢

转载自blog.csdn.net/u011368551/article/details/81069043