[FFmpeg-user] 'setts' filter questions

Mark Filipak markfilipak.noreply1 at gmail.com
Sun Feb 6 07:30:31 EET 2022

The subject is the 'setts' filter. The text below is my compact synopsis of section 2.27 of the 
bitstream filters.

Below the text, please find 5 [question]s. Those are my questions, and I've been pondering them for 
a long time, but any comments are very welcome of course.

Thanks for help -- much appreciated,

2.27  setts -- Set target DTSs or PTSs or both.
'setts=dts=?'         ...no defaults.
'setts=pts=?'         ...no defaults.
'setts=ts?'           ...alias for 'setts=pts=?'. [question 1]
'setts=dts=?:pts=?'   ...no defaults.
            :     :
            :     eval API expression for target PTSs (plus the Factors below) [question 2]
            eval API expression for target DTSs (plus the Factors below) [question 2]

Factors: For every 'current' frame, 'N', compute DTS and/or PTS using the following factors:
'N'             ...the frame number (i.e. 0 1 2..).
'TB'            ...the current TB within the filter chain.
'STARTDTS'      ...the DTS of source frame 0.
'PREV_INDTS'    ...the DTS of source frame N-1.
'PREV_OUTDTS'   ...the DTS of target frame N-1.
'DTS'           ...the DTS of source frame N.
'STARTPTS'      ...the PTS of source frame 0.
'PREV_INPTS'    ...the PTS of source frame N-1.
'PREV_OUTPTS'   ...the PTS of target frame N-1.
'PTS'           ...the PTS of source frame N.
'TS'            ...in 'dts=', the DTS of the current frame; in 'pts=', the PTS of the current frame.
'POS'           ...the original position in the file of the packet, or 'undefined' if undefined for
                    the current packet. [question 3]
'SR'            ...The sample rate of stream packet belongs. [question 4]
'NOPTS'         ...The AV_NOPTS_VALUE constant. [question 5]

[question 1] Is 'ts=' simply an alias for 'pts='?

[question 2] Regarding "The expressions are evaluated through the eval API", does that mean that all 
of these: 'abs' 'acos' 'asin' .. 'time' 'trunc' 'while', are available? Or does it simply mean that 
the expressions are evaluated by the eval API, but the eval AVI built-in factors are not necessarily 

[question 3] Regarding 'POS', is it some sort of packet index? Or sector number for disc-based 
media? Or byte offset? Or something else? And of what utility is it?

[question 4] Regarding 'SR', besides referring to 'sample rate', what is it? Is it source fps? Or is 
it something else?

[question 5] What does "AV_NOPTS_VALUE" do? Is it really 0x8000000000000000? What are the 
implications? And what about this (from 2017): https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/55?

More information about the ffmpeg-user mailing list