欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-07-14 20:24:32
...

Author: CaoHu
E-Mail: aaa@qq.com Version:0.1 Date: 2018-01-29 10:28
Description: My level is limited, if there are some weaknesses, welcome criticism. If the content of the blog is involved in infringement, please contact my mailbox, it will be deleted immediately, welcome to exchange, learn from each other!


上一篇文章简单叙述了一下流媒体直播的整体方案和所用到的工具,接下来的文章将是根据具体的每个部分的实际代码实现了。。。闲话少说,首先我们从各种库的交叉编译开始,这里我们首先介绍搭建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目录,

“`
aaa@qq.com /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
aaa@qq.com /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。。 流媒体直播之二imx6 arm板的live555的交叉编译这里测试影响不大,可以直接在vlc播
流媒体直播之二imx6 arm板的live555的交叉编译器中打开网络串流来播放视频。接下来就可以欣赏流媒体播放的视频了。