Monday 9 April 2012

Air Video Server for Linux on Fedora 16

I use the excellent Air Video software to stream non-MP4 video (including DivX) to my iPad and iPhone (I then sometimes use Air Sharing to stream the video from the iPad or iPhone to my AppleTV).  The one problem I have with this set-up is that the Air Video Server software is only released for Macs (which I don't have) and Windows (which I do have, but don't like to leave running 24x7).

Luckily InMethod have released an alpha Air Video Server for Linux.  Unfortunately, getting this installed and running on Fedora 16 (my distribution of choice) isn't entirely straight forward.  The rest of this post is a guide to installing Air Video Server Linux alpha 6 on Fedora 16.

  1. Download the software:
    - From InMethodAirVideoServerLinux.jarffmpeg-for-2.4.5-beta6.tar.bz2test.properties
    - From mempeg4ip-1.6.1.tar.gz (no longer available from original website), mpeg4ip-1.6.1-pd.patchairvideo.serviceairvideo

    The patch is required to make mpeg4ip build on Fedora 16.  This patch is the minimum change to get mpeg4ip to build, and has only been tested in the context of getting Air Video Server Linux alpha 6 to work.
  2. Make sure you have installed the RPM Fusion repos.  You should also consider using yum priorities to protect the integrity of your machine - that is, make sure that when the same package is in the Fedora repos and RPM Fusion repos you do not break your machine by installing the RPM Fusion version.
  3. Install the dependencies that are available as RPMs:
    [sudo] yum install esound-devel faac gcc gcc-c++ \
             glib2-devel gtk2-devel java-1.7.0-openjdk lame-devel \
             SDL-devel x264-devel
  4. Build FFMpeg:
    tar jxvf ffmpeg-for-2.4.5-beta6.tar.bz2
    cd ffmpeg
    ./configure --enable-pthreads --disable-shared --enable-static \
      --enable-gpl --enable-libx264 -
    -enable-libmp3lame
    make all
    [sudo] make install
    cd ..
  5. Build mpeg4ip:
    tar zxvf mpeg4ip-1.6.1.tar.gz
    patch -p0 < mpeg4ip-1.6.1-pd.patch
    cd mpeg4ip-1.6.1
    ./configure
    make all
    [sudo] make install
    cd ..
  6. Install Air Video Server for Linux:
    [sudo] mkdir /usr/local/share/AirVideoServer
    [sudo] cp airvideo /usr/local/share/AirVideoServer
    [sudo] cp AirVideoServer.jar /usr/local/share/AirVideoServer
    [sudo] cp test.properties /usr/local/share/airvideo.properties
  7. Update /usr/local/share/AirVideoServer/airvideo.properties to match your system:
    path.ffmeg = /usr/local/bin/ffmpeg
    path.mp4creator = /usr/local/bin/mp4creator
    path.faac = /usr/bin/faac
    folders = <the location of your video files>
  8. Configure Avahi (Bonjour/mDNS):
    [sudo] cp airvideo.service /etc/avahi/services
    [sudo] service avahi-daemon restart
  9. Configure the firewall:
    Use system-config-firewall or system-config-firewall-tui and:
    - add Multicast DNS (mDNS) to the trusted services
    - add 45631:tcp in "Other Ports"
  10. Auto start/stop on system startup/shutdown:
    [sudo] ln -s /usr/local/share/AirVideoServer/airvideo \
             /etc/init.d/airvideo
    [sudo] chkconfig airvideo on
  11. Start Air Video Server for Linux:
    [sudo] service airvideo start
After all this your Fedora 16 PC will be running Air Video Server for Linux.  The Air Video software on your iPad or iPhone will automatically find your PC on your network (thanks to Bonjour/mDNS), and Air Video Server for Linux will automatically start/stop when you startup/shutdown your PC.

Updated Sun 10 Jun 2012 00:13