FFmpeg 8.1.2
Since* 4.4
#

Set PTS and DTS in packets.

It accepts the following parameters:

ts, pts, dts

Set expressions for PTS, DTS or both.

duration

Set expression for duration.

time_base

Set output time base.

prescale

Set whether to convert time fields to user-set output time base before evaluation of expressions. Defaults to 0.

The expressions are evaluated through the eval API and can contain the following constants:

N

The count of the input packet. Starting from 0.

TS

The demux timestamp in input in case of ts or dts option or presentation timestamp in case of pts option.

POS

The original position in the file of the packet, or undefined if undefined for the current packet

DTS

The demux timestamp in input.

PTS

The presentation timestamp in input.

DURATION

The duration in input.

STARTDTS

The DTS of the first packet.

STARTPTS

The PTS of the first packet.

PREV_INDTS

The previous input DTS.

PREV_INPTS

The previous input PTS.

PREV_INDURATION

The previous input duration.

PREV_OUTDTS

The previous output DTS.

PREV_OUTPTS

The previous output PTS.

PREV_OUTDURATION

The previous output duration.

NEXT_DTS

The next input DTS.

NEXT_PTS

The next input PTS.

NEXT_DURATION

The next input duration.

TB

The timebase in which time fields are denominated. The user-set output timebase if prescale is enabled, else the input timebase.

TB_OUT

The output timebase.

SR

The sample rate of stream packet belongs.

NOPTS

The AV_NOPTS_VALUE constant.

For example, to set PTS equal to DTS (not recommended if B-frames are involved):

ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv