Change the PTS (presentation timestamp) of the input frames.
asetpts
works on audio frames, setpts
on video frames.
Accept in input an expression evaluated through the eval API, which can contain the following constants:
- FRAME_RATE
-
frame rate, only defined for constant frame-rate video
- PTS
-
the presentation timestamp in input
- N
-
the count of the input frame, starting from 0.
- NB_CONSUMED_SAMPLES
-
the number of consumed samples, not including the current frame (only audio)
- NB_SAMPLES
-
the number of samples in the current frame (only audio)
- SAMPLE_RATE
-
audio sample rate
- STARTPTS
-
the PTS of the first frame
- STARTT
-
the time in seconds of the first frame
- INTERLACED
-
tell if the current frame is interlaced
- T
-
the time in seconds of the current frame
- TB
-
the time base
- POS
-
original position in the file of the frame, or undefined if undefined for the current frame
- PREV_INPTS
-
previous input PTS
- PREV_INT
-
previous input time in seconds
- PREV_OUTPTS
-
previous output PTS
- PREV_OUTT
-
previous output time in seconds
- RTCTIME
-
wallclock (RTC) time in microseconds. This is deprecated, use time(0) instead.
- RTCSTART
-
wallclock (RTC) time at the start of the movie in microseconds
Examples
-
Start counting PTS from zero
setpts=PTS-STARTPTS
-
Apply fast motion effect:
setpts=0.5*PTS
-
Apply slow motion effect:
setpts=2.0*PTS
-
Set fixed rate of 25 frames per second:
setpts=N/(25*TB)
-
Set fixed rate 25 fps with some jitter:
setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
-
Apply an offset of 10 seconds to the input PTS:
setpts=PTS+10/TB
-
Generate timestamps from a "live source" and rebase onto the current timebase:
setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'