User Tools

Site Tools


change_segment_clean_up_period

Change segment clean up period

Jun 2017


First packager I setup only had a small area for storage of segments (around 8GB) and the drive would constantly fill up. There are a couple of processes that run, the first creates new segments, the second cleans up old ones (depending on DVR period). To speed up the clean up process (so that no so many old segments are kept) I had to make a change to the configuration file /opt/mfvp/packaging-dvr-recorder/etc/packaging-dvr-recorder.json

Open this file and look for the line “periodDuration”:3600, change period duration from 3600 to 360. This sets the DVR to 15 minutes.

The tsPartDuration parameter is the duration of the chunk the dvr recorder will write. By default, the value is 2000 ms. Thus, every 2s, the dvr-recorder will write a chunk of 2s. You can change this parameter in order to decrease the NAS loading (i.e 10000ms). Increasing the value of this parameter will delay the live output stream. So, if you change the value from 2s to 10s. The live will be delayed of 8s.

The periodDuration parameter is the internal period that will be used for DVR. This rule must be respected: period duration ⇐ (DVR duration /3).

<sxh [py][; options for SyntaxHighlighter]> {

  "serverId": "server_0",
  "dataBase":{
      "type":"mongo",
      "access": {
          "url": "mongodb://127.0.0.1:27017/halodb?maxPoolSize=2"
          }
      },
  "fileAccess" : {
       "mountFolder": "/opt/mfvp/mnt"
  },
  "dvrManager" :{
      "debug":false,
      "recorder":
      {
          "tsPartDuration":2000,
          "periodDuration":360,
          "deletionSpeed":1.2
      },
      "statistics": {
          "redisSocketPath": {
              "port": 6381,
              "host": "127.0.0.1"
              }
      },
      "log":
      {
              "traces":"/var/log/mfvp/packaging-dvr-recorder/private",
      "dump":"/var/log/mfvp/packaging-dvr-recorder/private",
      "apiAccessLogs":
              {
                      "period":3600,
                      "count":169,
                      "access":"/var/log/mfvp/packaging-dvr-recorder"
              }
      }
   },
  "interface": {
      "http": {
      "port": 8051
      }
  },
  "alarm": {
      "redisSocket": "/var/lib/envivio/alarm/alarm.sock"
  }

} </sxh>

change_segment_clean_up_period.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1