Skip to content

Archive (DVR) Configuration

You can configure DVR settings globally or individually for each stream. In this chapter we will describe individual stream DVR configuration. You can read about global DVR configuration here.

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:

    • Global DVR config (optionally) – select a global DVR configuration to inherit its settings. You can further override some settings for the stream.
    • 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;

    • Archive depth and Maximum disk consumption (optional) – archive size limitations. Learn more in Archive size.
    • SSD disk cache — a directory on an SSD disk where the data will be cached. Learn more in Archive caching on SSD.
    • DVR replicate — enable archive replication.
    • Schedule — add one or more time periods to record the stream by schedule. Learn more in Recording schedule.

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 {
  input fake://fake;
}
stream channel1 {
  input tshttp://localhost:80/channel/mpegts;
  dvr /storage;
}
stream channel2 {
  input tshttp://localhost:80/channel/mpegts;
  dvr swift://user=test:tester&password=testing@swift:8080/test;
}
stream channel3 {
  input 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 configuration file parameters to limit the size of an archive:

  • 2d
    Archive depth — a period (in seconds, minutes, hours, days, or weeks) back from the current moment during which the archive is stored. As time goes, the parts of the recording which are older than the archive depth are being overridden by the later parts. 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.

    To set the archive size limitations via UI:

  • Open the Flussonic Media Server's web interface.

  • On the main Media page choose a stream from the Streams list and click on it.
  • Go to DVR tab and fill the fields Maximum disk consumption (in percent and in bytes) and Archive depth.

Note

If you delete a stream from Flussonic configuration, the DVR archive files of this stream will be deleted from the disk as well. However, the files are not deleted immediately – an hour of recording is deleted once an hour, until all the archive is deleted. This is done to lower the risk of errors and to avoid disk overload during the archive deletion.

Recording schedule

Use the following parameter to set the recording schedule via the configuration file:

  • 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 {
  input 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.

Replication means that a DVR archive is stored on two (or more) Flussonic servers. It can be used for reliability or for broadcasting with a time shift.

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:

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


stream channel1 {
  input 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 {
  input 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 {
  input 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 {
  input 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 {
  input 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 {
  input 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 {
  input fake://fake;
  dvr /storage;
}

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

Important information

  • We do not recommend to use NAS (NFS, NAS and other popular protocols) for DVR recording. This is not a very good decision, since NAS is usually slower then local storage. One should better use a local hard disks, optionally, adding an SSD cache.
  • It isn't an unacceptable configuration when several servers simultaneously read and write from the same network storage, this can lead to data loss (!). Please contact the support team to get up-to-date information on organizing a distributed DVR service.