流媒體技術學習筆記之(十二)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命令行輸出信息

   

測試結果:

服務器啓動的時候會自動生成一下連個文件夾(服務器已經啓動的話,刪除掉則不會從新生成!!)

開始推流:

相關文章
相關標籤/搜索