10

SRS 流媒体服务器运行流程(推流端使用OBS,拉流端使用VLC)

 4 years ago
source link: https://blog.csdn.net/Airo_9661/article/details/112169157
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

SRS 流媒体服务器运行流程(推流端使用OBS,拉流端使用VLC)

1 服务器前期准
1.1系统要求
操作系统centos 7.0 以上64位
使用git 指令下载
2 下载安装及运行 SRS

2.1 下载 SRS

git clone https://github.com/ossrs/srs 

2.2 进入运行目录
cd 到SRS中的trunk 目录
2.3 生成Makefile文件

./configure

2.4 编译

make

2.5 运行SRS`

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

2.6 检查SRS 运行情况

./etc/init.d/srs status

3 开放端口
3.1 查看端口

netstat -lnpt

3.2 判断端口情况
SRS运行的情况下,1935、8080端口需要处于开放状态,若1935、8080端口不在开放端口行列,则需要执行以下操作开放,手动开放端口操作如下:
3.2.1 获取 root 权限

su root

3.2.2 生成 /etc/sysconfig/iptables

iptables -P INPUT ACCEPT

3.2.3 执行开放端口命令

/sbin/iptables -I INPUT -p tcp –dport 1935 -j ACCEPT

3.2.4 保存

iptables—save > /etc/sysconfig/iptables

4 防火墙设置
SRS 服务器推流和拉流过程中,SRS 运行的Linux系统防火墙需要处于关闭状态
4.1 查看防火墙状态

firewall-cmd --state

4.2 关闭防火墙

systemctl stop firewalld 

5 推送端设置及运行
5.1 安装OBS Studio
在windows 环境下安装OBS
下载网址:https://obsproject.com/zh-cn/download

5.2 添加场景

5.3 添加视频来源(手册默认使用视频采集设备和音频输入采集)

5.4 设置推流
5.4.1 点击进入 文件 > 设置 > 推流 界面

5.4.2 服务器格式遵循 rtmp://ip:1935/live/ 的格式

5.4.3 串流密钥是自定义命名(手册默认livestream),设置完成后点击确认回到主界面

5.4.4 主界面点击“开始推流”,进入推流状态,出现丢帧、kb/s:2675 等数据

6 拉流端设置及运行
6.1 安装VLC media player
在windows 环境下安装VLC
下载网址:https://www.videolan.org/

6.2 启动VLC 点击 媒体 > 打开网络串流

6.3 网络URL格式
网络URL格式rtmp://ip:1935/live/串流密钥 的格式(手册默认rtmp://192.168.1.150:1935/live/livestream)

6.4 点击播放

带图片的完整PDF版本已制作完成,下载不需要积分,希望能帮到大家,下载地址:https://download.csdn.net/download/Airo_9661/14020242


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK