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

时间:2023-03-10 03:55:33
流媒体技术学习笔记之(十二)Linux(Ubuntu)环境运行EasyDarwin

Debug问题???

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

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

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

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

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

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

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

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

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


一、安装环境监测

查看 Ubuntu 的版本号:

sudo lsb_release -a

gcc 版本查看:

gcc -v

ubuntu14.04 自带的是4.8版本,而最新的4.9.2对c++11的支持更好一些。可惜直接sudo apt-get install gcc-4.9不好用,所以可以这样安装更新:

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

二、编译、安装

下载

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

解压

安装unzip

apt install unzip

解压

unzip v7.0.5.zip

编译

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

编译错误处理!!!

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

原因:由于gcc 版本太低,建议升级为4.9以上,经过测试5.3版本的库是最新的,但是兼容不了,所以推荐版本在大于4.9小于5.3版本。

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

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

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

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

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

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

浏览器输入:

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

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

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

整理文件

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

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

重命名x64为EasyDarwin

mv x64 EasyDarwin

流媒体技术学习笔记之(十二)Linux(Ubuntu)环境运行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. | grep GLIBCXX

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

三、开启服务:

Ø  .修改配置文件

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

Ø  Linux调试运行

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

否则提示错误:WARNING: You must be root to use the following RTSP port: 

./easydarwin -c ../WinNTSupport/easydarwin.xml -d

进程查看:

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

可以看到会有连个进程启动,没有报错。

Ø  Linux后台服务方式运行

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

四、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服务器地址。
  • 推流结果:

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

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

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

  • Debug命令行输出信息

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

测试结果:

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

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

开始推流: