How to turn your USB camera into an Onvif IP webcam in C#

This description demonstrates in a really simple manner how the Onvif IP camera server works with USB camera and why it is useful. To implement a server you must have Ozeki Camera SDK installed, and a reference to OzekiSDK.dll should be added to your Visual Studio project.

Architecture of Onvif IP camera server for USB cameras

First let us clarify why it is needed to use an Onvif IP camera server instead of a simple application which can establish connection with an USB camera. The USB camera has just one stream, which means it can provide streaming to only one client at a time. Onvif IP camera server helps you to reach the image of the USB camera as a client by using RTSP (Real Time Streaming Protocol), and then transmitting it to multiple viewers in one time (Figure 1).

how to setup an onvif ip camera server for usb camera
Figure 1 - Architecture of Onvif IP camera server for USB cameras

Now the USB camera almost works as an Onvif IP camera apart from the limits of most USB cameras have e.g. no PTZ-control, unability to adjust the lighting, no authentication, etc. These problems can be partly resolved by building-in the Onvif IP camera server e.g. you need to authenticate to server in order to use the USB camera. The PTZ feature can be resolved by optical zooming and by installing a PTZ device to the camera, but it is not recommended because it's price is more expensive and the zoomed image quality will be worse than a new IP Camera's.

Where can you use it?

The price and image quality of the USB cameras is low, but their resolution and FPS (Frame Per Second) can satisfy the basic needs. The USB camera has only one stream and supports only one client. This property of USB camera regulated the usability because nowadays multi-client support is an absolute necessity. The Ozeki Camera SDK is a good solution because by using it you can develop Onvif IP camera server software for USB cameras with this SDK.

Related Pages


Below you can find the answers for the most frequently asked questions related to this topic:

  1. How can I get the URL of the USB camera?

    The USB camera has no URL. You need the URL of the servert to the connect to it.

  2. What's the difference among USB camera, RTSP camera and ONVIF camera?

    In case of USB cameras we do not need camera url and some functions such as moving, zooming, etc are not available. In case of RTSP cameras and ONVIF cameras there are more possibilities to adjust the image. The difference between the RTSP camera and the ONVIF camera is the following: the RTSP camera has only one stream but the ONVIF camera can have multiple streams at a time.

More information