本文章参考了。http://blog.csdn.net/lawishere/article/details/8182952,写了hi3518的配置说明。特此感谢

https://blog.csdn.net/sunxiaopengsun/article/details/79175408

1、首先到它的主页下载一个源码包:

http://www.live555.com/liveMedia/public/

我下载的是latest的,具体什么版本还真不清楚

2、放到linux目录下解压:

  1. root@kubuntu:/home/frank tar zxvf live555-latest.tar.gz
  2. root@kubuntu:/home/frank# cd live
  3. root@kubuntu:/home/frank/live#

3、首先尝试在PC的Linux上编译:

区别于传统的源码包,不是传统的配置方式,而是通过genMakefiles配对目录下的config.*文件生成Makefile

  1. root@kubuntu:/home/frank/live# ./genMakefiles linux
  2. root@kubuntu:/home/frank/live# make

编译很顺利,然后上网找一个*.264文件放在当前目录下

执行mediaServer目录下的live555MediaServer服务器原型

  1. LIVE555 Media Server
  2. version 0.75 (LIVE555 Streaming Media library version 2012.11.08).
  3. Play streams from this server using the URL
  4. rtsp://192.168.1.41:8554/<filename>
  5. where <filename> is a file present in the current directory.
  6. Each file's type is inferred from its name suffix:
  7. ".264" => a H.264 Video Elementary Stream file
  8. ".aac" => an AAC Audio (ADTS format) file
  9. ".ac3" => an AC-3 Audio file
  10. ".amr" => an AMR Audio file
  11. ".dv" => a DV Video file
  12. ".m4e" => a MPEG-4 Video Elementary Stream file
  13. ".mkv" => a Matroska audio+video+(optional)subtitles file
  14. ".mp3" => a MPEG-1 or 2 Audio file
  15. ".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file
  16. ".ts" => a MPEG Transport Stream file
  17. (a ".tsx" index file - if present - provides server 'trick play' support)
  18. ".wav" => a WAV Audio file
  19. ".webm" => a WebM audio(Vorbis)+video(VP8) file
  20. See http://www.live555.com/mediaServer/ for additional documentation.
  21. (We use port 8080 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).)

通过VLC可以点播rtsp://192.168.1.41:8554/test.264视频,

(注意:test.264所在的目录要和live555MediaServer执行目录相一致,若test.264放在live目录下,则需要在live目录下执行./mediaServer/live555MediaServer)

4、交叉编译

编译器arm-hisiv100nptl-linux-g++

同理如果通过genMakefiles生成交叉编译的Makefile,我们需要一个对应的config.*

因此我们复制一个config.hi3518,命令:cp config.armlinux config.hi3518

  1. CROSS_COMPILE?=     arm-hisiv100nptl-linux-
  2. COMPILE_OPTS =      $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
  3. C =         c
  4. C_COMPILER =        $(CROSS_COMPILE)gcc
  5. C_FLAGS =       $(COMPILE_OPTS)
  6. CPP =           cpp
  7. CPLUSPLUS_COMPILER =    $(CROSS_COMPILE)g++
  8. CPLUSPLUS_FLAGS =   $(COMPILE_OPTS) -Wall -DBSD=1 -DLOCALE_NOT_USED
  9. OBJ =           o
  10. LINK =          $(CROSS_COMPILE)g++ -o
  11. LINK_OPTS =
  12. CONSOLE_LINK_OPTS = $(LINK_OPTS)
  13. LIBRARY_LINK =      $(CROSS_COMPILE)ar cr
  14. LIBRARY_LINK_OPTS = $(LINK_OPTS)
  15. LIB_SUFFIX =            a
  16. LIBS_FOR_CONSOLE_APPLICATION =
  17. LIBS_FOR_GUI_APPLICATION =
  18. EXE =

然后与在PC上编译一样,进行编译。

  1. root@kubuntu:/home/frank/live# ./genMakefiles hi3518
  2. root@kubuntu:/home/frank/live# make clean;make

这里要记得先make clean,否则因为之前在PC上编译的目标文件没清楚会导致链接失败。

编译时会产生一个错误

  1. In file included from MPEG4GenericRTPSink.cpp:22:
  2. include/Locale.hh:47:123: xlocale.h: No such file or directory
  3. In file included from MPEG4GenericRTPSink.cpp:22:
  4. include/Locale.hh:62: error: `locale_t' does not name a type
  5. make[1]: *** [MPEG4GenericRTPSink.o] Error 1
  6. make[1]: Leaving directory `/home/frank/live/liveMedia'
  7. make: *** [all] Error 2

这个是由于海思使用的是uClinux,并没有xlocale.h这个头文件,

而live555内部的一个locale模块调用了(见liveMeida/locale.hh),因此通过编译选项把他去掉。

修改config.hi3507,在编译选项上加入-DLOCALE_NOT_USED把此模块去掉。上面那段是已经去掉的

再次生成Makefile并编译

  1. root@kubuntu:/home/frank/live# ./genMakefiles hi3518
  2. root@kubuntu:/home/frank/live# make

编译成功!

5 移植到海思开发板上

将mediaServer的live555MediaServer(你可以试一下,在linux系统中打开这个是出错误的),通过nfs挂载到开发板上执行。运行后会出现

  1. LIVE555 Media Server-Test frank
  2. version 0.84 (LIVE555 Streaming Media library version 2014.10.07).
  3. Play streams from this server using the URL
  4. rtsp://0.0.0.0/<filename>
  5. where <filename> is a file present in the current directory.
  6. Each file's type is inferred from its name suffix:
  7. ".264" => a H.264 Video Elementary Stream file
  8. ".265" => a H.265 Video Elementary Stream file
  9. ".aac" => an AAC Audio (ADTS format) file
  10. ".ac3" => an AC-3 Audio file
  11. ".amr" => an AMR Audio file
  12. ".dv" => a DV Video file
  13. ".m4e" => a MPEG-4 Video Elementary Stream file
  14. ".mkv" => a Matroska audio+video+(optional)subtitles file
  15. ".mp3" => a MPEG-1 or 2 Audio file
  16. ".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file
  17. ".ogg" or ".ogv" or ".opus" => an Ogg audio and/or video file
  18. ".ts" => a MPEG Transport Stream file
  19. (a ".tsx" index file - if present - provides server 'trick play)
  20. ".vob" => a VOB (MPEG-2 video with AC-3 audio) file
  21. ".wav" => a WAV Audio file
  22. ".webm" => a WebM audio(Vorbis)+video(VP8) file
  23. See http://www.live555.com/mediaServer/ for additional documentation.
  24. (We use port 80 for optional RTSP-over-HTTP tunneling, or for HT

测试的时候会发现RTSP的地址是0.0.0.0;

在nfs挂载的时候,已经用ifconfig eth0 192.168.0.166 将板子的IP地址设为了192.168.0.166 ,为什么还是0 呢

需要用到route add default gw 192.168.0.1,这个192.168.0.1是网关的IP地址,也就是你的路由器的IP地址,命令意思的是添加一条默认网关命令,将所有的数据包都转发到192.168.0.1;注意开发板上是运行./live555MediaServer,发现时没有端口号的,直接rtsp://192.168.0.166 就可以看到想要的结果,预祝成功。

如何在hisi编译好的live555版本基础上修改成g++编译?

将 所有工程中的CROSS_COMPILE变量设置为空即可。

live555 交叉编译移植到海思开发板的更多相关文章

  1. OpenCV开发笔记(七十四):OpenCV3.4.1+ffmpeg3.4.8交叉编译移植到海思平台Hi35xx平台

    前言   移植opencv到海思平台,opencv支持对视频进行解码,需要对应的ffmpeg支持.   Ffmpeg的移植   Ffmpeg的移植请参考之前的文章:<FFmpeg开发笔记(十): ...

  2. FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台

    FFmpeg和SDL开发专栏(点击传送门) 上一篇:<FFmpeg开发笔记(九):ffmpeg解码rtsp流并使用SDL同步播放>下一篇:敬请期待   前言   将ffmpeg移植到海思H ...

  3. 移植Mplayer到OK6410开发板

    移植Mplayer到OK6410开发板 作者:vasage 项目需要,需要将Mplayer移植到开发板上,所以今天花了一下下午成功移植,其中参考很多文档,后发现许多文档陈旧,些许文档有少量错误,所以这 ...

  4. 物联网操作系统HelloX已成功移植到MinnowBoard MAX开发板上

    在HelloX开发团队的努力下,以及Winzent Tech公司(总部在瑞典斯德哥尔摩)的支持下,HelloX最新版本V1.78已成功移植到MinnowBoard MAX开发板上.相关源代码已经发布到 ...

  5. 移植BOA服务器到开发板

    移植BOA 服务器到GEC210 开发板 开发平台主机:VMWare--Ubuntu 10.04 LTS开发板:GEC210 / linux-2.6.35.7编译器:arm-linux-gcc-4.5 ...

  6. Linux移植到自己的开发板(二)UBOOT和Linux

    @ 目录 一.uboot跳转到Linux 二. Linux内核启动之解压阶段 三. Linux内核启动之汇编阶段 插曲:关于Kconfig和Makefile 四. Linux内核启动之C语言阶段 五. ...

  7. ubuntu10.04 搭建海思开发环境

    (1)Ubuntu 10.04.4 LTS (Lucid Lynx) 下载地址:http://old-releases.ubuntu.com/releases/lucid/ (2)passwd roo ...

  8. Linux移植到自己的开发板(三)根文件系统

    @ 目录 1 Linux内核配置 2 ramdisk制作 3 busybox配置 4 genext2fs生成镜像 为了快速调试,采用ramdisk进行根文件系统测试.要使内核能挂载ramdisk根文件 ...

  9. (原创)AP6212移植到AM335X自主开发板上

    转载请指明出处. 参考<关于AM335X移植SDIO WIFI的简易教程> http://www.deyisupport.com/question_answer/dsp_arm/sitar ...

随机推荐

  1. 重建索引报错-python数据分析

    obj3 = pd.Series([']) obj3.reindex(range(), method='ffill') 此时会爆出一大堆错误. 出错原因是:之前 obj3 的索引是字符串类型,重新索引 ...

  2. R apply函数 三维 array

    参考自:https://www.cnblogs.com/nanhao/p/6674063.html 首先,生成三维数组,注意该三维矩阵为 2*3*4的维度: x=array(1:24,c(2,3,4) ...

  3. echarts之折线图配置(附带图例很多做成分页效果)

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  4. Matlab:线性热传导(抛物线方程)问题

    函数文件1:real_fun.m function f=real_fun(x0,t0) f=(x0-x0^2)*exp(-t0); 函数文件2:fun.m function f=fun(x0,t0) ...

  5. 微信小程序Promise对象

    Promise 对象 Promise 的含义 基本用法 Promise.prototype.then() Promise.prototype.catch() Promise.prototype.fin ...

  6. PythonWEB框架之Tornado

    前言 Tornado(龙卷风)和Django一样是Python中比较主流的web框架,Tornado 和现在的主流 Web 服务器框架也有着明显的区别:Tornado自带socket,并且实现了异步非 ...

  7. ILMerge合并多个DLL (转)

    最近在研究CodeDom,用到ILMerge 序言 如果你的项目要提供多个dll给别人用,那么不妨让你的dll合并为一个,让别人看起来简洁,引用起来不会过于繁琐. 本篇比较少,但也算是比较实用吧. 下 ...

  8. Mac使用Shell(终端)SSH连接远程服务器

    先进入终端 输入:ssh -p 端口号 服务器用户名@ip (例如ssh -p 22 root@119.10.168.63)回车,到这会让你输入yes或者no来确认是否连接,输入yes回车 然后输入在 ...

  9. CSS布局-body高度不等于页面高度

    记录采坑: 博客记录问题,用作回忆用,不喜勿喷! html,body{width: 100%; height: 100%}这是初始定义的宽高.在布局越写越复杂的时候,布局很容易出现问题,例如一个页面中 ...

  10. leetcode python 009

    ##懒得自己做 ##  验证回文数字int0=63435435print(int(str(int0)[::-1])==int)