1、下载最新srs源码
https://github.com/ossrs/srs/releases
详细文档在这里
https://github.com/ossrs/srs/wiki/v2_CN_SrsLibrtmp#publish-h264-raw-data
2、编译(进入~/srs-2.0-r4/trunk目录)
./configure --with-librtmp --without-ssl
make
3、启动srs
./objs/srs -c conf/srs.conf
tailf ./objs/srs.log
4、编译srs_h264_raw_publish.c(进入~/srs-2.0-r4/trunk/research/librtmp目录)
gcc srs_h264_raw_publish.c ../../objs/lib/srs_librtmp.a -g -O0 -lstdc++ -o srs_h264_raw_publish
5、向srs推流
./srs_h264_raw_publish ./720p.h264.raw rtmp://127.0.0.1:1935/live/livestream 25
6、播放rtmp流
ffplay rtmp://127.0.0.1:1935/live/livestream
运行如下
7、rtmp/http-flv/hls/dash
srs实现http flv跨域播放
#cd srs/trunk
#vi src/app/srs_app_http_stream.cpp
w->header()->set_content_type("video/x-flv");
w->header()->set("Access-Control-Allow-Origin","*");
https://www.cnblogs.com/yjmyzz/p/srs_study_2_hls_rtmp_httpflv_and_cross-domain.html
./configure --with-librtmp --without-ssl --without-ffmpeg
make && make install
./objs/srs -c conf/http.flv.live.conf
ffplay http://127.0.0.1:8080/live/livestream.flv
8、srs-librtmp pusher(push h264 raw)
https://www.cnblogs.com/dong1/p/10600115.html
9. nginx反向代理srs解决http跨域和浏览器6路连接限制问题
https://www.cnblogs.com/yjmyzz/p/srs_study_2_hls_rtmp_httpflv_and_cross-domain.html
https://blog.csdn.net/CJY8023/article/details/106716378
end