Skip to content

Archive (DVR) Configuration

With Flussonic Media Server, you can record video streams and work with video archives. We call this functionality DVR (digital video recording).

DVR archive settings in Flussonic Media Server are individual for each stream.

To start recording a stream, define where the archive will be stored. Then, optionally, define other parameters such as limitations on the archive.

Note

You can specify all possible settings in the configuration file. For a quicker way to configure Flussonic Media Server, use the web interface (UI) – it supports all frequently used settings.

On this page:

Where you can store archives

With Flussonic Media Server you can store video archives:

Setting up archive in the UI

After you have added a stream, you can set up how it will be recorded and stored.

Flussonic DVR

To specify stream recording settings:

  1. Open the Flussonic Media Server's web interface.
  2. In Media, click a stream name under Streams, then go to the DVR tab.
  3. Specify:

  4. Path – a local directory on the server where the archive will be stored. For example, /storage.

    In practice, for a number of channels with different names, you can specify exactly the same path on the disk. Flussonic creates subdirectories for each stream, so the archives will be stored each in a separate subdirectory. Learn more in Path to archives on the disk.

    Important. If you edit DVR settings and change the DVR path, Flussonic will not delete the previously used directory from the disk, so that old recordings will still be found there. You can delete them manually.

    To make a copy of a stream's archive part by part, use the copy option. For example:

    dvr /storage copy=/opt/movies;

  5. Saved duration (optional) – how many last hours or days to store. For example, if you set 30 days, then a part of the recording older than 30 days will be removed from the archive.

    To change the unit, click it until the necessary unit appears. You can choose from hours and days.

  6. Allowed absolute disk usage (optional) – the maximum disk space usage. For example, 10 Gigabytes.

    To change the unit, click it until the necessary unit appears. You can choose from Gigabytes, Megabytes, and Kilobytes.

    DVR settings in UI

Also, you can enable replication.

After you set up recording, a green status bar in the web interface appears: DVR green status bar

Danger

Renaming a stream deletes its video archive.

Setting up DVR in the configuration file

To store the recording of a stream on the server, add the dvr parameter to the Flussonic configuration file (/etc/flussonic/flussonic.conf) for each stream that you want to record.

For example:


stream channel {
  url fake://fake;
}
stream channel1 {
  url tshttp://localhost:80/channel/mpegts;
  dvr /storage;
}
stream channel2 {
  url tshttp://localhost:80/channel/mpegts;
  dvr swift://user=test:tester&password=testing@swift:8080/test;
}
stream channel3 {
  url tshttp://localhost:80/channel/mpegts;
  dvr s3://minioadmin:minioadmin@minio:9001/test;
}

In this configuration, the stream channel1 will be stored in /storage/channel1/, and the stream channel2 will be stored in the Swift cloud storage.

Important. If you edit DVR settings and change the DVR path, Flussonic will not delete the previously used directory, so that old recordings will still be found there. You can delete them manually.

Archive size

Use these parameters to limit the size of an archive:

  • 2d
    Archive depth (hour or days). Example: 2d, 10h. We don't recommend specifying less than 2 hours.

  • 90%
    Maximum disk consumption (percent). The default value is 97%. You should never use 100% because an average file system cannot operate when it is completely full.

Danger

We strongly recommend that you specify identical values for all streams, if you record more than one stream. For example, 90% for each stream. Otherwise, conflicts might occur and some data might be lost.

  • 10G
    Maximum disk consumption in Gigabytes (G), Megabytes (M), or Kilobytes (K). You can calculate that 1-Megabit stream consumes 10 Gigabytes per day.

Recording schedule

  • schedule=8:00-16:00
    The parameter schedule allows you to set a schedule for recording in the form of time intervals. The time is specified in UTC in hours and minutes (optional). The interval can go over midnight as follows: 22-1:30. Schedule can contain multiple intervals that should be separated by a comma: 8:00-16:00,22-1:30.

Example of DVR configuration


stream channel0 {
  url fake://fake;
  dvr /storage 6h 90% 10G schedule=8:00-16:00;
  cache /mount/ssd1 3d 50G;
}

Starting from version 21.05 of Flussonic you can enable it via Flussonic UI.

To set the recording schedule via UI:

  1. Open the Flussonic Media Server's web interface.
  2. On the main Media page choose a stream from the Streams list and click on it:

Streams list

  1. Go to DVR tab where you will see the Schedule section. Then click Add schedule range:

DVR tab

  1. Enter you time interval(s) and click Save:

Time schedule

You have successfully added a time schedule for the DVR.

Archive replication

If you have a number of Flussonic Media Servers, you can enable the Replication option to turn on replication of the DVR archive.

Caution

The Replication setting is specified on a restreaming server only. To make replication work, specify a remote Flussonic Media Server as the source server for your restreaming server.

Learn more: * Cluster restreaming * DVR replication

To turn on replication via the configuration file, use the replicate option:


stream channel1 {
  url tshttp://vlc:9090/;
  dvr /storage replicate;
}

To turn on replication via the web interface:

  1. In Media, click a stream name under Streams, then go to the DVR tab.
  2. Click enable under Replication.

Archive caching on SSD

Having a cache of an archive on an SSD disk improves user experience a lot - with cache, users can quickly rewind or fast forward the video. You can easily make Flussonic copy a recording to SSD.

Caution

For DVR cache, do not use SSD partitions that were mounted with the option noatime.

To turn on SSD caching via the web interface:

  1. In Media, click a stream name under Streams, then go to the DVR tab.
  2. Specify the following under SSD disk cache on the DVR tab:

  3. Path - a directory on an SSD disk where the data will be cached.

  4. Optionally, you can limit the size of cached data (in Gigabytes, Megabytes or Kilobytes) and specify how many hours or days to store data. To change the unit, just click it until the necessary unit appears.

To turn on SSD caching via the configuration file, use the cache parameter:


stream channel2 {
  url tshttp://vlc:9090/;
  dvr /storage;
  cache /storage/ssd1 3d 50G;
}

Writing an archive to WebDAV

You can use the WebDAV file system for storing DVR archives.

To set up a WebDAV storage, add a line with the address of WebDAV to the stream settings:


stream channel5 {
  url fake://fake;
  dvr http://nginx:4201/webdav;
}

Flussonic supports the economical way of copying video to WebDAV by parts with the copy option:


stream channel6 {
  url fake://fake;
  dvr /storage copy=http://nginx:4201/webdav;
}

Copying streams in chunks to another storage

The copy option helps significantly reduce the number of network requests to a cloud storage. Flussonic writes a stream to the specified storage segment by segment. You can set up Flussonic to copy recorded segments in bulk from a temporary directory to a remote storage.

How copying works

The copy operation takes place during the time when a stream is being recorded. Video data is accumulated in the specified temporary directory and then once an hour all recorded segments are copied (moved) to another location. The data in the temporary directory is deleted after each copy operation (that is, once an hour).

The specified limits (such as archive depth) are applied not to the temporary directory, but to the destination directory.

Warning

Make sure the temporary directory has enough place for storing for at least 2 hours all the streams that are written to it.

To copy a recording of a stream to a cloud:

In the configuration file, specify the copy option like this:


stream chan7 {
  url fake://fake;
  dvr /storage copy=s3://minioadmin:minioadmin@minio:9001/test 10G;
}

The stream will be recorded to /storage and copied in parts once an hour to S3.

To copy a recording of a stream to a local storage:


stream chan8 {
  url fake://fake;
  dvr /storage copy=/opt/movies 10G;
}

The stream will be recorded to /storage and moved in parts once an hour to /opt/movies.

Path to archives on the disk

For each stream, Flussonic creates a subdirectory under the directory that you specified as the path to video archive. The subdirectory is given a name which is identical to the stream name.

For example, lets configure a stream my_stream to be stored in /storage:


stream my_stream {
  url fake://fake;
  dvr /storage;
}

Then Flussonic will create a directory /storage/my_stream to save the recording of my_stream.