SrtConnectionInputNode.nudge() method

Nudges the timestamps of one source’s program on this connection.

nudge is an ABSOLUTE target offset, in milliseconds, from the source’s own timestamps — not an increment: nudging 500 then 200 leaves the program 200ms ahead of the source, and nudging 0 removes the offset. The engine moves the output timestamps to the target gradually rather than jumping.

The nudge addresses that program’s timestamp corrector, which exists only once the source’s media has started arriving. Before then the returned Promise rejects with a TimestampNudgeError whose reason is "not_ready" ("nudge not ready: no timestamp corrector for …​ yet"); the node is not affected, so retry shortly. The corrector is created on the same context change that reports the source to you, so a nudge sent from that callback can still be "not_ready".

With no answer from the engine within 10 seconds (an engine older than this SDK never answers) it rejects with reason "timeout"; the nudge may still have been applied.

Signature:

nudge(sourceName: string, programNumber: number, nudge: number): Promise<void>;

Parameters

Parameter Type Description

sourceName

string

programNumber

number

nudge

number

Returns:

Promise<void>

Resolves once the engine has applied the nudge. Ignoring the Promise is safe: a failure is then only logged (under NODE_DEBUG=norsk), never an unhandled rejection.