Skip to main content

Shift Timestamps

The hook shift_ts is designed to shift timestamps by applying a specified offset in seconds. The hook can shift either the origin or received timestamp of each sample, based on the configuration.

Implementation​

The source code of the hook is available here: https://github.com/VILLASframework/node/blob/master/lib/hooks/shift_ts.cpp

Configuration​

mode
string
Enum: "origin" "ts_received"

The timestamp field which should be adjusted by the offset setting.

offset
required
number

The offset in seconds which is added to the timestamp field of each processed sample.

enabled
boolean
Default: true

An optional field which can be used to disable a hook.

priority
integer
Default: 99

The priority of this hook which determines the order in which hooks are executed. Hooks with a lwoer priority are executed before ones with a higher priority.

If no priority is configured, hooks are executed in the order they are configured in the configuration file.

{
  • "mode": "origin",
  • "offset": 0,
  • "enabled": true,
  • "priority": 99
}

Example​

node/etc/examples/hooks/shift_ts.conf
@include "hook-nodes.conf"

paths = (
{
in = "signal_node"
out = "file_node"

hooks = (
{
type = "shift_ts"

mode = "origin"
offset = 5.5
}
)
}
)