wazzBate
Posts: 9
Joined: Tue Jan 29, 2013 4:24 am

Air Video Server - Stream Video to IPad

Wed Jan 30, 2013 10:39 pm

I've successfully installed AirVideo Server on Raspberry Pi

Requirements
Air Video app for the Ipad / IPhone

Limitations
Due to the low processing power of the 'pi' the live conversion doesn't work fast enough.
Its best to convert all videos to mp4 before playing them, I recommend dropfolders, it uses handbrake to convert videos to mp4. http://ctl.du.edu/staff/josephlabrecque/DropFolders/ and you can batch queue videos for conversion.
In the AirVideo app it will take a few seconds for the video thumbnail to appear, wait for it to load before playing.

Installation
Firstly install your raspberry pi debian OS

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libmp3lame-dev libx264-dev libfaad-dev git-core pkg-config openjdk-6-jre avahi-daemon avahi-discover libnss-mdns samba yasm

wget http://s3.amazonaws.com/AirVideo/Linux- ... av.tar.bz2
sudo tar -xjvf libav.tar.bz2
cd libav
sudo ./configure --enable-pthreads --disable-shared --enable-static --enable-gpl --enable-libx264 --enable-libmp3lame --enable-nonfree --enable-encoder=libfaac
sudo make

( If you have any issues with libx264, remove "--enable-libx264" from the command line )

The make process will take a long time so be patient

sudo mkdir /etc/airvideo
cd ..
sudo mv libav /etc/airvideo
sudo chmod -R 777 /etc/airvideo

cd /etc/airvideo
wget http://s3.amazonaws.com/AirVideo/Linux- ... rLinux.jar
vi /etc/airvideo/properties.conf

( Setup the following to your own path where the videos are stored )

folders = TV:/store/tv
subtitles.encoding = windows-150
subtitles.font = Verdana
password =
path.ffmpeg = /etc/airvideo/libav/avconv



Configure Avahi

sudo vi /etc/default/avahi-daemon

add the following:
AVAHI_DAEMON_START=1

sudo service avahi-daemon restart

Configure Samba

sudo vi /etc/samba/smb.conf

( Setup the following share according to the path that your files are stored in )

[store]
comment = Store
read only = no
path = /store
guest ok = yes
browsable = yes
create mask = 0777
directory mask = 0777
writeable = yes


sudo service samba restart

Configure Auto-Start

sudo crontab -e
@reboot java -jar /etc/airvideo/AirVideoServerLinux.jar /etc/airvideo/properties.conf 2&>1 /dev/null &
sudo reboot


After Installation
You can manually execute the airvideo server if you didnt add it to the cron: sudo java -jar /etc/airvideo/AirVideoServerLinux.jar /etc/airvideo/properties.conf
If you created the samba share; copy your mp4 files to the samba share.
Run the Air Video app on your IPad and manually specify its IP Address, select the video and press Play.

Notes
1. There might be a potential in setting the raspberry pi as an access point to simplify connectivity
2. You could attach a large capacity external hard drive instead of using the internal SD Card, for this experiment I am using a 32GB class10 SD Card.
3. This was only an experiment, my first PI project. Im not sure if I will use this in a real world scenario, perhaps if you have kids and intend to travel over long distance by road you could keep them quiet by converting their videos and stream them via AirVideo.

Reference Websites
http://blog.stevenlu.com/2012/09/10/ins ... n-squeeze/
http://wiki.birth-online.de/know-how/ha ... rver-linux
http://ctl.du.edu/staff/josephlabrecque/DropFolders/
http://www.inmethod.com/air-video/index ... ACE1C0D83B
http://www.inmethod.com/forum/posts/list/1856.page
Last edited by wazzBate on Fri Apr 19, 2013 5:52 am, edited 3 times in total.

techs1200
Posts: 28
Joined: Thu Jan 24, 2013 7:45 pm

Re: Air Video Server - Stream Video to IPad

Thu Jan 31, 2013 5:03 am

awesome!

you should be able to transcode video using openmax. input/output formats are limited but the performance would be insane!

if only i had the time to write the openmax code...

wazzBate
Posts: 9
Joined: Tue Jan 29, 2013 4:24 am

Re: Air Video Server - Stream Video to IPad

Thu Jan 31, 2013 11:19 am

To fix up airvideo to auto discover instead of having to manually specify the ip address, avahi needs to be setup correctly.

sudo vi /etc/default/avahi-daemon

add the following:
AVAHI_DAEMON_START=1

than
sudo service avahi-daemon restart

Nickb23
Posts: 12
Joined: Wed Jan 02, 2013 8:25 am

Re: Air Video Server - Stream Video to IPad

Sun Feb 10, 2013 2:44 pm

Hey Guys,
This is exactly what I have wanted to do for my first pi project - create an in car based media server that 2 ipads could stream movies from for long car journeys. The way I was going to do it was with Webdav, as I already have this successfully running from my home server at home. But as you have already done the hard stuff, I thought I would just copy you :-) Unfortunatley, I have come accross a problem that hopefully you can help me with. I have setup the samba share as "share". I can see it from my Windows PC, but when I try and open it, it says that I cannot access it. My Linux is very rusty, but any kind of ideas where to start would be greatly apreciated. Also is there anything else I can use instead of Vi? Did my head in 10 years ago, and still does today :P

After this, gotta get wifi working...... So far I know I can get it to work as an AP, so that is great!!

Thanks all

Nick

wazzBate
Posts: 9
Joined: Tue Jan 29, 2013 4:24 am

Re: Air Video Server - Stream Video to IPad

Mon Feb 11, 2013 6:05 am

if the directory is /share

sudo chmod -R 777 /share

If you setup samba correctly you should be able to access the share from windows and modify its contents.

wazzBate
Posts: 9
Joined: Tue Jan 29, 2013 4:24 am

Re: Air Video Server - Stream Video to IPad

Mon Feb 11, 2013 9:55 pm

Nickb23 wrote:Hey Guys,
This is exactly what I have wanted to do for my first pi project - create an in car based media server that 2 ipads could stream movies from for long car journeys. The way I was going to do it was with Webdav, as I already have this successfully running from my home server at home. But as you have already done the hard stuff, I thought I would just copy you :-) Unfortunatley, I have come accross a problem that hopefully you can help me with. I have setup the samba share as "share". I can see it from my Windows PC, but when I try and open it, it says that I cannot access it. My Linux is very rusty, but any kind of ideas where to start would be greatly apreciated. Also is there anything else I can use instead of Vi? Did my head in 10 years ago, and still does today :P

After this, gotta get wifi working...... So far I know I can get it to work as an AP, so that is great!!

Thanks all

Nick

If you're having problems with 'vi' try 'nano'
Others might recommend something else.

I prefer vi simply because I use it everyday at work ;)

Basically to create/edit a file: vi /home/pi/filename.conf
To insert text: press i
If you're using putty to telnet to your pi, right click your mouse to paste
Press esc to stop insert
Type :wq to write and quit
If you've made a mistake or don't want to save, :q!

donpisci
Posts: 8
Joined: Mon Feb 11, 2013 12:54 pm

Re: Air Video Server - Stream Video to IPad

Wed Feb 13, 2013 12:07 pm

Apologies for the stupid question, but I'm assuming you can use this set up to stream music from say, a NAS, to an iPhone?

Thanks!

wazzBate
Posts: 9
Joined: Tue Jan 29, 2013 4:24 am

Re: Air Video Server - Stream Video to IPad

Thu Feb 14, 2013 10:34 pm

If you have root access to the nas and its running linux than potentially you could.

weissivart
Posts: 1
Joined: Thu Mar 07, 2013 3:30 pm

Re: Air Video Server - Stream Video to IPad

Thu Mar 07, 2013 3:35 pm

Hi, thanks for the great work. I'm stuck at the part below, where I get a './configure: 1861: ./configure: cannot create config.log: Permission denied' error. Any advice pls? Thanks loads in advance!

./configure --enable-pthreads --disable-shared --enable-static --enable-gpl --enable-libx264 --enable-libmp3lame --enable-nonfree --enable-encoder=libfaac

etlprws
Posts: 1
Joined: Thu Mar 07, 2013 11:14 pm

Re: Air Video Server - Stream Video to IPad

Thu Mar 07, 2013 11:29 pm

Hi,

(First post here!)

Many thanks for the detailed instructions...after I actually followed them properly I got everything installed ok. :oops:

The issue I have is that the Air Video client on my iPad will not play my videos from the Pi.

The app can see the files and lists the correct file name. However, rather than a thumbnail of the video I get a "?" with a timer symbol over it. This does not change, however long I leave the app. When I click on the file name I get a message saying "Unexpected Error".

I have tried the same video from a Mac version of Air Video and it runs fine, so it seems to be the Pi that has the problem.

The video is an MP4 shot with a Gopro Hero 3 (1920 x 1440, H.264, AAC) - if that helps?

Any ideas where I might be going wrong?

Many thanks
Peter

rndpig
Posts: 1
Joined: Sun Mar 17, 2013 12:28 am

Re: Air Video Server - Stream Video to IPad

Sun Mar 17, 2013 12:31 am

weissivart wrote:Hi, thanks for the great work. I'm stuck at the part below, where I get a './configure: 1861: ./configure: cannot create config.log: Permission denied' error. Any advice pls? Thanks loads in advance!

./configure --enable-pthreads --disable-shared --enable-static --enable-gpl --enable-libx264 --enable-libmp3lame --enable-nonfree --enable-encoder=libfaac
Not sure if you had figured this out yet or not. Just add 'sudo' (without the quotes) before ./configure in the statement you listed, and it will work.

wazzBate
Posts: 9
Joined: Tue Jan 29, 2013 4:24 am

Re: Air Video Server - Stream Video to IPad

Fri Apr 19, 2013 5:43 am

Instructions updated.

smartasspt
Posts: 1
Joined: Fri May 10, 2013 6:47 pm

Re: Air Video Server - Stream Video to IPad

Fri May 10, 2013 6:50 pm

Tested this out today, like you, specifically for the kids in the back seat on long car rides. Your instructions are perfect, thank you for blogging them.

I did it along with turning my Pi into a Wireless Router so it works flawlessly in the car. That part was no easy task since I have the Edimax wireless card, but it does work!

julianp13
Posts: 6
Joined: Mon Sep 24, 2012 8:49 am

Re: Air Video Server - Stream Video to IPad

Sat May 11, 2013 1:09 pm

Is there anyone who could provide an image file for this as I would love to have this project on my pi.

Thank you in advance...

afhaaljap
Posts: 2
Joined: Tue May 21, 2013 11:17 am

Re: Air Video Server - Stream Video to IPad

Tue May 21, 2013 12:00 pm

Thanks for this great tutorial! I've got everything up and running. I'm going to use this as a movie streamer in my car, which is awesome for the 1000 mile roadtrip to Italy with my friends this summer :)

I've been playing around with my setup and noticed a huge increase in performance when I turned the samba server off. Thumbnails for my movies now show up instantly (instead of waiting 10~20 sec)! I haven't tested the amount of devices that can now stream simultaneously, but with Samba turned on, I had 2 devices running different movies with no problems.

I use an external hard drive to hold my movies, so I won't need samba at all. If you're using the SD card to hold your movies, I guess you could just run samba when needed and stop it from running on boot.

NOTE: Turning off or removing samba will NOT affect your Air Video server

If you want to try this out, you can use this command to stop the samba server:

Code: Select all

sudo service samba stop
If you want to remove samba all together, you could use these commands to remove samba and obsolete packages:

Code: Select all

sudo apt-get purge samba
and then:

Code: Select all

sudo apt-get autoremove
I don't know how to stop samba from starting on boot, but Google probably will.

P.S. For people who want to know: the make command took about 2 hours on my RPi.

julianp13
Posts: 6
Joined: Mon Sep 24, 2012 8:49 am

Re: Air Video Server - Stream Video to IPad

Tue May 21, 2013 8:30 pm

I've run out of space on my 8gb sd card. What size card do I need for this project?

afhaaljap
Posts: 2
Joined: Tue May 21, 2013 11:17 am

Re: Air Video Server - Stream Video to IPad

Fri May 24, 2013 2:36 pm

julianp13 wrote:I've run out of space on my 8gb sd card. What size card do I need for this project?
I'm using an 8GB SD Card and I still have a lot of space left. I'm not storing my movies on it.

Have you used the 'expand_rootfs' option in raspi-config? If you did, did you put your movies on the SD card? That could also be the problem.

You can open raspi-config using this command:

Code: Select all

sudo raspi-config
Then highlight 'expand_rootfs' and hit enter.

NOTE: If you've filled up 100% of your rootfs partition, you'll get an error and have to reflash your SD-Card before you can expand your rootfs. (I found out the hard way)

mattadamsnet
Posts: 5
Joined: Wed Jan 09, 2013 3:46 am

Re: Air Video Server - Stream Video to IPad

Sat May 25, 2013 1:44 am

It's been 2 hours 20 minutes I'm going to bed. It's still going. wonder if there were a way to build this on the PC and just move the files over, that would be much faster.

mattadamsnet
Posts: 5
Joined: Wed Jan 09, 2013 3:46 am

Re: Air Video Server - Stream Video to IPad

Sat May 25, 2013 7:20 pm

wazzBate wrote:wazzBate » Wed Jan 30, 2013 4:39 pm

I've successfully installed AirVideo Server on Raspberry Pi
Like a Boss. What!?!?!? Thanks so much, you will make our trip to Disney ~800 miles much more enjoyable, three kids and my wife all thank you!


On a side note anyone have troube with it not starting @reboot? I'm still figuring this out, no biggie, could always ssh in to start it.

pling
Posts: 1
Joined: Fri May 31, 2013 9:01 am

Re: Air Video Server - Stream Video to IPad

Fri May 31, 2013 9:06 am

I added an extra line at the end of the AirVideoServer configuration file to prevent thumbnail creation time-outs I experienced with some video's:

Code: Select all

vi /etc/airvideo/properties.conf

thumbnailGenerationTimeout = 5

clarity99
Posts: 1
Joined: Fri Jun 14, 2013 11:42 am

Re: Air Video Server - Stream Video to IPad

Fri Jun 14, 2013 12:19 pm

Has anyone created packages for this perhaps? I am using Raspbmc and don't have build environment set up...

delgadospain
Posts: 1
Joined: Mon Oct 28, 2013 2:14 pm

Re: Air Video Server - Stream Video to IPad

Mon Oct 28, 2013 2:18 pm

hello! I have a question, how can I install a external hdd ? I want reproduced the contain of this hdd and not there are in the sd card, thanks you very much!!

abalakov
Posts: 1
Joined: Fri Dec 20, 2013 12:02 pm

Re: Air Video Server - Stream Video to IPad

Fri Dec 20, 2013 12:10 pm

Hi,

many thanks for the great tutorial!

I just want to add one point: in order to find the Air Video Server when using the avahi service you need to add the service in directory /etc/avahi/services e.g. multi.service

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>

<name replace-wildcards="yes">%h</name>

[REPLACE by rother services here]

<service>
<type>_airvideoserver._tcp</type>
<port>45631</port>
</service>

</service-group>
Regards.

Grantysid
Posts: 3
Joined: Sun Jan 05, 2014 9:15 am

Re: Air Video Server - Stream Video to IPad

Sun Jan 05, 2014 9:50 am

Howdy,

After a couple of attempts, I have managed to get this working with an Edimax ew-7811un wifi dongle operating as a router, and with a USB memory stick with my m4v files on it. Have even got it running in my car which is quite cool.

Dumb things that I did include a typo in the /etc/airvideo/properties.conf file where I typed "avconf" instead of "avconv" on the last line. This gives you an 'unexpected error' when trying to play any videos, and took a long time to find.... May be the cause of etlprws issue back in March, the symptoms are very similar.

Also, Nano is much easier to use than Vi if you have no experience, and using an SSH client to connect to your Pi remotely is a good way to help troubleshoot issues by being able to make changes quickly if you are running headless. iPad app ServerAuditor is a good free SSH app btw.

However, I can only get one iPad or iPhone connecting using the Airvideo client concurrently, which is a bit of a pain. As soon as I have a second device connected using the Airvideo client it causes a "communications error" and that's where it stops.

If I stop the first movie that was playing, and back out of the folder menus to the servers folder then on the second device I can start playing videos, but the first will give the "communications error" if I try to restart it playing.

I have been through the configuration from head to toe, and can't see any issues, the devices have been given different ip's from the router and are able to load a web page from the Pi (has Apache running to help troubleshooting). Just will not stream video to two devices at the same time.

If anyone can point me in the right direction to resolve this, then I would be grateful, I have another SD card so I can start from scratch again quite quickly and do the build without the router component to try anything out.

Cheers
Grant.

Grantysid
Posts: 3
Joined: Sun Jan 05, 2014 9:15 am

Re: Air Video Server - Stream Video to IPad

Wed Feb 05, 2014 10:25 pm

Howdy,

After playing around with the settings and rebuilding it from scratch, I found that performance issues are mostly caused by wifi throughput issues. I tried overclocking and changing the GPU RAM settings, but the former just makes the Pi hot and the latter has no real effect above 64Mb. (I use the Medium overclock and 64Mb RAM setting.)

Using the Edimax wifi dongle, the basic settings are for the lowest speed apparently. Check the comments section in the tutorials on Dave Conroy's site (www.daveconroy.com) if you are using this wifi dongle - there are some settings for the hostapd.conf file that crank up the speed so that multiple connection stream OK.

The other issue is power - this certainly restricts the wifi working properly when running on the 12v supply. Using a charging adapter that will charge an iPad gives consistently the best results, a basic 0.5mA adapter just won't cut it when you are trying to drive the Wifi dongle and pull the movies off the USB stick and run the Pi at the same time.

Hopefully this will provide enough guidance - I can get 4 simultaneous movies streaming in my car off the Pi no problem, and have connections to the wifi being added and removed at will.

Cheers
Grant.

Return to “Graphics, sound and multimedia”