流媒体技术学习笔记之(十二)Linux(Ubuntu)环境运行EasyDarwin

 Debug问题???html

./easydarwin -c ./easydarwin.xml &  //这样的话是80端口

./easydarwin -c ./easydarwin.xml -d  //8088端口

 

以上出现的问题:在调试模式下加载配置文件是能够的,可是在后台模式下配置文件是加载不了的,列如:在配置文件配置后台管理端口为8088,当时在后台模式下,倒是80端口,同时点播文件夹路径和日志文件夹路径也加载的不适linux

解决办法:在后台运行的时候配置文件必须是绝对路径哦!不是相对路径

root@iZ2363u41cdZ:/home/Tinywan/EasyDarwin# ./easydarwin -c /home/Tinywan/EasyDarwin/easydarwin.xml &

再次由调试模式切换成后台模式的时候,加载配置文件正确c++

 


 

1、安装环境监测

查看 Ubuntu 的版本号:git

sudo lsb_release -a

gcc 版本查看:github

gcc -v

ubuntu14.04 自带的是4.8版本,而最新的4.9.2对c++11的支持更好一些。惋惜直接sudo apt-get install gcc-4.9很差用,因此能够这样安装更新:ubuntu

sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.9 sudo apt-get install g++-4.9

装了ppa,各类版本就能够共存了。不过有一个问题,每次要用的时候,必须使用g++-4.9,若是直接用g++会运行4.8版本的,很是麻烦。因此须要改一下/usr/bin/下的连接:浏览器

sudo su cd ../../usr/bin ln -s /usr/bin/g++-4.9 /usr/bin/g++ -f ln -s /usr/bin/gcc-4.9 /usr/bin/gcc -f

2、编译、安装

下载

wget https://github.com/EasyDarwin/EasyDarwin/archive/v7.0.5.zip

 解压

安装unzip

apt install unzip

 解压服务器

unzip v7.0.5.zip

编译

cd EasyDarwin-7.0.5/EasyDarwin/ ls chmod +x ./Buildit ./Buildit   (这里会出现8六、64、debug三个版本) ./Buildit x64 (选择64位进行编译)

 编译错误处理!!!

/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

缘由:因为gcc 版本过低,建议升级为4.9以上,通过测试5.3版本的库是最新的,可是兼容不了,因此推荐版本在大于4.9小于5.3版本。tcp

./easydarwin: relocation error: ./easydarwin: symbol _ZTVNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

编译完成后,出现可执行文件在X64文件夹下面

root@iZ2363u41cdZ:/home/Tinywan/EasyDarwin-7.0.5/EasyDarwin/x64# ls easydarwin

复制html文件夹到当前文件夹(x64)下面测试

cp ../WinNTSupport/html/ ./ -r
cp ../WinNTSupport/Movies/ ./ -r

浏览器输入:

http://外网IP地址:8088/

出现以上界面表示配置成功!

整理文件

复制x64文件内容到指定文件夹,我这里是我本身的文件Tinywan 下面

cp EasyDarwin-7.0.5/EasyDarwin/x64/ ./ -r
root@iZ2363u41cdZ:/home/Tinywan# ls EasyDarwin-7.0.5  EasyDarwin-7.0.5.zip  x64

重命名x64为EasyDarwin

mv x64 EasyDarwin

测试运行:

root@iZ2363u41cdZ:/home/Tinywan/EasyDarwin# ./easydarwin -c ./easydarwin.xml -d WARNING: No module folder exists. INFO: Loading Module...QTSSFileModule [static] INFO: Loading Module...QTSSReflectorModule [static] INFO: Loading Module...EasyRelayModule [static] **********************EasyPusher SDK**********************
 /* Platform: Linux */
 /* Process Name[10]: easydarwin */
 /* Coding Time: 2016-03-21 16:00:00 */
 /* Start Time: 2016-03-25 08:00:00 */
 /* Validity Time Left: 00000046 day(s) */
**********************************************************


******************EasyRTSPClient SDK**********************
 /* Platform: Linux */
 /* Process Name[10]: easydarwin */
 /* Coding Time: 2016-04-12 10:00:00 */
 /* Start Time: 2016-05-04 08:00:00 */
 /* Validity Time Left: 00000086 day(s) */
********************************************************** INFO: Loading Module...EasyHLSModule [static] **********************EasyHLS SDK*************************
 /* Platform: Linux */
 /* Process Name[10]: easydarwin */
 /* Coding Time: 2016-03-21 16:00:00 */
 /* Start Time: 2016-03-28 08:00:00 */
 /* Validity Time Left: 00000049 day(s) */
********************************************************** INFO: Loading Module...QTSSAccessLogModule [static] INFO: Loading Module...QTSSFlowControlModule [static] INFO: Loading Module...QTSSPosixFileSysModule [static] INFO: Loading Module...QTSSAdminModule [static] INFO: Loading Module...QTSSAccessModule [static] Streaming Server done starting up

已经成功开启运行

Ø  查看C++已经安装的库文件

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

 

3、开启服务:

Ø  .修改配置文件

local_ip_address : 该地址为服务器公网IP地址

Ø  Linux调试运行

!!!注意:必须以Root用户启动:

不然提示错误:WARNING: You must be root to use the following RTSP port: 554 ./easydarwin -c ../WinNTSupport/easydarwin.xml -d

进程查看:

ps -aux | grep easydarwin (这里要小写的)

 

能够看到会有连个进程启动,没有报错。

Ø  Linux后台服务方式运行

./easydarwin -c /etc/streaming/easydarwin.xml &

4、FFMpeg推送摄像机视频到EasyDarwin

rtmp://zonepush4rtsp.amailive.com/realstream/4001

说明:FFmpeg推送,EasyDarwin转发,vlc播放,实现整个RTSP直播

  • 测试RSTP推流地址:
ffmpeg  -rtsp_transport tcp -i "rtsp://192.168.18.240:554/onvif/live/1" -vcodec copy -acodec copy -f rtsp "rtsp://服务器IP地址/test.sdp"
  • 参数说明:
-rtsp_transport tcp 以TCP方式推流 rtsp://192.168.18.240:554/onvif/live/1 本地摄像头地址
 rtsp://服务器IP地址/test.sdp EasyDarwin服务器地址。
  • 推流结果:

   

  • VLC播放地址:
rtsp://服务器IP地址/test.sdp,
  • 测试结果:

   

  • Debug命令行输出信息

   

测试结果:

服务器启动的时候会自动生成一下连个文件夹(服务器已经启动的话,删除掉则不会从新生成!!)

开始推流:

相关文章
相关标签/搜索