Air Video Server on Linux (Ubuntu 10.04)
I have had an iPad for a few months now, but I use it mainly for reading, browsing, checking my e-mail and more recently for watching TV (through Veetle).
I haven’t used it so much for watching videos because my library is in HD (mostly 720p in Matroska) and the iPad usually doesn’t support the profile and level of the encondings. Converting them in advance takes time and for that reason is not convenient.
The Air Video player, with the Air Video Server, allows for the streaming of video transcoded for the iPad, but there are only server versions for Windows and for Mac OS X and my library is available on a headless linux server running Ubuntu 10.04.
After some googling I found out that there is a linux version of the Air Video Server. However, the installation process is not straight forward, or at least not as the Windows and Mac versions.
In this article is a compilation of the steps that took me to get it to work, based on the information found mainly on the following locations:
- http://wiki.birth-online.de/know-how/hardware/apple-iphone/airvideo-server-linux
- http://www.inmethod.com/forum/posts/list/34.page
- http://www.inmethod.com/forum/posts/list/165/34.page#6907
Setting up the server
- Since the server is based on a customized version of FFmpeg, download it from http://www.inmethod.com/air-video/licenses.html (use the 2.2.5 version!) and unpack it to some directory;
-
Install the following packages: libmp3lame-dev, libfaad-dev, libx264-dev (
0.svn20100115-0.0~kkstemp1from Stéphane Marguet’s PPA!), mpeg4ip-server;just run:sudo apt-get install libmp3lame-dev libfaad-dev libx264-dev mpeg4ip-server faac
-
Change to the directory to where you have unpacked FFmpeg
-
Run:
./configure –enable-pthreads –disable-shared –enable-static –enable-gpl –enable-libx264 –enable-libmp3lame –enable-libfaad –disable-decoder=aac
and then
make
If you get an error like “undefined reference to ‘x264_encoder_encode'” you can try and build the dependencies for ffmpeg by running:
sudo apt-get build-dep ffmpeg
It worked for me!
- After the build is complete, download the AirVideoServerLinux.jar (you can increment the alpha number in the URL to check if there is a newer version) and test.properties.
- Modify the
test.propertiesand fix the paths to the 3 tools and your video directory:-
path.ffmpegshould point to your just compiledffmpeg-binary -
path.mp4creatoris/usr/bin/mp4creator -
path.faacis/usr/bin/faac -
foldersformat is: <label1>:<path1>,<label2>:<path2>,…,<labelN>:<pathN> -
leave the other options as they are
-
-
Finally you can run the server by executing:
java -jar AirVideoServerLinux.jar test.properties
Auto-starting the server
To autostart AirVideoServer upon bootup, you can use UpStart which is the default way in Karmic Koala.
Just create a file /etc/init/airvideo.conf with this content:
start on runlevel [2345]
stop on shutdown
respawnexec sudo -H -n -u root /usr/bin/java -jar /opt/AirVideoServer/AirVideoServerLinux.jar /opt/AirVideoServer/test.properties
This will tell UpStart to run the server process as user root upon reaching one of the runlevels 2-5 and stop the server when the system shuts down. respawn tells it to restart the server if it crashed.
You can also control it manually by doing
sudo start airvideo
or
sudo stop airvideo
Setting up with Bonjour
In order to set up Air Vide Server with Bonjour announcement you need avahi-daemon. To install it, run:
sudo apt-get install avahi-daemon
Then create a file named airvideo.service (the name is really not important) in /etc/avahi/services/ with the following content:
<?xml version=”1.0″ standalone=’no’?>
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>
<service-group>
<name replace-wildcards=”yes”>AirVideoServer on %h</name>
<service>
<type>_airvideoserver._tcp</type>
<port>45631</port>
</service>
</service-group>
The file should be picked up immediately by the avahi-daemon, but you can restart the service just to make sure:
sudo restart avahi-daemon
Adding the server to Air Video player
When you run the Air Video player, the server you just set up should show up in the “Computers on Local Network” list. If not, either you didn’t set up Bonjour announcement properly, or you just didn’t set up Bonjour.
In either case you can manually add the server (by its IP address or by its name).
Enjoy!
2010-10-17 at 15:50
Interesting, exactly what I was looking for!
Unfortunately, your Step 4. with the parameters for ./configure didn’t work for me, I had to split it up to run ./configure with its parameter first and after run make. But then, it worked like a charm.
At the point of writing this comment, I’m struggling with setting up Bonjour correctly. But adding the AirVideo Server directly via IP works.
But thank you very, very much for pointing out that running an AirVideo Server on Ubuntu is possible. Thank you also for showing how to do that. Thanks 🙂
2010-10-17 at 18:45
Hi, Cowbuntu.
The problem you identified was a typo. Thanks for pointing it out. Just corrected the post.
I’m glad you found it useful.
2010-11-06 at 3:39
WOWEE!! Thank you so much – never touched linux before and following your steps worked 1st time!! This is SO awesome!! THANK YOU!!!
2010-12-15 at 3:02
Hey, Cowbuntu.
Perfect, just what I need exactly 🙂 Though a question before start.
Air video suggest at least a C2D, while I have my headless linux server running on an Atom 330.
Any idea if Atom can make the trick with transcoding?
thx
Rudy
2011-01-02 at 23:26
Hey, Rudy.
Just give it a try. With a P4 2.8 it isn’t enough. Sometimes I start the conversion offline from the iPad and some hours later I get back at it and everything works great. No weird command to convert the video.
2011-02-06 at 23:01
@Rudy
it works perfectly on my Atom 330 with Ubuntu server 10.04.2 LTS!
2011-01-18 at 18:25
Nice tutorial, great work!
I follow up your steps and it works. I run this under a debian (cmdline) server. (I’ve tried that several times before with other tutorialsource no succsess.) And now I am happy.
Thank you !
Volli (Germany)
2011-09-03 at 6:11
hi men, do you install in lenny or squeeze ?
i can’t in lenny for the moment.
thanks
2011-02-17 at 2:42
Works perfectly on Ubuntu 10.10 also. Really easy description!
Thanks!
고맙습니다 (Korean)
2011-03-10 at 12:58
Hi,
I just went through this guide and I can see and connect to the server on my iphone, but when I go to play a file I get ‘unexpected error’
Any ideas?
2011-04-06 at 17:37
Hi,
I installed but when I try to play with live conversion I receive this error:
DEBUG: Encoder: /usr/bin/ffmpeg: unrecognized option ‘–conversion-id’
DEBUG: LiveConversion: Encoder Process Done, closing segmenter.
What’s wrong?
2011-04-16 at 18:29
Not lucky (version alpha5)
DEBUG: SegmentedEncoder: FFmpeg version UNKNOWN, Copyright (c) 2000-2010 Fabrice Bellard, et al.
DEBUG: SegmentedEncoder: built on Apr 16 2011 19:04:43 with gcc 4.4.3
DEBUG: SegmentedEncoder: configuration: –enable-pthreads –disable-shared –enable-static –enable-gpl –enable-libx264 –enable-libmp3lame –enable-libfaad –disable-decoder=aac
DEBUG: SegmentedEncoder: libavutil 50. 8. 0 / 50. 8. 0
DEBUG: SegmentedEncoder: libavcodec 52.52. 0 / 52.52. 0
DEBUG: SegmentedEncoder: libavformat 52.50. 0 / 52.50. 0
DEBUG: SegmentedEncoder: libavdevice 52. 2. 0 / 52. 2. 0
DEBUG: SegmentedEncoder: libswscale 0.10. 0 / 0.10. 0
DEBUG: SegmentedEncoder: /opt/ffmpeg/ffmpeg: unrecognized option ‘-segment-lengt
2011-05-12 at 1:53
Alpha 5 causes /opt/ffmpeg/ffmpeg: unrecognized option ‘-segment-length but alpha4 seems to work fine.
2011-05-17 at 10:14
FAST WAY TO INSTALL AIR VIDEO SERVER:
1. Open a Terminal
2. Add the AirVideo PPA repository
sudo add-apt-repository ppa:rubiojr/airvideo
3. Update package index
sudo apt-get update
4. Install AirVideo Server
sudo apt-get install airvideo-server
5. Tweak the ‘folders’ property editing /opt/airvideo-server/AirVideoServerLinux.properties
6. Type:
airvideo-server
7. Enjoy
2011-08-11 at 20:55
This is aweeeesome!
Thanks!!!
2011-06-20 at 18:12
Hi!
Im totally new to Ubuntu in fact to the Linux world itself. When I tried step 4 I keep getting the following message
bash: ./configure: No such file or directory
Please guide me as to what am I doing wrong here.
Thanxs 🙂
vino
2011-06-20 at 19:10
Hi, vino.
The simplest way to install Air Video Server on linux is the way zduperele suggests (it’s a 300+ MB download/install, but so is the method I described). It installs all dependencies necessary.
Then you can follow my steps from “Auto-starting the server” onwards.
2011-06-24 at 2:44
This is great thank you. Anybody know why it keeps rejecting my password? I’ve double and triple checked that I’ve entered it correctly. No dice. If I turn on passwords it connects just fine. I obviously don’t want to use this out side of the home network if I can’t get this secured. Any help would be greatly appreciated.
Thanks.
2011-07-01 at 21:46
Try a simple password like1234. I’ve seen issues with more complex passwords.
2011-07-09 at 18:44
The tip of “FAST WAY TO INSTALL AIR VIDEO SERVER” is so GREAT! I managed to install Air Video Server within 15 mins into my Ubuntu (/w ION Atom N330)
How can I make the Air Video Server service start up automatically everytime I turn on Ubuntu? Thank you!
2011-07-09 at 19:02
Hi Brian,
Just follow the steps on the main post.
2011-10-23 at 12:01
I used the fast method, which is quite a bit easier than the other. However, I gather that it installs alpha 5 of the .jar file that actually runs the server. The latest is alpha 6. Can I just replace the .jar file with the newer one or is there more to do than that?
Also, I’m finding that airvideo-server uses up a lot of RAM (like 1.6GB all by itself). Any tips for cutting down that footprint?
2011-10-23 at 18:45
Hi Ernie,
I heard a new version was coming out, but I didn’t install it yet. It should be OK to just replace the .jar file, but nothing better that to try it.
While converting, airvideo-server should take up a lot of CPU, but shouldn’t take that much memory. While idle it’s like it’s not even there.
2011-10-23 at 20:40
I tried replacing the .jar file with the new alpha, but it didn’t work. AirVideo shows the preview but never starts converting.
I have no idea why mine takes up so much RAM. I’ve now set it up as an upstart service and it seems to use a bit less RAM when started that way.
I’m thinking I might just go through the longer install process to get alpha 6 installed.
2011-10-30 at 23:22
Hi everyone,
Do you know if ffmpeg with AirVideo server allows for live streaming to iPad/iPhone?
I know I can use ffmpeg to pick up a live stream from another server, can I use the AirVideo server to then stream that out?
2011-11-04 at 23:25
Mingaz, I have used your easy to install Aur video version for xubuntu 10.04 and it has worked great. Because of other SW I needed to get rid of openjdk and install sun java6 instead. To do this I had to uninstall air video server due to dependencies to openjdk.
@Mingaz: is there any hard vindings to openjdk? Can you suggest ways for this to work if I have sun java6 without also installing openjdk?
2011-11-05 at 0:24
Hi KlasH,
I don’t see any reason for Java 6 not to work with Air Video.
2011-11-05 at 8:51
Me neither. It is just that in the package handler is lists under dependencies a dependence to specifically openjdk so the package handler will install it to. Could it be in how the package has been compiled?
2011-11-05 at 10:40
Apparently it’s in the way the package has been compiled.
I would suggest for you to install openjdk also (through the Air Video install process) and then issue the command ‘sudo update-alternatives –config java’ to select the default Java to be used in your system.
Hope it helps.
2011-11-16 at 22:37
Hi, I’ve tried every single method which I could google out, including the simple one, but I keep getting the following message:
DEBUG: SnapshotCache: Initializing Thumbnail Cache; Java Version: 1.6.0_20
DEBUG: SnapshotCache: Created new Snapshot Index BTree2011-11-16 22:33:50.075::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
2011-11-16 22:33:50.182::INFO: jetty-6.1.x
2011-11-16 22:33:50.310::INFO: Started SocketConnector@0.0.0.0:45631
DEBUG: PortMapperAction: Scheduling task PortMapperAction$2 (3668766)
I’m runing Atom 330 and Ubuntu 10.04 with Xbmc live on it. After trying to access the server from Ipad I can see the folders, but they show 0 movies.
Thanks for any help!
2012-01-27 at 16:58
Hi, thanks for the guide!
What if I do not want to run the service as root
Is it safe to run as root? Can’t I just run it as normal user
2012-01-28 at 19:23
I guess you can run it with any user you like as long as it has access to config and media files.
2012-04-18 at 11:12
Hi. I wish to get avahi-deamon to work on my linux server. I’ve installed the daemon and paste the code in the services folder. Restart avahi but airvideo app doesn’t pick up. How can I configure bonjour announcement? Where is it in? I wish to get this working so I can steam video on my lan and not through my isp.
2012-04-18 at 21:17
Hi Duc Su,
Check for extra characters added by the paste. your airvideo.service file should look like the what you see in the post. Other than that, I can only help if you send the file.
Of course you can always add the server manually to AirVideo.
2012-04-19 at 3:13
Hi. Thanks for the reply. It was in fact the pasting. Some of the characters would be wrong. So I have typed it manually. Now, airvideo can see the server, but it get stuck on ‘connecting resolving address (Bonjour) message. It helps when I restart avahi-daemon. I would hate to do this every time this message comes up. Would you know what could be wrong?
2012-04-19 at 8:00
Hi Duc Su,
Did you check the log? My avahi-daemon log is in /var/log/syslog.
Hope it helps.
2012-04-19 at 9:52
I checked the syslog. There is nothing there containing to avahi. It seems to drop the connection to bonjour whenever I browse airvideo with another wifi or 3G connection. When I try to view airvideo with my local server again, bonjour cannot be found. Only way to get back connection is to restart avahi-daemon. The manual connection works but I was hoping to get this working because my isp is complaining that I am over my upload cap per day usage. I use airvideo (iphone), to watch movies on my tv everyday.
2012-04-19 at 20:36
Hi, Duc Su.
If the system log doesn’t contain anything pertaining avahi-daemon (you can search for “avahi” using grep:
), probably you have a specific log file for the process. I have at least the startup and shutdown notifications.
The manual configuration should’t use more bandwidth than the avahi one. Avahi is only used for automatic configuration of the server on the AirVideo client. Otherwise I am not understanding your concern.