Streaming Cameras


Screenshot of Streaming Cameras sample application Vizzion's Streaming Cameras sample application

Vizzion's Streaming Cameras sample application illustrates a number of considerations when developing an application that displays streaming video, including finding streaming cameras, selecting a streaming format, displaying streams, and refreshing streams.

The full sample application source code is available for download.

Note: This sample application demonstrates roadside camera streams and does not apply to Drive Streams.

Finding Streaming Cameras

Vizzion’s Camera API allows cameras to be found within a specified latitude/longitude box, a specified radius, or along a specified route.

In this sample application, the MapQuest geocoding API is used to retrieve latitude/longitude coordinates for a given address, and then the GetCameraStream method is used to return all in-service streaming cameras near the location.

Image of cameras nearby a given address Three cameras near a given address

Non-streaming cameras are also shown on the map but are otherwise ignored in this sample application. Applications requiring only streaming cameras can use the GetCameraInBox method with the “streaming only” option (option 1).

Selecting a Streaming Format

Most streaming cameras are available in multiple formats, as enumerated by the Camera API in the StreamContainer, StreamCoding, StreamContainer2, StreamCoding2,StreamContainer3, and StreamCoding3 fields. Different media players (VLC, Flowplayer, Video.js, JW Player etc.) support different formats.

In this sample application, VLC media player is used. VLC supports a wide variety of formats out of the box, however this sample application demonstrates how to restrict the streaming format to a single type in case the player does not support all of them.

Displaying Streams

To avoid image distortion and black bars, this sample application shows how to resize the media player to match the aspect ratio of the stream (see Display Aspect Ratio). In addition to the camera name, the camera copyright notice and viewpoint (see Viewpoint Display) are all displayed alongside the current image.

A camera stream displayed in the correct aspect ratio, alongside related camera data A camera stream displayed in the correct aspect ratio, alongside related camera data

Many workstations are easily overloaded by multiple simultaneous video streams, resulting in slower load times and poor playback. This sample application allows the number of simultaneous streams to be varied, and demonstrates how to detect slowing load times to warn the user when the number of simultaneous streams is too high.

Refreshing Streams

Not all camera streams will play indefinitely and some will need to be periodically restarted. This sample application shows how to use the StreamUpdateFrequency field to restart streams as needed.

Downloads

Download Details
Source code Requires Visual Studio 2012 or later

Vizzion Confidential and Proprietary