hi3507/hi3515交叉编译live555
来源:互联网 发布:一淘和淘宝客同时赚取 编辑:程序博客网 时间:2024/05/18 00:17
Live555 是一个为跨平台的C++开源项目,它实现了RTP/RTCP、RTSP、SIP等的支持。并且相对于其他的流媒体服务器是完全开源并且免费的。
废话不多说,下面开始。
1、首先到它的主页下载一个源码包:
http://www.live555.com/liveMedia/public/
我下载的是latest的,具体什么版本还真不清楚
2、放到linux目录下解压:
root@kubuntu:/home/frank tar zxvf live555-latest.tar.gzroot@kubuntu:/home/frank# cd liveroot@kubuntu:/home/frank/live#
3、首先尝试在PC的Linux上编译:
区别于传统的源码包,不是传统的配置方式,而是通过genMakefiles配对目录下的config.*文件生成Makefile
root@kubuntu:/home/frank/live# ./genMakefiles linuxroot@kubuntu:/home/frank/live# make
编译很顺利,然后上网找一个*.264文件(常见的就是那个test.264在新闻报道)放在当前目录下
执行mediaServer目录下的live555MediaServer服务器原型
root@kubuntu:/home/frank/live# ./mediaServer/live555MediaServerLIVE555 Media Server version 0.75 (LIVE555 Streaming Media library version 2012.11.08).Play streams from this server using the URL rtsp://192.168.1.41:8554/<filename>where <filename> is a file present in the current directory.Each file's type is inferred from its name suffix: ".264" => a H.264 Video Elementary Stream file ".aac" => an AAC Audio (ADTS format) file ".ac3" => an AC-3 Audio file ".amr" => an AMR Audio file ".dv" => a DV Video file ".m4e" => a MPEG-4 Video Elementary Stream file ".mkv" => a Matroska audio+video+(optional)subtitles file ".mp3" => a MPEG-1 or 2 Audio file ".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file ".ts" => a MPEG Transport Stream file (a ".tsx" index file - if present - provides server 'trick play' support) ".wav" => a WAV Audio file ".webm" => a WebM audio(Vorbis)+video(VP8) fileSee http://www.live555.com/mediaServer/ for additional documentation.(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-hismall-linux-gcc/arm-hismall-linux-g++
同理如果通过genMakefiles生成交叉编译的Makefile,我们需要一个对应的config.*
因此我们创建一个config.hi3507,内容可以参考config.armlinux
root@kubuntu:/home/frank/live# cat config.hi3507CROSS_COMPILE?= arm-hismall-linux-COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64C = cC_COMPILER = $(CROSS_COMPILE)gccC_FLAGS = $(COMPILE_OPTS)CPP = cppCPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1OBJ = oLINK = $(CROSS_COMPILE)g++ -oLINK_OPTS =CONSOLE_LINK_OPTS = $(LINK_OPTS)LIBRARY_LINK = $(CROSS_COMPILE)ar crLIBRARY_LINK_OPTS = $(LINK_OPTS)LIB_SUFFIX = aLIBS_FOR_CONSOLE_APPLICATION =LIBS_FOR_GUI_APPLICATION =EXE =
然后与在PC上编译一样,进行编译。
root@kubuntu:/home/frank/live# ./genMakefiles hi3507root@kubuntu:/home/frank/live# make clean;make
这里要记得先make clean,否则因为之前在PC上编译的目标文件没清楚会导致链接失败。
编译时会产生一个错误
In file included from MPEG4GenericRTPSink.cpp:22:include/Locale.hh:47:123: xlocale.h: No such file or directoryIn file included from MPEG4GenericRTPSink.cpp:22:include/Locale.hh:62: error: `locale_t' does not name a typemake[1]: *** [MPEG4GenericRTPSink.o] Error 1make[1]: Leaving directory `/home/frank/live/liveMedia'make: *** [all] Error 2
这个是由于海思使用的是uClinux,并没有xlocale.h这个头文件,
而live555内部的一个locale模块调用了(见liveMeida/locale.hh),因此通过编译选项把他去掉。
修改config.hi3507,在编译选项上加入-DLOCALE_NOT_USED把此模块去掉。
CROSS_COMPILE?= arm-hismall-linux-COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64C = cC_COMPILER = $(CROSS_COMPILE)gccC_FLAGS = $(COMPILE_OPTS)CPP = cppCPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 -DLOCALE_NOT_USEDOBJ = oLINK = $(CROSS_COMPILE)g++ -oLINK_OPTS =CONSOLE_LINK_OPTS = $(LINK_OPTS)LIBRARY_LINK = $(CROSS_COMPILE)ar crLIBRARY_LINK_OPTS = $(LINK_OPTS)LIB_SUFFIX = aLIBS_FOR_CONSOLE_APPLICATION =LIBS_FOR_GUI_APPLICATION =EXE =
再次生成Makefile并编译
root@kubuntu:/home/frank/live# ./genMakefiles hi3507root@kubuntu:/home/frank/live# make
编译成功!
再按照上述方法把程序放到hi3507上运行测试
源码下载
- hi3507/hi3515交叉编译live555
- hi3507/hi3515交叉编译live555
- hi3507/hi3515交叉编译live555
- hi3507/hi3515交叉编译live555
- hi3507/hi3515交叉编译live555
- hi3507/hi3515基于live555实现实时流rtsp服务器
- live555的交叉编译
- live555交叉编译
- LIVE555 交叉编译
- ubuntu11.10+交叉编译hi3515+minigui
- Linux编译/交叉编译 live555
- ffmpeg,live555,mplayer交叉编译
- Live555实战之交叉编译live555共享库
- 交叉编译 LIVE555 Streaming Media 的方法
- live555在armlinux下的交叉编译
- live555 交叉编译移植到海思开发板
- LIVE555再学习 -- DM368/Hi3516A 交叉编译
- HI3515上Jrtplib编译
- 上传文件类型对应表
- 06mkfile-01tst
- Discuz论坛推广的十个方向总结
- javascript学习2——javascript常见问题
- C#控制音量
- hi3507/hi3515交叉编译live555
- getopt函数和getopt_long函数 解析命令行
- 面试考点:i++和++i的区别
- Android 程序优化
- 06mkfile-02singledir
- kvm的快照功能 (二、基于libvirt的快照)
- 为什么开展移动电子商务?mCommerce in a box 是什么?
- 黑马程序员_枚举
- Cocos2d-x利用CCSpriteBatchNode提高渲染效率