1.搭建RED5 的RTMP流服务器
2.安装好RTMP的流服务器软件,下载这个软件setup-Red5-1.0.1-java6.exe
3.安装oflaDemo,拷贝到D:\Program Files (x86)\Red5\webapps\oflaDemo下面。
4.修改Red5安装目录下的 webapps\oflaDemo\index.html 文件,将jwplayer的 file 属性改成 “hello”。(red5 - 1.0.1 版本)
可以利用source insight 工具修改index.html 内容; 查找 jwplayer 字符串, 将
[html] view plain copy
在CODE上查看代码片派生到我的代码片
jwplayer('mediaspace2').setup({
'flashplayer': 'player.swf',
'file': 'hello',
'streamer': 'rtmpt://localhost:5080/oflaDemo',
'controlbar': 'bottom',
'width': '848',
'height': '360'
中的 file :‘ *flv’,修改为 ‘file’:‘hello’; 上图是修改后的 内容;
还有另一处也可修改: 内容同上面一样;
[html] view plain copy
在CODE上查看代码片派生到我的代码片
jwplayer('mediaspace').setup({
'flashplayer': 'player.swf',
'file': 'hello',
'streamer': 'rtmp://localhost/oflaDemo',
'controlbar': 'bottom',
'width': '848',
'height': '360'
});
5.调用ffmpeg的客户端推流命令:E:\lipy_computers\g\ffmpeg\ffmpeg-3.1.2>E:\lipy_computers\g\ffmpeg\ffmpeg-3.1.2\
ffmpeg.exe -re -i "D:\lipy_computers\d\video\高安 在心里从此永远有个你.flv" -c c
opy -f flv rtmp://localhost/oflaDemo/hello
6.访问 http://localhost:5080/oflaDemo/index.html 在你所修改的播放器上是否可以看到文件的直播了。