User Tools

Site Tools


System information & Introduction

Hostname xigmanas.local
Version Sandstorm (rev. 68)
Built on Sat Apr 21 14:58:46 CEST 2012
OS Version FreeBSD 9.0-RELEASE (revision 199506)
Platform x64-embedded on Intel(R) Pentium(R) 4 CPU 2.80G (Dell Optiplex GX520)

Create the Jail

  • Make these slight changes to the folder structure of the jail creation guide
    • Instead of /jail call it /airvideo_jail, do this for the root folder and the folder where you will actually store the jail files. Then continue the jail creation guide.
            # mkdir /airvideo_jail
            # mkdir /path/to/storage/pool/airvideo_jail
            # mount_nullfs /path/to/storage/pool/airvideo_jail /airvideo_jail
            # cd /airvideo_jail
            # mkdir /airvideo_jail/{work,proto,conf}
            # mkdir /airvideo_jail/proto/mnt/media
  • Continue to follow the jail guide till you get to “Create fstab File”.
    • Create the fstab.proto file and nano to it. Then put in the code below and save:
           ## 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 <OPTIONS>
           /mnt/storage/media/     /airvideo_jail/proto/mnt/media/ nullfs  rw      0       0
NOTE: Make sure to change the HOST MOUNT PATH to where your media will be in your storage pool on NAS4Free.
  • Continue following the jail guide until you get to “Create rc.conf.local”.
    • Create the rc.conf.local file and nano to it but add these lines instead, then save:
             ### EXAMPLE - MODIFY TO FIT YOUR NEEDS ###
NOTE: Change the IP Address and Interface name to fit your needs, before saving
  • Continue with the rest of the jail creation guide and stop at “Strip Down Proto Jail”, your done. Reboot you NAS and load up SSH CLI again. Make sure your jail is running: (if jls command doesn't work, do a # rehash)
        # jls
        JID  IP Address      Hostname                      Path
          1    airvideo.nas4free.local       /airvideo_jail/proto

Building the Air Video Server

  • Enter your jail:
     # jexec 1 csh
  • Once inside your jail, install Bash
      airvideo# pkg_add -rv bash
      airvideo# rehash
      airvideo# exit
  • Enter your jail once again but this time we will use bash
     # jexec 1 bash
  • Install the required packages
     [root@airvideo /]# portsnap fetch extract
     [root@airvideo /]# cd /usr/ports/audio/lame && make install clean
     [root@airvideo /]# pkg_add -rv faad2
     [root@airvideo /]# pkg_add -rv x264
     [root@airvideo /]# pkg_add -rv x264-devel
     [root@airvideo /]# pkg_add -rv mpeg4ip
     [root@airvideo /]# pkg_add -rv git
     [root@airvideo /]# pkg_add -rv sdl (may already be installed)
     [root@airvideo /]# pkg_add -rv openjdk6
     [root@airvideo /]# pkg_add -rv nano
     [root@airvideo /]# rehash

Download & Compile Customer FFMpeg

  • Extract:
    • Extract the archive and place the ffmpeg folder in your NAS storage pool where you have the jail's /mnt/media path pointed to
  • Compile:
      [root@airvideo /]# cd /mnt/media/ffmpeg
     # ./configure --prefix=/usr/local/AirVideo --enable-pthreads --disable-shared --enable-static --enable-gpl --enable-libx264 --enable-libmp3lame --enable-libfaad --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/lib               
     # gmake
     # gmake install clean
NOTE: The configure line looks complicated but will get you want you need

Congrats you have gotten all the packages and compiled ffmpeg!

  • Download AirVideoServerLinux.jar
     # cd /usr/local/AirVideo
     # fetch
  • Create file for AirVideoServerLinux.jar
     # cd /usr/local/AirVideo
     # nano
  • Put this into the file and save: (set a password if needed)
     path.mp4creator = /usr/local/bin/mp4creator
     path.ffmpeg = /usr/local/bin/ffmpeg
     path.faac = /usr/local/bin/faac
     password =
     subtitles.encoding = windows-1250
     subtitles.font = Verdana
     folders = Movies:/mnt/media/Movies,Series:/mnt/media/Series
  • Create the Movies and Series (TV Shows) folder
    • Access your NAS storage location that you linked to /mnt/media in your jail via afp, samb, nfs, etc. Create 2 folders called Movies and Series. These folder should also now show up in your jail in /mnt/media/Movies and /mnt/media/Series. Basically your movies and tv show folders where you will place your respective media files. Place a small text video in one of those for the next part of this guide.

Test Air Video Server

  • While in your jail type:
     # java -jar /usr/local/AirVideo/AirVideoServerLinux.jar /usr/local/AirVideo/
NOTE: You may receive a DEBUG error pertaining to thumbnails on first load. If that happens press Ctrl + C to get back to command promt and run the above command again.
  • Access your Air Video Server
    • Load up your air video client on your iDevice and connect to your server via the IP you set for the jail @ port 45631.
    • Try to play the test video and make sure it plays. If it does…well done.

One last thing…

  • When you restart your NAS, the jail will automatically start but the Air Video Server will not. We can fix this by adding a new line to the jail_start script. So CTRL + C if Air video Server is running in your jail and exit your jail by typing:
     # exit
  • Now your back to your NAS system and do this:
     # cd /airvideo_jail/conf
     # nano jail_start
  • Add this line to the bottom of the script:
     #start airvideo server
     jexec 1 java -jar /usr/local/AirVideo/AirVideoServerLinux.jar /usr/local/AirVideo/
  • Make sure the command is all one line and save. Now reboot your NAS and when it comes up not only will your jail be started but also air video server! Go ahead and try to connect to the air video server on your iDevice and play the test video again.

Congrats you have Air Video Server on XigmaNAS now!

documentation/howto/airvideoserver.txt · Last modified: 2018/07/13 02:14 by zoon01