AirVideoサーバーの設定

AirVideoサーバーとは

サーバーに保存された動画をiPhoneやiPad用に変換しながらストリーミング配信するサーバ。

インストール

2014/07/15 現在の最新版は、AirVideoServerLinux Alpha 6。

$ wget http://s3.amazonaws.com/AirVideo/Linux-2.4.6-beta3/AirVideoServerLinux.jar
$ wget http://inmethod.com/airvideo/download/ffmpeg-for-2.4.5-beta7.tar.bz2

$ sudo apt-get install openjdk-7-jre pkg-config yasm libfaac-dev libmp3lame-dev libx264-dev

$ sudo mkdir /opt/airvideo-server
$ sudo mv AirVideoServerLinux.jar /opt/airvideo-server/

$ bzip2 -dc ffmpeg-for-2.4.5-beta7.tar.bz2 | tar xvf -
$ cd ffmpeg/
$ ./configure --enable-pthreads --disable-shared --enable-static --enable-gpl --enable-libx264 --enable-libmp3lame --enable-libfaac --disable-decoder=aac --enable-nonfree --prefix=/opt/airvideo-server
$ make
$ sudo make install

ファイヤーウォールの設定

ファイヤーウォールを設定している場合は、以下のコマンドでポートを開けます。

$ sudo ufw allow 45631
$ sudo ufw status

To                         Action      From
--                         ------      ----
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
22                         ALLOW       Anywhere
139                        ALLOW       Anywhere
445                        ALLOW       Anywhere
21                         ALLOW       Anywhere
989                        ALLOW       Anywhere
990                        ALLOW       Anywhere
45631                      ALLOW       Anywhere

設定とテスト

設定ファイルを作成します。

$ sudo vi /opt/airvideo-server/my.properties

パスワード(password)と、動画のフォルダ(folders)を自分の環境に合わせ修正。
動画のフォルダは、フォルダ名1:パス1,フォルダ名2:パス2…とカンマ区切りで指定可能。

path.ffmpeg = /opt/airvideo-server/bin/ffmpeg
path.mp4creator = /usr/bin/mp4creator
path.faac = /usr/bin/faac
password = xxxxx
subtitles.encoding = windows-1250
subtitles.font = Verdana
folders = PV:/var/samba/public/movie/PV,MOVIE:/var/samba/public/movie/MOVIE

テスト起動を行い、iPhoneやiPadから繋がることを確認してください。

$ cd /opt/airvideo-server
$ java -jar AirVideoServerLinux.jar my.properties

バックグラウンドでの動作

$ sudo vi /etc/init/airvideo.conf

hogehogの部分はユーザ名。

start on runlevel [2345]
stop on shutdown
respawn

exec sudo -H -n -u hogehoge env LANG=ja_JP.UTF-8 \
`which java` -jar /opt/airvideo-server/AirVideoServerLinux.jar \
/opt/airvideo-server/my.properties
上記ファイルを作り、以下のコマンドで起動します。
$ sudo start airvideo

不要なファイルの削除

インストールが終わったら、インストールに使ったファイルを削除します。

$ cd ~
$ rm ffmpeg-for-2.4.5-beta7.tar.bz2
$ rm -rf ffmpeg/

ubuntu/v1404/airvideoサーバーの設定.txt · 最終更新: 2018/03/18 09:56 (外部編集)
 
特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki