1. 程式人生 > 其它 >Firefly1126中srs-librtmp推流庫配置

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