1、下载最新srs源码
https://github.com/ossrs/srs/releases
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
运行如下