Flussonic Media Server documentation

Adding IP Camera

Adding IP Camera Anchor Anchor x2

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

First of all, you should install Flussonic

RTSP URL Anchor Anchor x2

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

  • URL must contain login and password;
  • you need the IP address of the camera, which is available for 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, IP and port of the web interface are not equal to IP and port of your camera. Some cameras handle this incorrectly, and may offer you RTSP URL that contain an internal IP address. In this case, it's necessary to fix the address and port.

It's important to understand, only address of the camera isn't enough, you must find 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. Common ways to display video on all devices doesn't exist, so to simplify user's life, for each stream we generate HTML page with a corresponding video player.

Recommended way to add video to website: adding iframe to HTML code of your site.

<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 this page. This video will be directly streamed from Flussonic, that is, it's by no means passes through the site itself.

Adding thumbnails Anchor Anchor x2

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

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

For this option you’ll need an extra flussonic-ffmpeg package flussonic-ffmpeg (deb or rpm package that is located on our linux repositories)

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

Adding multibitrate Anchor Anchor x2

Modern IP camera can output multiple streams and this feature can be used to provide multibitrate 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 mpeg4 cameras Anchor Anchor x2

If you have old mpeg4 only camera, add it with transcoder:

stream cam1 {
  publish_enabled;
  url "ffmpeg -i rtsp://admin:4321@192.168.45.32/mpeg4/media.amp -vcodec libx264 -vb 800k -preset fast -an -f mpegts http://localhost:8080/cam1/mpegts"
}