srs2.0测试hls
来源:互联网 发布:mac看不到备份文件 编辑:程序博客网 时间:2024/06/07 22:29
一:下载
先下载源码,地址:https://github.com/ossrs/srs/tree/2.0release
二:不转码点播
1 编译
./configure --disable-all --with-ssl --with-hls --with-nginx && make
2 配置
vhost __defaultVhost__ {
hls {
enabled off; # 是否开启hls,不转码切hls。
hls_fragment 2; # 指定ts切片的最小长度,单位秒
hls_window 10; # 指定HLS窗口大小,即m3u8中ts文件的时长之和;单位秒
hls_path /data/channellist; # 直播推流存放住目录
hls_m3u8_file channel[stream]/700.m3u8; # m3u8索引文件存放路径;码率可以设置,但ts和m3u8的名称必须保持一致,
hls_ts_file channel[stream]/700/[year][month][day]/[2006][01][02][T][15][04][05].ts; # 直播ts文件存放路径
}
transcode {
enabled on;
ffmpeg /usr/local/ffmpeg/bin/ffmpeg;
engine ff1 {
enabled on;
vcodec libx264;
vparams {
r 25;
g 25;
keyint_min 25;
sc_threshold 0;
}
acodec copy;
oformat hls;
output /usr/local/nginxtmp/html/otv/[stream].m3u8;
#强制转码hls
# output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]1;
}
engine ff {
enabled on;
vcodec libx264;
vparams {
r 25;
g 25;
keyint_min 25;
sc_threshold 0;
}
acodec copy;
#oformat hls;
# output /usr/local/nginxtmp/html/otv/[stream].m3u8;
#强制转码rtmp
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]1;
}
}
}
./objs/srs -c conf/hls.conf
4 推流
for((;;)); do \
./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \
-vcodec copy -acodec copy \
-f flv -y rtmp://192.168.1.170/live/livestream; \
sleep 1; \
done
或第三方软件推流,如obs。
或ffmpeg -re -i cw_1h.ts -vcodec copy -acodec aac -bsf:a aac_adtstoasc -f flv -y rtmp://10.80.3.17:1935/APP/19
生成的流地址为:
RTMP流地址为:rtmp://192.168.1.170/app/通道
HLS流地址为: http://192.168.1.170/app/xx.m3u8(需要配置nginx)
三:转码点播
1 编译
./configure --with-nginx --with-ffmpeg --with-transcode && make
编译后的特性为:
features: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --without-nginx --with-ssl --with-ffmpeg --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --without-stream-caster --with-http-api --
with-librtmp --without-research --with-utest --without-gperf --without-gmc --without-gmp --without-gcp --without-gprof --without-arm-ubuntu12 --without-mips-ubuntu12 --log-trace
2 启动
./objs/srs -c conf/transcode2hls.audio.only.conf
3 推流
for((;;)); do \
./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \
-vcodec copy -acodec copy \
-f flv -y rtmp://192.168.1.170/live/livestream; \
sleep 1; \
done
或第三方软件推流,如obs。
4 点播
RTMP流地址为(FMLE推流无HLS地址):rtmp://192.168.1.170/live/livestream
转码后的RTMP流地址为:rtmp://192.168.1.170/live/livestream_ff
转码后的HLS流地址为: http://192.168.1.170/live/livestream_ff.m3u8
- srs2.0测试hls
- ubuntu15.0 编译SRS2.0
- HLS 测试流
- 开发HLS测试地址M3U8
- HLS 测试用流地址
- HLS流媒体直播搭建测试
- 搭建HLS直播测试环境
- HLS自适应测试环境搭建
- HLS
- HLS
- hls
- HLS
- HLS
- HLS
- HTTP/HLS/RTMP超级负载测试工具
- HTTP/HLS/RTMP超级负载测试工具
- HTTP/HLS/RTMP超级负载测试工具
- HTTP/HLS/RTMP超级负载测试工具
- Echart报错: Map china not exists. You can download map file on
- Java多线程方面的编程笔试题(通过实现Runnable接口启动线程)
- Redirecting to /bin/systemctl restart sshd.service
- 数据结构框架图
- 【模拟】洛谷 P1001 A+B Problem
- srs2.0测试hls
- 线性回归与逻辑回归的损失函数选择
- centos7配置lamp成功安装过
- vmware workstation 12.5 pro
- c++ 时间类型详解(time_t和tm)
- eclipse下项目的包展示样式
- csv文件操作
- 进入C++ --- main() 函数
- Java虚拟机学习笔记(一)