Eagle Eye Networks

Our Video API: Getting Previews

May 27, 2014 Hans Kahler

getting previews

This blog post is an example of how you can use the Eagle Eye Networks Video API to embed the preview stream on another site. This is a common request from businesses that want to show their visitors the inside of their facility without a password. Home owners associations, pet hotels, and amusement parks are all examples of this.

Background

The Video API makes it very easy to get the preview stream for all the cameras in an account. The preview stream is a series of JPEG images and requires authentication. Our code today will show how to use the API to provide the images on a webpage without authentication.

Step 1:

We are going to use the code at mcotton/watcher to run a Node.js server that will login, subscribe to the poll stream, notify the client and proxy the image requests. We could remove the poll stream to make the example very basic but it is worth going through it now.

Download or clone the git repository. Keep watching our blog as we add more examples in different languages.

Step 2:

You will need to have Node.js installed (current version is v0.10.26). Once it is installed, open up the command line in the same directory as the example code, you can install the dependencies by running

Edit the file named config.js, replace ‘your_username’ and ‘your_password’ with your username and password

Save the file and start the server

Step 3:

You can now open a browser at go to localhost:3000 and you will see previews show up as they become available on the server.

The code does the following items: authenticates, authorizes, gets a list of devices, subscribes to the poll stream for each of them, listens to the poll stream and notifies the client when a new preview is available.

Because we are subscribed to the poll stream we are only fetching previews when they are available. This makes it very bandwidth efficient.

Conclusion:

You can now treat the image URLs just like static assets on your server. You can put it behind your own firewall or you can make it publicly available. In both cases your username and password are safely stored on the server and never sent to the client.

Other posts that might interest you

loading

Outdoor surveillance: When getting past trailers make sense

Indoor security cameras are typically mounted in fixed, relatively protected locations, such as the corner of a room or flush to the ceiling. And since they're safely out of the…

July 10, 2025 Timothy Lord

Visualize security like never before: Eagle Eye Networks & CoreSpec 3D™

Ensuring safety and security requires more than just static blueprints, which are often outdated. Imagine navigating a building's security layout in an interactive 3D environment, understanding camera placements, and even…

June 18, 2025 Rachel Abrams

Deter threats in real-time with Eagle Eye Networks and Blue Eye

Proactive threat deterrence is paramount. That's why the integration of Blue Eye's cutting-edge remote video monitoring with the robust, cloud-native infrastructure of Eagle Eye Networks is so important. Together, they…

June 10, 2025 Rachel Abrams