./configure --with-arm-ubuntu12&&make
需要安裝:
apt-get installgcc-arm-linux-gnueabi ,但hi3516C是用的arm-hisiv100-nptl-gcc,
需要替換gcc-arm-linux-gnueabi為arm-hisiv100-nptl-gcc
auto# gedit setup_variables.sh,
# when arm specified, setup the cross buildvariables.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
__SrsArmCC="arm-hisiv100nptl-linux-gcc";
__SrsArmGCC="arm-hisiv100nptl-linux-gcc";
__SrsArmCXX="arm-hisiv100nptl-linux-g++";
__SrsArmAR="arm-hisiv100nptl-linux-ar";
__SrsArmLD="arm-hisiv100nptl-linux-ld";
__SrsArmRANDLIB="arm-hisiv100nptl-linux-ranlib";
Fi
但編譯build openssl-1.0.1f碰到問題,直接修改Makefile進行單獨交叉編譯就行。
Make&&makeinstall。
編譯時出現鏈接問題:
/home/ossrs/srs-hisi/trunk/src/protocol/srs_rtmp_utility.cpp:85:undefined reference to `std::basic_string, std::allocator >::~basic_string()'
/home/ossrs/srs-hisi/trunk/src/protocol/srs_raw_avc.cpp:538:undefined reference to `operator new[](unsigned int)'
dso_dlfcn.c:(.text+0x1c):undefined reference to `dlopen'
感覺應該是編譯工具、鏈接庫出了問題,可能是不兼容。
CPU: ARM926EJ-S[41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT datacache, VIVT instruction cache
Machine: hi3518
按下面的辦法修改一下librtmp下面的Makefile中的gcc定義就可以。
Vi research/librtmp/Makefile
GCC= arm-hisiv100nptl-linux-gcc
# for arm.
ifeq ($(GCC),arm-hisiv100nptl-linux-gcc)
EXTRA_CXX_FLAG = -g -O0 -ldl -static-lstdc++
Endif
編譯生成
ls objs/srs -l
-rwxr-xr-x 1 rootroot 11307924 2016-01-20 22:59 objs/srs
大小居然有11M之多,明顯沒有strip。Strip后有3.6MB,勉強可以接受。
注意:
在x86上面編譯,如果-without-ssl的話,可以發布rtmp url成功,但連上去沒有流。所以,--with-http-callback –with-ssl必須包括在里面。
安裝實施:
# ./srs -cconf/srs.conf
[2016-01-0101:24:43.839][trace][754][0] config parse complete
[2016-01-0101:24:43.904][trace][754][0] write log to file ./objs/srs.log
[2016-01-0101:24:43.904][trace][754][0] you can: tailf ./objs/srs.log
[2016-01-0101:24:43.905][trace][754][0] @see:https://github.com/ossrs/srs/wiki/v1_CN_SrsLog
#
# ../RtxpServer&
# ../RtxpServerbuild time=20160120-2125, log is /tmp/tcpsvr.log.
http://winlinvip.github.io/srs.release/trunk/research/players/srs_player.html?server=192.168.3.1&app=live&stream=0&port=1935
播放rtmp://192.168.3.1:1935/live/0
一切正常!可以看到流,聽到聲音。
交流請加QQ群: 194257702。