crtmpserver 基本調通

來源:互聯網
上載者:User

標籤:style   blog   http   color   使用   os   io   檔案   

目的:搭建crtmpserver

   推rtmp流和播放,測試伺服器效能

 

安裝和配置的過程中,遇到幾個問題,記錄一下。

  

 

安裝crtmpserver過程:

  1 yum -y install cmake openssl openssl-devel gcc gcc-c++ make svn

  2 service iptables stop

  3 cd /usr/local/src

  4 svn co --username anonymous --password "" https://svn.rtmpd.com/crtmpserver/branches/1.0 crtmpserver

  5 cd crtmpserver/

  6 sh cleanup.sh

  7 cd builders/cmake

  8 cmake .

  9 make

  10  ./crtmpserver/crtmpserver crtmpserver/crtmpserver.lua

第10步運行之後,正常應該出現GO!GO!GO,可是卻出現Unable to reuse port的錯誤,如

確認不是連接埠和設定檔的錯誤,需要修改/usr/include/asm-generic/socket.h:#define SO_REUSEPORT  15,將SO_REUSEPORT注釋掉,cleanup,重新編譯,再運行,成功。

 

在win7的pc上,使用ffmpeg向crtmpserver伺服器推送rtmp流,ffmpeg -re -i 1.mp4 -vcodec copy -acodec copy -f flv rtmp://192.168.5.204/live/test,沒問題

換了一台centos使用ffmpeg推送流,出現警告Default implementation of ProcessInvokeGeneric: Request: _checkbw 

需要修改crtmpserver\sources\thelib\src\protocols\rtmp\basertmpappprotocolhandler.cpp:ProcessInvoke函數,增加對_checkbw的接收

重新編譯,crtmpserver就可以接收ffmpeg發過來的流資料了。

 

 

最後,用ffmpeg錄製rtmp直播流,ffmpeg -i "rtmp://192.168.5.204/live/test live=1" r.flv

 

測試效能,下一節。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.