03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Embedded Systems 304<br />

Installing ImageSnap On OSX<br />

The utility we’ll be using on OSX is called ImageSnap. We can install it with homebrew:<br />

brew install imagesnap<br />

Once that’s installed; we can periodically take photos with it by using a command resembling:<br />

1 imagesnap -d "Microsoft LifeCam" -w 3<br />

The web cam I am using is Microsoft LifeCam but you can find the appropriate one for you with<br />

the command:<br />

1 imagesnap -l<br />

I also had to add some warm-up time, with the -w switch.<br />

Installing Streamer On Ubuntu/Debian<br />

The utility we’ll be using on Ubuntu/Debian is called Streamer. We can install it with the command:<br />

1 apt-get install -y streamer<br />

You can take a photo with the web cam, using the following command:<br />

1 streamer -o snapshot.jpeg<br />

Displaying Photos In The Interface<br />

Depending on whether you are using OSX or Ubuntu/Debian; you will need to set up a shell script to<br />

periodically take photos. Save them to a web-accessible location and display them with the following<br />

changes:<br />

1 <br />

.<br />

This was extracted from app/views/index/index.blade.php.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!