Ubuntuでcrtmpserverをビルドして見る

crtmpserverからinboundRtmfpがなくなった件を解決したいと思い、先ずは現時点のcrtmpserverがビルド可能かを確認した。

【ビルド環境】

【パッケージインストール

ビルドに必要なパッケージをLinuxとフリーソフトでライブ動画配信サーバーを構築する - idinorの日記の「2. 必須パッケージのインストール」を参考にapt-get installでインストールした(と言うか、インストールされていた)。
( [ ] 内にインストールしたときのバージョンを記した。)

  • openssl [1.0.1f-1ubuntu2.21]
  • gcc [4:4.8.2-1ubuntu6]
  • g++ [4:4.8.2-1ubuntu6]
  • cmake [2.8.12.2-0ubuntu3]

ソースコードダウンロード】

GitHub - shiretu/crtmpserverの右側「Clone or download」ボタンをクリックし、「Download ZIP」をクリックして最新のソースコードをダウンロードした。
現時点の最終コミットは-- removed some old cleanup files · shiretu/crtmpserver@b866fff · GitHubである。

【ビルド実行】

ダウンロードしたZIPファイルの中身を便宜上 ~/github/crtmpserver に展開し、以下のコマンドでビルドを実行した。

$ cd ~/github/crtmpserver/builders/cmake
$ sudo ./run

【ビルド結果】

問題なくビルドが完了し、crtmpserverが起動されて、以下のログが画面に出力された。

/crtmpserver/src/crtmpserver.cpp:217 C++ RTMP Media Server (www.rtmpd.com) version 1.1_rc1 build Unversioned directory - Gladiator - (built on 2017-01-15T05:54:15.000)
/crtmpserver/src/crtmpserver.cpp:220 OS files descriptors count limits: 4096/4096
/crtmpserver/src/crtmpserver.cpp:222 Initialize I/O handlers manager: epoll without timerfd_XXXX support
/crtmpserver/src/crtmpserver.cpp:225 Configure modules
/crtmpserver/src/crtmpserver.cpp:231 Plug in the default protocol factory
/crtmpserver/src/crtmpserver.cpp:238 Configure factories
/thelib/src/configuration/module.cpp:97 Loaded factory from application samplefactory
/crtmpserver/src/crtmpserver.cpp:244 Configure acceptors
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 0->1 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 1->2 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 2->3 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 3->4 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 4->5 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 5->6 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 6->7 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 7->8 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 8->9 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 9->10 IOHT_ACCEPTOR
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 10->11 IOHT_ACCEPTOR
/crtmpserver/src/crtmpserver.cpp:250 Configure instances
/crtmpserver/src/crtmpserver.cpp:256 Start I/O handlers manager: epoll without timerfd_XXXX support
/crtmpserver/src/crtmpserver.cpp:259 Configure applications
/thelib/src/configuration/module.cpp:177 Application admin instantiated
/thelib/src/configuration/module.cpp:177 Application appselector instantiated
/thelib/src/configuration/module.cpp:177 Application flvplayback instantiated
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:143 mediaFolder not found: /Volumes/Storage/media/mp3
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:119 Storage failed to initialize storage 0x00000001
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:143 mediaFolder not found: /Volumes/Storage/media/
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:119 Storage failed to initialize storage namedStorage1
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:143 mediaFolder not found: /Volumes/Storage/media/mp4
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:119 Storage failed to initialize storage namedStorage2
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:143 mediaFolder not found: /Volumes/Storage/media/flv
/thelib/src/mediaformats/readers/streammetadataresolver.cpp:119 Storage failed to initialize storage namedStorage3
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 11->12 IOHT_TIMER
/thelib/src/configuration/module.cpp:177 Application proxypublish instantiated
/thelib/src/netio/epoll/iohandlermanager.cpp:120 Handlers count changed: 12->13 IOHT_TIMER
/thelib/src/configuration/module.cpp:177 Application samplefactory instantiated
/thelib/src/configuration/module.cpp:177 Application stresstest instantiated
/thelib/src/configuration/module.cpp:177 Application vptests instantiated
/crtmpserver/src/crtmpserver.cpp:265 Install the quit signal
/crtmpserver/src/crtmpserver.cpp:276 
+-----------------------------------------------------------------------------+
|                                                                     Services|
+---+---------------+-----+-------------------------+-------------------------+
| c |      ip       | port|   protocol stack name   |     application name    |
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 1112|           inboundJsonCli|                    admin|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 1935|              inboundRtmp|              appselector|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 8081|             inboundRtmps|              appselector|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 8080|             inboundRtmpt|              appselector|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 6666|           inboundLiveFlv|              flvplayback|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 9999|             inboundTcpTs|              flvplayback|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 5544|              inboundRtsp|              flvplayback|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 6665|           inboundLiveFlv|             proxypublish|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 8989|         httpEchoProtocol|            samplefactory|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 8988|             echoProtocol|            samplefactory|
+---+---------------+-----+-------------------------+-------------------------+
|tcp|        0.0.0.0| 1111|    inboundHttpXmlVariant|                  vptests|
+---+---------------+-----+-------------------------+-------------------------+
/crtmpserver/src/crtmpserver.cpp:277 GO! GO! GO! (3228)

【配信テスト】

前述のログに「mediaFolder not found: /Volumes/Storage/media/」などのエラーが出力されているので、 ./crtmpserver/crtmpserver.lua を適切に変更してから再度crtmpserverを実行し、Ubuntuでcrtmpserverを試す(その2)と同様にFlowPlayerでメディアを再生して、特に問題がないことを確認した。

CentOS 7の場合】2017/02/18追記

CentOS 7でビルドする場合にyum Installでインストールする必要があるのは以下のパッケージである。

  • openssl-devel
  • gcc
  • cmake