Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyibiao committed May 13, 2016
1 parent 535aedb commit 740509a
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 0 deletions.
162 changes: 162 additions & 0 deletions 直播/Mac安装RTMP服务器.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
#概述

Mac安装RTMP服务器过程记录下来!

#一、安装Homebrew

执行命令:

```
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

如果已经安装过,而想要卸载:

```
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
```

如果已经安装过,则不用安装!

#二、安装nginx

先glone nginx项目到本地:

```
brew tap homebrew/nginx
```

执行安装:

```
brew install nginx-full --with-rtmp-module
```

通过操作以上步骤,nginx和rtmp模块就安装好了

#三、运行nginx

执行命令:

```
nginx
```

出现如下页面信息,表示nginx服务器搭建成功了,而且已经安装了RTMP模块了:

![image](http://www.henishuo.com/wp-content/uploads/2016/05/[email protected])



#四、配置nginx和rtmp

下面开始来配置nginx的rtmp模块。首先,我们要看看nginx安装到哪里了:

```
brew info nginx-full
```

出现如下类似信息:

```
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
- Tips -
Run port 80:
$ sudo chown root:wheel /usr/local/Cellar/nginx-full/1.10.0/bin/nginx
$ sudo chmod u+s /usr/local/Cellar/nginx-full/1.10.0/bin/nginx
Reload config:
$ nginx -s reload
Reopen Logfile:
$ nginx -s reopen
Stop process:
$ nginx -s stop
Waiting on exit process
$ nginx -s quit
To have launchd start homebrew/nginx/nginx-full now and restart at login:
brew services start homebrew/nginx/nginx-full
Or, if you don't want/need a background service you can just run:
nginx
```

从这些信息中,可以看到nginx.conf文件在:

```
/usr/local/etc/nginx/nginx.conf
```

nginx完整路径:

```
/usr/local/Cellar/nginx-full/1.10.0/bin/nginx
```


通过以下打开nginx.conf配置文件来配置:

```
vi /usr/local/etc/nginx/nginx.conf
```

直接滚动到最后一行,以就是在http {} 之后:

```
http {
这里默认就有的,不用管这些
}
# 在http节点后面加上rtmp配置:
rtmp {
server {
listen 5920;
application rtmplive {
live on;
record off;
}
}
}
```

重启nginx:

```
/usr/local/Cellar/nginx-full/1.10.0/bin/nginx -s reload
```


#五、安装ffmpeg

输入以下命令来安装ffmpeg:

```
brew install ffmpeg
```

安装这个需要等一段时间,然后准备一个视频文件作为来推流,我们在安装一个支持rtmp协议的视频播放器,Mac下可以用VLC。

#六、ffmpeg推流

```
ffmpeg -re -i /Users/huangyibiao/Desktop/test.mov -vcodec libx264 -acodec aac -f flv rtmp://localhost:5920/rtmplive/room
```

将视频推流到服务器后,打开VLC,然后file->open network->输入:

```
rtmp://localhost:5920/rtmplive/room
```

观看视频!

#小结

终于安装解决RTMP服务器了,后面可以自己尝试去学习相关技术了!


22 changes: 22 additions & 0 deletions 直播/直播基础解惑笔记.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#概述

本人在直播方向确实是菜鸟一枚,在群里向各位牛牛们请教解惑了不少问题,本篇记录下来,希望后来者也能更快地了解直播相关基础知识!

#Q1:为什么只有在推流的过程中才能播放?

![image](http://www.henishuo.com/wp-content/uploads/2016/05/[email protected])

直播是实时的,服务器不会存储流文件,所以推流完成之后就不能播放了!

#Q2:什么是拉流?

大家常说拉流,这是什么?推流是推到服务器了,那么拉流就应该是从服务器拉到客户端。服务器既然没有存储文件流的话,客户端如何能拉流?

![image](http://www.henishuo.com/wp-content/uploads/2016/05/[email protected])

#小结

后续会继续将笔者在学习过程中所遇到的疑惑,在得到解惑之后,将会记录到此处!

如果您跟笔者一样是新手,可以关注本篇文章哦!

41 changes: 41 additions & 0 deletions 直播/直播测试地址.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#概述

想要学习直播,如果不会搭建服务器,如何学习客户端相关技术知识呢?笔者已经成功地搭建了nginx+rtmp服务器了。

如果不懂如何搭建服务器,那么本篇收录的RTMP服务器地址可以在学习中使用到,用于测试!

#HLS直播地址

* [http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8](http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8) 香港卫视
* [http://221.120.177.59/hls/i3d7ragr.m3u8](http://221.120.177.59/hls/i3d7ragr.m3u8) 香港卫视精品台
* [http://wzfree.10043.doftp.com/tvtest/182tv.php/live/id/suntv.m3u8](http://wzfree.10043.doftp.com/tvtest/182tv.php/live/id/suntv.m3u8) 阳光卫视
* [http://v.hrtv8.com/vip.hrtv8.com/stream/2506.m3u8](http://v.hrtv8.com/vip.hrtv8.com/stream/2506.m3u8) 本港台
* [http://wzfree.10043.doftp.com/tvtest/182tv.php/live/id/hlc.m3u8](http://wzfree.10043.doftp.com/tvtest/182tv.php/live/id/hlc.m3u8) 健康生活台
* [http://202.102.79.114:554/live/tvb8.stream/playlist.m3u8](http://202.102.79.114:554/live/tvb8.stream/playlist.m3u8) TV8
* [http://live.3gv.ifeng.com/live/hongkong.m3u8](http://live.3gv.ifeng.com/live/hongkong.m3u8) 凤凰卫视香港台
* [http://58.221.254.33:1935/live/zhongwen.sdp/playlist.m3u](http://58.221.254.33:1935/live/zhongwen.sdp/playlist.m3u) 资讯卫视

#RTMP直播地址

如果公司不是做直播的,那就没有后台服务器,则想要学习直播相关知识又该如何呢?可以直接用电视台的rtmp直播地址:

* [rtmp://live.hkstv.hk.lxdns.com/live/hks](rtmp://live.hkstv.hk.lxdns.com/live/hks)
* [rtmp://www.planeta-online.tv:1936/live/channel_4](rtmp://www.planeta-online.tv:1936/live/channel_4)
* [rtmp://live.hkstv.hk.lxdns.com/live/hks](rtmp://live.hkstv.hk.lxdns.com/live/hks) 香港卫视

* [rtmp://221.120.177.59/livestream/ucagm8kk](rtmp://221.120.177.59/livestream/ucagm8kk) 香港卫视精品台
* [http://main.gslb.ku6.com/broadcast/sub?channel=910](http://main.gslb.ku6.com/broadcast/sub?channel=910) 酷六V音乐

#RSTP直播地址

* [rtsp://116.199.127.68/huayu](rtsp://116.199.127.68/huayu) 华娱卫视
* [rtsp://116.199.127.68/bengang](rtsp://116.199.127.68/bengang) 本港卫视
* [rtsp://rtsp.vdowowza.tvb.com/tvblive/mobile_inews_200.stream](rtsp://rtsp.vdowowza.tvb.com/tvblive/mobile_inews_200.stream) 互动新闻台1
* [rtsp://live.3gv.ifeng.com/live/71](rtsp://live.3gv.ifeng.com/live/71) 凤凰资讯高清

#结尾

太多了,这里就不记录那么多了,能有用的就可以了!



1 change: 1 addition & 0 deletions 直播/直播相关资源收集.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#直播相关文章

* [直播RTMP可用于测试的服务器地址](http://www.henishuo.com/live-test-server/)
* [FFmpeg av_dump_format输出的tbn、tbc、tbr、PAR、DAR的含义](http://www.jianshu.com/p/5b78a91f1091)
* [FFmpeg 3.0 计算视频时长](http://www.jianshu.com/p/66b13b2b2979)
* [HLS Streaming Tool Download](http://www.henishuo.com/hls-streaming-tool/) HLS streaming工具下载,用于处理m3u8音、视频源的
Expand Down

0 comments on commit 740509a

Please sign in to comment.