cam2web - Streaming camera to Web

cam2web

cam2web is an application, which allows streaming a camera to web as MJPEG stream. It supports number of platforms and cameras' APIs, like Windows - cameras supporting DirectShow API (different USB cameras, laptops' cameras, etc.); Linux - cameras supporting V4L2 API; Raspberry Pi - MMAL API to access Raspbery Pi's camera module.

The application is developed as an open source project, with its source code hosted on GitHub.

The latest available version to download is v1.0.0.

 

To get a quick overview, lets have a look at the Windows version of the cam2web application. Unlike Linux version, it provides a graphical user interface, so it is very easy to start playing with it. When the application runs, it provides a list of detected cameras supporting DirectShow API. Simply choose the one you like and click the "Start streaming" button. That is it - job done, your camera is now streamed to web.

Once the camera is being streamed, its MJPEG stream can be consumed by different applications. However, a quick test can be done using a web browser first, since cam2web provides web UI as well. Simply click the "Streaming ..." link on the application's main window and check it works in the browser of your choice.

Many cameras provide different configuration settings like brightness, contrast, saturation, etc. - those can be accessed from web UI when clicking "Settings" button.

Although viewing camera from a web browser seems to be a quick and easy option, it is not always the best. First, some browsers still fail supporting MJPEG streams. Second, it is simply better to use the software, which fits better the task and provides the necessary features. Here the choice is great - there are lots of applications supporting MJPEG streams, from simple viewers to advanced video surveillance packages. Computer Vision Sandbox can be tried as one of the options, which provides plug-ins as for MJPEG streams, as for continuously updating JPEGs (which cam2web also does). The steps to follow are well described in Adding cameras tutorial. And here are the URL formats to access cam2web camera:

  • MJPEG stream : http://ip:port/camera/mjpeg
  • JPEG snapshot : http://ip:port/camera/jpeg

The cam2web application provides number of settings, which allow changing default port to listen for incoming connections, quality level of provided JPEG images, frame rate of MJPEG stream (in case it must be limited to certain value), etc.

Although you can be very good in keeping secrets and never tell anyone you are streaming a camera showing your favourite fish tank, it might be still better to limit access to it, so only authorized users can view the camera. By default, everyone can do anything. However, using Access rights options it is possible to set who can view camera and who can change its settings. For example, you may allow only registered users to view it, and only administrators to configure it.

That is it with the quick start of using Windows version of cam2web application. More information is available on its GitHub page.

 

Few more words about different applications of cam2web, when using it together with Computer Vision Sandbox. As its already obvious, you can simply use CVSandbox to watch your cameras, combining them into views, so multiple cameras are played at the same time. Or it can be used to do video recording and organizing video archives. Adding on top CVSandbox Virtual Camera allows to do some other interesting things. For example, a cam2web streamer running on Raspberry Pi can be played in CVSandbox, where its pushed into virtual camera. This will allow other applications, like Skype for example, to get video from your Pi. Or it can be done the other way around - you can create a sandbox playing any video source you like, add some image/video processing and finally push it into virtual camera, which is then streamed by cam2web. This will allow viewing whatever video source you have with whatever video processing you did from the web! The point is: using different plug-ins available in Computer Vision Sandbox with combination of cam2web may create really interesting applications.