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-8-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 reload

設定とテスト

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

$ 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

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

/etc/rc.local に、以下の記述を追加します。
hogehogの部分はユーザ名。

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exec sudo -H -n -u yoshida env LANG=ja_JP.UTF-8 `which java` -jar /opt/airvideo-server/AirVideoServerLinux.jar /opt/airvideo-server/my.properties

exit 0

不要なファイルの削除

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

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

ubuntu/v1604/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