流媒体直播之二imx6 arm板的live555的交叉编译

来源:互联网 发布:如何查看淘宝商品排名 编辑:程序博客网 时间:2024/06/05 14:52

上一篇文章简单叙述了一下流媒体直播的整体方案和所用到的工具,接下来的文章将是根据具体的每个部分的实际代码实现了。。。闲话少说,首先我们从各种库的交叉编译开始,这里我们首先介绍搭建RTSP服务器的开源库live555的arm板交叉编译。
首先,我们需要到live555的官网去下载他的源码包,我下载的是最新版,网址如下:
http://www.live555.com/liveMedia/public/
接下来,我们需要将下载的源码包复制到虚拟机中(linux系统中),可以自己创建自己的目录,这里我是放在自己的/home/用户名/share/rtsp_live目录下,具体操作命令如下:

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

解压完我们的源码包,接下来需要配置我们的makefile,刚开始我使用的 cp config.armlinux config.imx6,但是ubuntu给我报了个错误,找不到config.config.imx6 file or directory之前在ubuntu12.04没有出现这种错误,接下来我使用cp config.armlinux imx6,接着sudo vim imx6进入配置文件,将其编译器修改为我们自己使用的编译器,然后./genMakefiles imx6,成功没有报错,接着make clean, make。接下来我们进入mediaServer目录准备测试一下自己的交叉编译是否成功。因为源码库没有提供h.264文件,这里提供一个h.264文件的下载链接。将其复制到mensiaserver目录下即可。
http://download.csdn.net/download/hnu__kaifaxiaozi/10021003
完成以上步骤后,我们就可以通过NFS挂载来测试自己的库是否编译成功,在板子上进入mediaServer目录,

“`
root@ltt /mnt/rtsp_live/livecdmediaServer/root@ltt/mnt/rtsplive/live/mediaServer ls
COPYING Makefile live555MediaServer.o
COPYING.LESSER Makefile.head test.264
DynamicRTSPServer.cpp Makefile.tail version.hh
DynamicRTSPServer.hh live555MediaServer
DynamicRTSPServer.o live555MediaServer.cpp
root@ltt /mnt/rtsp_live/live/mediaServer$ ./live555MediaServer
LIVE555 Media Server
version 0.91 (LIVE555 Streaming Media library version 2017.09.12).
Play streams from this server using the URL
rtsp://0.0.0.0/
where 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
“.265” => a H.265 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
“.ogg” or “.ogv” or “.opus” => an Ogg audio and/or video file
“.ts” => a MPEG Transport Stream file
(a “.tsx” index file - if present - provides server ‘trick play’ support)
“.vob” => a VOB (MPEG-2 video with AC-3 audio) file
“.wav” => a WAV Audio file
“.webm” => a WebM audio(Vorbis)+video(VP8) file
See http://www.live555.com/mediaServer/ for additional documentation.
(We use port 8000 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream f我==/dissolve/70/gravity/SouthEast。。 这里写图片描述这里测试影响不大,可以直接在vlc播
这里写图片描述器中打开网络串流来播放视频。接下来就可以欣赏流媒体播放的视频了。

原创粉丝点击