Firefly1126中srs-librtmp推流库配置
Firefly1126中srs-librtmp推流库配置
下载
https://gitee.com/winlinvip/srs.oschina.git
切换分支
git checkout -b 3.0release origin/3.0release
kxq@ubuntu:~/Desktop/srs.oschina/trunk$ git checkout -b 2.0release origin/2.0release
Branch 2.0release set up to track remote branch 2.0release from origin.
Switched to a new branch '2.0release'
检查分支命令
git branch -vv
出现上述显示则切换成功
修改/trunk/auto/options.sh;改为
SRS_TOOL_CC=arm-linux-gnueabihf-gcc
SRS_TOOL_CXX=arm-linux-gnueabihf-g++
SRS_TOOL_AR=arm-linux-gnueabihf-ar
SRS_TOOL_LD=arm-linux-gnueabihf-ld
SRS_TOOL_RANDLIB=arm-linux-gnueabihf-randlib
之后修改/trunk/research/librtmp/Makefile
1)GCC= arm-linux-gnueabihf-gcc //换成DM8168交叉编译链
2) # for arm.
ifeq ($(GCC), arm-linux-gnueabihf-gcc)
然后执行以下命令编译
./configure --with-librtmp --arm && make
测试程序文件夹位置
/home/kxq/Desktop/srs.oschina/trunk/objs/research/librtmp
使用的静态库文件夹位置
/home/kxq/Desktop/srs.oschina/trunk/objs/lib
/home/kxq/Desktop/srs.oschina/trunk/objs/openssl/lib
#以下为部分编译时打印信息
arm-linux-gnueabihf-gcc srs_publish.c ../../objs/lib/srs_librtmp.a ../../objs/openssl/lib/libssl.a ../../objs/openssl/lib/libcrypto.a -g -O0 -ldl -static -lstdc++ -lm -o objs/srs_publish
/home/kxq/Desktop/rv1126_rv1109_linux_release_20210306/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../objs/openssl/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x10): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
测试程序使用,执行以下语句向服务器推流
./srs_h264_raw_publish ./cuc_ieschool.h264 rtmp://公网rtmp服务器ip:端口/live/livestream 25
拉流
vlc rtmp://公网rtmp服务器ip:端口/live/livestream