前導
在介紹完NAS4Free 的jails 安裝和Apache, MySQL and PHP5 的教學(xué)后,另一個(gè)很好的應用是Air Video Server。
自從購入iPad 后,Air Video Player 一直是很好的良伴。我記得購入完整版的Air Video Player 是$4.99. 但很值得。
配合著(zhù)Air Video Player 的是Air Video Server. 提供即時(shí)轉檔和串流的功能。但是Air Video Server 只有Windows & Mac 版。
在以FreeBSD 為核心的NAS4Free 上要跑是需要費點(diǎn)功夫。這是我現在遇到最頭痛的設定。好不容易才搞成功。
在參考過(guò)幾篇文章后,發(fā)現NAS4Free 官網(wǎng)的說(shuō)明還是最詳細。但有些細部的東西已經(jīng)過(guò)期,所以我還是追加一下。
安裝介紹
安裝基本套件
之前介紹過(guò)如何進(jìn)入到j(luò )ail 里,用jls 查一下jail ID 后就打jexec “JID” csh 先進(jìn)入到j(luò )ail 吧。我們的jail還是用www為雛形。
jexec 2 csh
更新一下 ports.
portsnap fetch extract
開(kāi)始安裝套件. 如果對設定有了解的進(jìn)階人士,可以對細部設定做校對,如果只想安裝Air Video Server, 就一直用預設就好。
cd /usr/ports/audio/lame && make install cleancd /usr/ports/audio/faad && make install cleancd /usr/ports/multimedia/x264/ && make install cleancd /usr/ports/multimedia/mpeg4ip/ && make install cleancd /usr/ports/multimedia/mp4v2/ && make install cleancd /usr/ports/devel/git/ && make install cleancd /usr/ports/devel/sdl12/ && make install cleancd /usr/ports/java/openjdk6/ && make install clean
#前前后后可能要數小時(shí)才能安裝完。
#我建議用ports 安裝,用pkg_add 會(huì )出現一些版本不相容的訊息
安裝 AirVideo 的所需套件
剛才在安裝mpeg4ip 時(shí),ffmpeg 已經(jīng)一起安裝了,但ffmpeg 要用AirVideo 特別版才能支援特殊參數,下載連結請到參考文獻里找。
NAS4Free 的wiki 和各大論壇都教用特別版的2.25版本,但我在compile 2.25版時(shí)會(huì )出現下面錯誤。
AIRVIDEO 特別版 FFMPEG
FFMPEG 2.25 的錯誤.
texi2html -monolithic -number doc/developer.texiOption number is ambiguous (number-footnotes, number-sections)Try `texi2html --help' for more information.gmake: *** [doc/developer.html] Error 2rm ffmpeg.o ffserver.o
但我就使用最新的2.4.5 beta 7 才能順利安裝。直接下載再解開(kāi)到 /mnt 下即可。
cd /mntfetch http://www.inmethod.com/air-video/download/ffmpeg-for-2.4.5-beta7.tar.bz2tar xvf ffmpeg-for-2.4.5-beta7.tar.bz2cd ffmpeg./configure --prefix=/usr/local/AirVideo --enable-pthreads --disable-shared --enable-static --enable-gpl --enable-libx264 --enable-libmp3lame --disable-decoder=aac --extra-cflags="-I/usr/local/src/x264-snap -I/usr/local/include -D__BSD_VISIBLE -DBROKEN_RELOCATIONS" --extra-ldflags=-L/usr/local/libgmake gmake install clean
注:這樣裝完特別版ffmpeg 會(huì ),它會(huì )存在在/usr/local/AirVideo/bin/ 里。
安裝 AIRVIDEO SERVER
剛才安裝好ffmpeg 時(shí),我們設定AirVideo Server 是在/usr/local/AirVideo/里。那我們就去那里下載 alpha 6版。 (連結在參考文獻里)
cd /usr/local/AirVideo/fetch http://inmethod.com/air-video/download/linux/alpha6/AirVideoServerLinux.jar
接下來(lái)我們要來(lái)建立server.properties 檔。
nano /usr/local/AirVideo/server.properties#貼上以下內容path.mp4creator = /usr/local/bin/mp4creatorpath.ffmpeg = /usr/local/AirVideo/bin/ffmpegpath.faac = /usr/local/bin/faacpassword =subtitles.encoding = windows-1250subtitles.font = Verdanafolders = Movies:/mnt/AirVideo
磁碟掛??載
在測試之前,我們要先掛載原先在NAS4Free server 下的影片載點(diǎn)(/ZFS/AirVideo/),先鍵入exit 退回到NAS4Free 的#下。
我們要去修改fstab.www 的設定檔來(lái)把這掛載點(diǎn)(mount point) 設定成開(kāi)機就自動(dòng)掛載。
exitnano /jail/conf/fstab.www# 貼上下面的內容## This file will mount your media directory on your NAS4Free storage pool## to your jails mount path for the airvideo server to access your media## Change the first path to fit your needs and leave the last 2 part alone# HOST MOUNT PATH # JAIL MOUNT PATH # FILESYSTEM #--------------------------------------------------------------------------------/ZFS/FreeNASWin/AirVideo/ /jail/www/mnt/AirVideo/ nullfs rw 0 0
注: Host Mount Path 就是你存放影片的點(diǎn)方,以我為例是/ZFS/AirVideo/
重開(kāi)個(gè)機看看掛載點(diǎn)有沒(méi)有成功.
jexec 2 csh#進(jìn)入 root@www:#去/mnt/AirVideo/ 看看有沒(méi)有電影檔在里頭ls /mnt/AirVideo/
有看到電影檔就成功了。
啟動(dòng) AIRVIDEO SERVER
進(jìn)入剛才ffmpeg compile 的目錄中,再執行java -jar
cd /usr/local/AirVideo/java -jar AirVideoServerLinux.jar server.properties
IPAD 上加入新 SERVER
AirVideo iPad or iPhone player 有免費和付費版。免費的版本一次只能顯示3個(gè)影片。如果你超過(guò)3個(gè),就按重刷就會(huì )看到了。像我有25部以上,就只好花$4.99買(mǎi)正版了。我買(mǎi)完后覺(jué)得很值得。
1. 先加入新的AirVideo Server. 按左上角的“+” 號。如圖1





exit
去稍早設定的 jail 的設定目錄下。
cd /jail/conf/nano jail_start
最后在底下加入這二行。
jexec 2 java -jar /usr/local/AirVideo/AirVideoServerLinux.jar /usr/local/AirVideo/server.properties
注:我們的 www jail 是代號2。如果一直照的本站的介紹,2就對了
參考文章
原文http://wiki.nas4free.org/doku.php?id=documentation:howto:airvideoserver&s[]=air&s[]=video
AirVideo Linux Server 下載點(diǎn):http://www.inmethod.com/forum/posts/list/1856.page
AirVideo 特制的ffmpeg: http://www.inmethod.com/air-video/licenses.html
AirVideo Server Under Linux: http://wiki.birth-online.de/know-how/hardware/apple-iphone/airvideo-server-linux
——————分割線(xiàn)——————
本文完結
聯(lián)系客服