Flussonic Media Server documentation

Adding IP Cameras

Adding IP Camera Anchor Anchor x2

This article will explain how to add an IP camera to Flussonic and show the video from this camera on your site.

First of all, install Flussonic.

RTSP URL Anchor Anchor x2

After you install Flussonic, it's necessary to find the RTSP URL of your camera. Usually you can find it in the web interface of your IP camera. Pay attention to the following points:

  • The URL must contain login and password
  • You need the IP address of the camera, which is accessible from Flussonic.

Normally RTSP URL looks like this: rtsp://admin:4321@192.168.45.32/cam/realmonitor?channel=1&subtype=1. It's important that usually there's some path after the IP address. Your camera won’t stream without it.

Some cameras include a login and password in the URL, and then it takes the form of rtsp://192.168.0.213/user=admin_password=tlJatbo6_channel=1_stream=0.sdp?real_stream.

Sometimes when the camera is in a closed network, it's necessary to forward ports on a router. In this case, the IP address and port of the web interface are not equal to the IP address and port of your camera. Some cameras handle this situation incorrectly, and may offer you an RTSP URL that contains an internal IP address. In this case, it's necessary to replace the address and port with external ones.

So, please note that only the IP address of the camera isn't enough, you must specify a correct and accessible RTSP URL.

Adding a new stream Anchor Anchor x2

Now you need to create a new stream in Flussonic.

If you are editing configuration file, you should add:

stream cam1 {
  url rtsp://admin:4321@192.168.45.32/cam/realmonitor?channel=1&subtype=1;
}

After that:

/etc/init.d/flussonic reload

and Flussonic web interface will show this camera. If the URL entered correctly, the web interface will show a lifetime (time, which constantly increases) . After some time, a bit rate of the stream will appear.

Video output to a website Anchor Anchor x2

Flussonic supports many different protocols that allow to get a video. There no one universal was to display video on all types of devices, so to simplify user's life, for each stream we generate an HTML page with a corresponding video player.

The recommended way to add video to a website is by adding iframe to the HTML code of your website:

<iframe src="http://flussonic-ip/cam1/embed.html" frameborder="0" style="width: 640px; height: 480px"></iframe>

After adding this line, you will immediately get a video player on the page where you added it. This video will be directly streamed from Flussonic, that is, it by no means passes through the site's hosting itself.

Adding JPEG thumbnails Anchor Anchor x2

In this configuration any user will see only black player with the Play button. To show the last thumbnail of the stream, you need to turn on the option thumbnails to obtain thumbnails:

stream cam1 {
  url rtsp://admin:4321@192.168.45.32/cam/realmonitor?channel=1&subtype=1;
  thumbnails;
}

After that the fresh thumbnails will be available at URL like this: http://flussonic-ip/cam1/preview.jpg, and users will see this thumbnail on the site alongside with the Play button.

Adding the multi-bitrate feature Anchor Anchor x2

A modern IP camera can output multiple streams and this feature can be used to provide multi-bitrate streams to video players:

stream cam1 {
  url rtsp://admin:4321@192.168.45.32/cam/realmonitor?channel=1&subtype=1 mbr=1 rtp=udp;
  url rtsp://admin:4321@192.168.45.32/cam/realmonitor?channel=2&subtype=1 mbr=1 rtp=udp;
  thumbnails;
}

Note the rtp=udp option . In general, this option is recommended for any problems with the quality of video capturing on IP cameras.

If your camera supports two or more profiles, it's necessary to add a second RTSP URL to the second address (in the example above), so players will be able to automatically select an appropriate video quality.

Adding old MPEG-4 cameras Anchor Anchor x2

We do not recommend using old MPEG-4-only cameras.