from: http://www.jianshu.com/p/bf4066028882
腾讯云直播OBS推流教程
1.安装OBS
- 进入obs 官网 : https://obsproject.com/
- 根据当前系统选择对应的版本(选择GET OBS Studio)
![](http://upload-images.jianshu.io/upload_images/2193677-32d538bcdd58c4d1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 安装过程中可能会出现提示需要安装vcrdist 与 directX ,根据提示进行安装即可
2.OBS推流地址设置
- 登陆腾讯云,进入直播管理页
- 创建频道,接收方设置选择HLS(支持H5,但有15秒左右延迟)
![](http://upload-images.jianshu.io/upload_images/2193677-ca2c98bbcf692cac.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 进入频道,直播源设置 —— 地址 ,复制推流地址
![](http://upload-images.jianshu.io/upload_images/2193677-11e6856fb6a12368.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 打开obs,进入设置(工具栏文件——设置,或右下角设置按钮) —— 串流,串流类型选择流媒体服务器
- 将复制的推流地址复制进URL中, live 之后内容为流密钥
![](http://upload-images.jianshu.io/upload_images/2193677-7e9b917cd1409cae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 左下角新建一个场景,并选择来源(这里我们选择窗口捕获)
![](http://upload-images.jianshu.io/upload_images/2193677-8bc78c97a0284f1d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 右击来源,点击属性,选择来源 (这里会显示所有可以用来直播的窗口,选择犬夜叉第一集)
![](http://upload-images.jianshu.io/upload_images/2193677-538ebd41a39b85ef.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 设置码率,分辨率,不需要声音的话,可以将音频码率设为最低
![](http://upload-images.jianshu.io/upload_images/2193677-f39aec9abb2a1046.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
设置 —— 输出 —— 流
![](http://upload-images.jianshu.io/upload_images/2193677-c974510a5f3efbf8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
设置 —— 视频
- 推流, 点击OBS右下角开始串流进行推流(推流的窗口不要最小化)
![](http://upload-images.jianshu.io/upload_images/2193677-131a9850271e846a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 测试播放,回到刚刚在腾讯云创建的频道,右上角有测试按钮,点击会弹出一个带有直播内容的页面
![](http://upload-images.jianshu.io/upload_images/2193677-e39f6a06806cd9b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- 优化,我们只想让用户看到播放的画面,而不是整个浏览器