直播-srs起步
2024-08-27 07:04:27
srs简介
原料
CentOS Linux release 7.2.1511 (Core)
ffmpeg:
macos可以通过brew install ffmpeg 安装
下载&编译
这个过程过程比较顺利
运行
[chengning@localhost trunk]$ ./objs/srs -c conf/rtmp.conf
[2016-09-25 08:29:33.164][trace][16155][0] XCORE-SRS/2.0.218(ZhouGuowen)
[2016-09-25 08:29:33.164][trace][16155][0] config parse complete
[2016-09-25 08:29:33.164][trace][16155][0] write log to file ./objs/srs.log
[2016-09-25 08:29:33.164][trace][16155][0] you can: tailf ./objs/srs.log
[2016-09-25 08:29:33.164][trace][16155][0] @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLog
[chengning@localhost trunk]$
查看进程是否正常
[chengning@localhost trunk]$ ps aux | grep srs
chengni+ 16116 0.0 0.0 17212 964 pts/0 S 08:23 0:00 ./objs/srs -c conf/rtmp.conf
chengni+ 16159 0.0 0.0 112664 984 pts/0 R+ 08:29 0:00 grep --color=auto srs
[chengning@localhost trunk]$
查看端口打开是否正常
[chengning@localhost trunk]$ sudo netstat -altupn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1935 0.0.0.0:* LISTEN 16116/./objs/srs
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 824/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1192/master
tcp 0 0 192.168.199.156:22 192.168.199.137:52949 ESTABLISHED 9861/sshd: chengnin
tcp6 0 0 :::22 :::* LISTEN 824/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1192/master
udp 0 0 0.0.0.0:47700 0.0.0.0:* 626/dhclient
udp 0 0 0.0.0.0:68 0.0.0.0:* 626/dhclient
udp6 0 0 :::16339 :::* 626/dhclient
发布直播流
准备好一个mp4文件,如lizijun.mp4
将下面的脚步保存在srs.sh文件中
#!/bin/bash -ex
for((;;)); do \
ffmpeg -re -i ./lizijun.mp4 \
-vcodec copy -acodec copy \
-f flv -y rtmp://192.168.199.156/live/livestream; \
sleep 1; \
done
然后运行 ./src
播放
ffplay rtmp://192.168.199.156/live/livestream
最新文章
- UWP中实现自定义标题栏
- PHP代码的执行
- Oracle触发器原理、创建、修改、删除
- iPhone / iPad UI界面设计与图标设计的尺寸设计规范+安卓+网页
- 关于 DWZ 弹出框
- goalng 发布的版本中自动加上 git revision
- Oracle的导入导出
- css3,环绕圆环 loading,小组件
- HDU 4771 Stealing Harry Potter's Precious
- mysql数据库全局只读和会话只读问题解析
- 【异步编程】when.js
- Python 技巧
- maven与eclipse连接的配置
- sql server 学习笔记 ( row_number, rank, dense_rank over partition by order by )
- Vue-CLI3.0版本配置BootStrap的方法
- Java控制并发线程数的Semaphore
- C#简单的通用分页
- spring boot与spring mvc的区别是什么?
- 调用数据库-corina
- 聊聊iOS Keychain
热门文章
- iterator的romove方法的注意事项
- freemaker中的map遍历
- EL表达式判断不能为空
- MySQL架构篇(一)
- Oracle trunc() 函数处理数字、日期的整理
- 5_Longest Palindromic Substring(Manacher) --LeetCode
- java字符流
- java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class org.
- Angular21 动态绑定CSS样式
- phpstorm 2017.3.3的安装和破解