Flussonic Media Server documentation

Archive (DVR) Configuration

About DVR archive configuration Anchor Anchor x2

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 Anchor Anchor x2

With Flussonic Media Server you can store video archives:

Setting up archive in the UI Anchor Anchor x2

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

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:
  • 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.

    To make a copy of a stream's archive part by part, use the copy option. For example: /storage copy=/opt/movies

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

  • 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 of the archive and put the archive in cache.

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

Setting up archive in the configuration file Anchor Anchor x2

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 channel1 {
  url tshttp://vlc:9090/;
  dvr /storage;
}

stream channel2 {
  url tshttp://vlc:9090/;
  dvr swift://user=office:max&password=secretpass&@prod1.local:8080/movies;
}

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

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 95%. You should never use 100% because an average file system cannot operate when it is completely full.

    Warning. 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-mbit stream produces 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 optionally with minutes. The interval can overlap midnight: 22-1:30. A schedule can contain multiple intervals, separated by a comma: 8:00-16:00,22-1:30.

An example of a dvr setting is:

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

Archive replication Anchor Anchor x2

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

Note: 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 parameter:

stream channel0 {
  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 Anchor Anchor x2

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.

To turn on SSD caching via the web interface:

Specify the following under SSD disk cache on the DVR tab:

  • Path - a directory on an SSD disk where the data will be cached.
  • 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 channel0 {
  url tshttp://vlc:9090/;
  dvr /storage;
  cache /mount/ssd1 3d 50G;
}

Copying streams in chunks to another storage Anchor Anchor x2

Flussonic writes a stream to the specified storage segment by segment. You can set up Flussonic to copy recorded segments in bulk to some other place. This place can be another local directory or 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 local directory and then once an hour all recorded segments are copied to another location.

To copy a recording of a stream to a cloud:

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

stream chan0 {
  dvr /storage copy=s3://AWS_ACCESS_ID:AWS_SECRET_KEY@s3.amazonaws.com/mybucket 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 chan0 {
  dvr /storage copy=copy=/opt/movies 10G;
}

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

Path to archives on the disk Anchor Anchor x2

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 tshttp://vlc:9090/;
  dvr /storage;
}

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

Turning off indexing to speed up Flussonic Anchor Anchor x2

This setting applies to services that distribute UGC (User-generated content) in the situations:
  • If you have a lot of user-published streams, and need to delete old data.
  • If you need to store all archives permanently.

To quickly determine which archives and which data in them to delete, Flussonic creates an index file where it lists streams and their archive depths. Purging of archive data takes place at the start of Flussonic and it can take a long time in case of many streams. To make Flussonic start quicker, you can disable indexing. Then old data will be deleted individually for each archive when the archive is accessed.

In another situation where you need to store all recorded data, there is just no point in such indexing.

To disable creating the DVR index file, add the no_index option:

live mylive {
  dvr /storage no_index;
}

For DVR in a cloud (S3, Swift), this configuration allows different Flussonic servers to record the stream to a single cloud storage (when you migrate a stream from one server to another).