Skip to content

Packet timestamp rewriter

Register name used to load filter: restamp
This filter is not checked during graph resolution and needs explicit loading.
Filters of this class can connect to each-other.

This filter rewrites timing (offsets and rate) of packets.

The delays (global or per stream class) can be either positive (stream presented later) or negative (stream presented sooner).

The specified fps can be either 0, positive or negative.

  • if 0 or if the stream is audio, stream rate is not modified.
  • otherwise if negative, stream rate is multiplied by -fps.num/fps.den.
  • otherwise if positive and the stream is not video, stream rate is not modified.
  • otherwise (video PID), constant frame rate is assumed and:

    • if rawv=no, video frame rate is changed to the specified rate (speed-up or slow-down).
    • if rawv=force, input video stream is decoded and video frames are dropped/copied to match the new rate.
    • if rawv=dyn, input video stream is decoded if not all-intra and video frames are dropped/copied to match the new rate.

Note: frames are simply copied or dropped with no motion compensation.

When align is not 0, if the difference between two consecutive timestamps is greater than the specified threshold, the new timestamp
is set to the last computed timestamp plus the minimum packet duration for the stream.

Options

fps (frac, default: 0/1): target fps

delay (frac, default: 0/1, updatable): delay to add to all streams

delay_v (frac, default: 0/1, updatable): delay to add to video streams

delay_a (frac, default: 0/1, updatable): delay to add to audio streams

delay_t (frac, default: 0/1, updatable): delay to add to text streams

delay_o (frac, default: 0/1, updatable): delay to add to other streams

rawv (enum, default: no): copy video frames

  • no: no raw frame copy/drop
  • force: force decoding all video streams
  • dyn: decoding video streams if not all intra

tsinit (lfrac, default: -1/1): initial timestamp to resync to, negative values disables resync

align (uint, default: 0): timestamp alignment threshold (0 disables alignment) - see filter help

reorder (bool, default: false): reorder input packets by CTS (resulting PID may fail decoding)

Was this page helpful?