打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
在NAS4Free上安裝Air Video Server 扩展应用

前导
在介绍完NAS4Free 的jails 安装和Apache, MySQL and PHP5 的教学后,另一个很好的应用是Air Video Server。
自从购入iPad 后,Air Video Player 一直是很好的良伴。我记得购入完整版的Air Video Player 是$4.99. 但很值得。
配合着Air Video Player 的是Air Video Server. 提供即时转档和串流的功能。但是Air Video Server 只有Windows & Mac 版。
在以FreeBSD 为核心的NAS4Free 上要跑是需要费点功夫。这是我现在遇到最头痛的设定。好不容易才搞成功。
在参考过几篇文章后,发现NAS4Free 官网的说明还是最详细。但有些细部的东西已经过期,所以我还是追加一下。

安装介绍

安装基本套件
之前介绍过如何进入到jail 里,用jls 查一下jail ID 后就打jexec “JID” csh 先进入到jail 吧。我们的jail还是用www为雏形。

jexec 2 csh

更新一下 ports.

portsnap fetch extract

开始安装套件. 如果对设定有了解的进阶人士,可以对细部设定做校对,如果只想安装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

#前前后后可能要数小时才能安装完。
#我建议用ports 安装,用pkg_add 会出现一些版本不相容的讯息
安装 AirVideo 的所需套件

刚才在安装mpeg4ip 时,ffmpeg 已经一起安装了,但ffmpeg 要用AirVideo 特别版才能支援特殊参数,下载连结请到参考文献里找。
NAS4Free 的wiki 和各大论坛都教用特别版的2.25版本,但我在compile 2.25版时会出现下面错误。

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 才能顺利安装。直接下载再解开到 /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 会,它会存在在/usr/local/AirVideo/bin/ 里。

安装 AIRVIDEO SERVER
刚才安装好ffmpeg 时,我们设定AirVideo Server 是在/usr/local/AirVideo/里。那我们就去那里下载 alpha 6版。 (连结在参考文献里)

cd /usr/local/AirVideo/fetch http://inmethod.com/air-video/download/linux/alpha6/AirVideoServerLinux.jar

接下来我们要来建立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 下的影片载点(/ZFS/AirVideo/),先键入exit 退回到NAS4Free 的#下。
我们要去修改fstab.www 的设定档来把这挂载点(mount point) 设定成开机就自动挂载。

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 就是你存放影片的点方,以我为例是/ZFS/AirVideo/
重开个机看看挂载点有没有成功.

jexec 2 csh#进入 root@www:#去/mnt/AirVideo/ 看看有没有电影档在里头ls /mnt/AirVideo/

有看到电影档就成功了。
启动 AIRVIDEO SERVER
进入刚才ffmpeg compile 的目录中,再执行java -jar

cd /usr/local/AirVideo/java -jar AirVideoServerLinux.jar server.properties

IPAD 上加入新 SERVER
AirVideo iPad or iPhone player 有免费和付费版。免费的版本一次只能显示3个影片。如果你超过3个,就按重刷就会看到了。像我有25部以上,就只好花$4.99买正版了。我买完后觉得很值得。
1. 先加入新的AirVideo Server. 按左上角的“+” 号。如图1


(Add a server)
2. 在Server 输入画面,选Specify Address Manually, 如图2,图3是输入server hostname or IP, 我们打入刚建好的jail IP

(AirVideo Specify Server Address Manually)

(AirVideo Enter Server IP)
3. 储存完后, 再按刚才加入的server 就可以看到档案清单了,再选影片就可以看了。图4和5介绍完成画面。 yeah!


(AirVideo Video Playback)
设定成自动执行
如果想要在开机时自动在开机时执行,要设定以下的参数,但要退出www jail 再设。
先退出jail到NAS4Free下

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 下载点: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

——————分割线——————
本文完结

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
ffmpeg 静态库连接顺序
Windows server 才适合nas
FFMPEG转码后得到的MP4必须要加载完才能播放的问题 - eachcan - 博客园
Linux 编译升级 Ffmpeg 步骤
ffmpeg编译及使用
Freenas使用小结(二)配置(打造nas下载机)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服