Skip to content

DVR Cross Replication

A reliable way not to lose a DVR archive is to use two servers that will record and store it. Both servers must be able to access the source of live streams and to obtain the recorded archive from each other. We call this cross-replication.

During normal replication, which is described in the Replication section, only the primary server connects to the stream source, and the secondary can only pick up the archive from the primary one. In cross-replication, both the primary and secondary servers can access the source.

Flussonic's cross-replication allows you to restore a DVR archive after one of the servers has been temporarily unavailable. If one of the servers becomes unavailable, another one continues to record the archive, accessing the source directly. After the offline server recovers, the archive on it will automatically obtain the missing parts from another server.

Example

Let's configure replication of a stream named example on two Flussonic servers. You should configure on both servers:

  • ingest from the source (input udp:// in the example below)
  • DVR on both servers (dvr /storage 3d replicate)
  • the Flussonic server for replication (input m4f://) on each other server

We will use flussonic_1.myhosting.com as the main server, and flussonic_2.myhosting.com as a replicating server.

Stream configuration on flussonic_1.myhosting.com (main server):

stream example_stream {
  input udp://224.1.2.3:1234;
  input m4f://flussonic_2.myhosting.com/example;
  dvr /storage 3d replicate;
}

Stream configuration onflussonic_2.myhosting.com (replicating server):

stream example_stream {
  input m4f://flussonic_1.myhosting.com/example;
  input udp://224.1.2.3:1234;
  dvr /storage 3d replicate;
}

Replication works in three modes: normal, emergency, and recovery mode. Let's describe these modes in relation to the configuration example above.

Normal mode

  • The main server (flussonic_1) captures the live stream from the source via UDP and writes an archive (pull).
  • The replicating server (flussonic_2) picks up live stream and archive from flussonic_1 via M4F (live + replication).

Emergency mode

  • The main server (flussonic_1) has gone offline.
  • The replicating server (flussonic_2) captures the live stream from a source via UDP and writes an archive (failover pull).

Recovery mode

  • The main server (flussonic_1) has recovered and picks up the live stream from the source via UDP again.
  • The main server (flussonic_1) picks up a part of the archive that was written by the flussonic_2 server when flussonic_1 was offline (replication).

M4F protocol

We recommend using Flussonic's internal protocol M4F to get the stream in case of transmitting video between Flussonic servers. You can read more about the benefits of M4F protocol here.