srs简介
 
 
原料
CentOS Linux release 7.2.1511 (Core)
ffmpeg:
macos可以通过brew install ffmpeg 安装
 
 
下载&编译
git clone https://github.com/ossrs/srs

cd srs/trunk
 
./configure --disable-all --with-ssl && make
这个过程过程比较顺利
 
 
运行
[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
 

最新文章

  1. UWP中实现自定义标题栏
  2. PHP代码的执行
  3. Oracle触发器原理、创建、修改、删除
  4. iPhone / iPad UI界面设计与图标设计的尺寸设计规范+安卓+网页
  5. 关于 DWZ 弹出框
  6. goalng 发布的版本中自动加上 git revision
  7. Oracle的导入导出
  8. css3,环绕圆环 loading,小组件
  9. HDU 4771 Stealing Harry Potter's Precious
  10. mysql数据库全局只读和会话只读问题解析
  11. 【异步编程】when.js
  12. Python 技巧
  13. maven与eclipse连接的配置
  14. sql server 学习笔记 ( row_number, rank, dense_rank over partition by order by )
  15. Vue-CLI3.0版本配置BootStrap的方法
  16. Java控制并发线程数的Semaphore
  17. C#简单的通用分页
  18. spring boot与spring mvc的区别是什么?
  19. 调用数据库-corina
  20. 聊聊iOS Keychain

热门文章

  1. iterator的romove方法的注意事项
  2. freemaker中的map遍历
  3. EL表达式判断不能为空
  4. MySQL架构篇(一)
  5. Oracle trunc() 函数处理数字、日期的整理
  6. 5_Longest Palindromic Substring(Manacher) --LeetCode
  7. java字符流
  8. java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class org.
  9. Angular21 动态绑定CSS样式
  10. phpstorm 2017.3.3的安装和破解