源码仓库:
https://gitee.com/winlinvip/srs.oschina
4.0源码编译:
https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started-build
修改hls配置文件:
srs.oschina/trunk/conf/hls.conf
端口建议不为8080
运行srs:
cd 到srs.oschina/trunk
./objs/srs -c conf/srs.conf
查看srs是否运行
# 查看SRS的状态
./etc/init.d/srs status
# 或者看SRS的日志
tail -n 30 -f ./objs/srs.log
如下显示在运行
MB0:trunk $ ./etc/init.d/srs status
SRS(pid 90408) is running. [ OK ]
MB0:trunk $ tail -n 30 -f ./objs/srs.log
[2021-08-13 10:30:36.634][Trace][90408][12c97232] Hybrid cpu=0.00%,0MB, cid=1,1, timer=61,0,0, clock=0,22,25,0,0,0,0,1,0
点播
用ffmpeg对myvideo.ts视频文件按每个切片1s来切割,并生成index.m3u8:
ffmpeg -i myvideo.ts -c copy -map 0 -f segment -segment_list index.m3u8 -segment_time 1 test-%03d.ts
将切片生成的文件放到srs.oschina/trunk/objs/nginx/ht