FFmpeg
setpts.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010 Stefano Sabatini
3  * Copyright (c) 2008 Victor Paesa
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * video presentation timestamp (PTS) modification filter
25  */
26 
27 #include "config_components.h"
28 
29 #include <inttypes.h>
30 
31 #include "libavutil/eval.h"
32 #include "libavutil/internal.h"
33 #include "libavutil/mathematics.h"
34 #include "libavutil/opt.h"
35 #include "libavutil/time.h"
36 #include "audio.h"
37 #include "avfilter.h"
38 #include "filters.h"
39 #include "video.h"
40 
41 static const char *const var_names[] = {
42  "FRAME_RATE", ///< defined only for constant frame-rate video
43  "INTERLACED", ///< tell if the current frame is interlaced
44  "N", ///< frame / sample number (starting at zero)
45  "NB_CONSUMED_SAMPLES", ///< number of samples consumed by the filter (only audio)
46  "NB_SAMPLES", ///< number of samples in the current frame (only audio)
47 #if FF_API_FRAME_PKT
48  "POS", ///< original position in the file of the frame
49 #endif
50  "PREV_INPTS", ///< previous input PTS
51  "PREV_INT", ///< previous input time in seconds
52  "PREV_OUTPTS", ///< previous output PTS
53  "PREV_OUTT", ///< previous output time in seconds
54  "PTS", ///< original pts in the file of the frame
55  "SAMPLE_RATE", ///< sample rate (only audio)
56  "STARTPTS", ///< PTS at start of movie
57  "STARTT", ///< time at start of movie
58  "T", ///< original time in the file of the frame
59  "TB", ///< timebase
60  "RTCTIME", ///< wallclock (RTC) time in micro seconds
61  "RTCSTART", ///< wallclock (RTC) time at the start of the movie in micro seconds
62  "S", // Number of samples in the current frame
63  "SR", // Audio sample rate
64  "FR", ///< defined only for constant frame-rate video
65  "T_CHANGE", ///< time of first frame after latest command was applied
66  NULL
67 };
68 
69 enum var_name {
75 #if FF_API_FRAME_PKT
76  VAR_POS,
77 #endif
95 };
96 
97 typedef struct SetPTSContext {
98  const AVClass *class;
99  char *expr_str;
104 } SetPTSContext;
105 
106 #define V(name_) \
107  setpts->var_values[VAR_##name_]
108 
110 {
111  SetPTSContext *setpts = ctx->priv;
112  int ret;
113 
114  if ((ret = av_expr_parse(&setpts->expr, setpts->expr_str,
115  var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
116  av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n", setpts->expr_str);
117  return ret;
118  }
119 
120  V(N) = 0.0;
121  V(S) = 0.0;
122  V(PREV_INPTS) = NAN;
123  V(PREV_INT) = NAN;
124  V(PREV_OUTPTS) = NAN;
125  V(PREV_OUTT) = NAN;
126  V(STARTPTS) = NAN;
127  V(STARTT) = NAN;
128  V(T_CHANGE) = NAN;
129  return 0;
130 }
131 
133 {
135  AVFilterContext *ctx = inlink->dst;
136  SetPTSContext *setpts = ctx->priv;
137 
138  setpts->type = inlink->type;
139  V(TB) = av_q2d(inlink->time_base);
140  V(RTCSTART) = av_gettime();
141 
142  V(SR) = V(SAMPLE_RATE) =
143  setpts->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
144 
145  V(FRAME_RATE) = V(FR) =
146  l->frame_rate.num && l->frame_rate.den ?
147  av_q2d(l->frame_rate) : NAN;
148 
149  av_log(inlink->src, AV_LOG_VERBOSE, "TB:%f FRAME_RATE:%f SAMPLE_RATE:%f\n",
150  V(TB), V(FRAME_RATE), V(SAMPLE_RATE));
151  return 0;
152 }
153 
154 static int config_output_video(AVFilterLink *outlink)
155 {
156  FilterLink *l = ff_filter_link(outlink);
157  SetPTSContext *s = outlink->src->priv;
158 
159  if (s->strip_fps)
160  l->frame_rate = (AVRational){ 1, 0 };
161 
162  return 0;
163 }
164 
165 #define BUF_SIZE 64
166 
167 static inline char *double2int64str(char *buf, double v)
168 {
169  if (isnan(v)) snprintf(buf, BUF_SIZE, "nan");
170  else snprintf(buf, BUF_SIZE, "%"PRId64, (int64_t)v);
171  return buf;
172 }
173 
175 {
176  if (isnan(V(STARTPTS))) {
177  V(STARTPTS) = TS2D(pts);
178  V(STARTT ) = TS2T(pts, inlink->time_base);
179  }
180  if (isnan(V(T_CHANGE))) {
181  V(T_CHANGE) = TS2T(pts, inlink->time_base);
182  }
183  V(PTS ) = TS2D(pts);
184  V(T ) = TS2T(pts, inlink->time_base);
185 #if FF_API_FRAME_PKT
187  V(POS ) = !frame || frame->pkt_pos == -1 ? NAN : frame->pkt_pos;
189 #endif
190  V(RTCTIME ) = av_gettime();
191 
192  if (frame) {
193  if (inlink->type == AVMEDIA_TYPE_VIDEO) {
194  V(INTERLACED) = !!(frame->flags & AV_FRAME_FLAG_INTERLACED);
195  } else if (inlink->type == AVMEDIA_TYPE_AUDIO) {
196  V(S) = frame->nb_samples;
197  V(NB_SAMPLES) = frame->nb_samples;
198  }
199  }
200 
201  return av_expr_eval(setpts->expr, setpts->var_values, NULL);
202 }
203 #define d2istr(v) double2int64str((char[BUF_SIZE]){0}, v)
204 
206 {
207  SetPTSContext *setpts = inlink->dst->priv;
208  int64_t in_pts = frame->pts;
209  double d;
210 
211  d = eval_pts(setpts, inlink, frame, frame->pts);
212  frame->pts = D2TS(d);
213  frame->duration = 0;
214 
215  av_log(inlink->dst, AV_LOG_TRACE,
216  "N:%"PRId64" PTS:%s T:%f",
217  (int64_t)V(N), d2istr(V(PTS)), V(T));
218  switch (inlink->type) {
219  case AVMEDIA_TYPE_VIDEO:
220  av_log(inlink->dst, AV_LOG_TRACE, " INTERLACED:%"PRId64,
221  (int64_t)V(INTERLACED));
222  break;
223  case AVMEDIA_TYPE_AUDIO:
224  av_log(inlink->dst, AV_LOG_TRACE, " NB_SAMPLES:%"PRId64" NB_CONSUMED_SAMPLES:%"PRId64,
225  (int64_t)V(NB_SAMPLES),
226  (int64_t)V(NB_CONSUMED_SAMPLES));
227  break;
228  }
229  av_log(inlink->dst, AV_LOG_TRACE, " -> PTS:%s T:%f\n", d2istr(d), TS2T(d, inlink->time_base));
230 
231  if (inlink->type == AVMEDIA_TYPE_VIDEO) {
232  V(N) += 1.0;
233  } else {
234  V(N) += frame->nb_samples;
235  }
236 
237  V(PREV_INPTS ) = TS2D(in_pts);
238  V(PREV_INT ) = TS2T(in_pts, inlink->time_base);
239  V(PREV_OUTPTS) = TS2D(frame->pts);
240  V(PREV_OUTT) = TS2T(frame->pts, inlink->time_base);
241  if (setpts->type == AVMEDIA_TYPE_AUDIO) {
242  V(NB_CONSUMED_SAMPLES) += frame->nb_samples;
243  }
244  return ff_filter_frame(inlink->dst->outputs[0], frame);
245 }
246 
248 {
249  SetPTSContext *setpts = ctx->priv;
250  AVFilterLink *inlink = ctx->inputs[0];
251  AVFilterLink *outlink = ctx->outputs[0];
252  AVFrame *in;
253  int status;
254  int64_t pts;
255  int ret;
256 
258 
260  if (ret < 0)
261  return ret;
262  if (ret > 0)
263  return filter_frame(inlink, in);
264 
266  double d = eval_pts(setpts, inlink, NULL, pts);
267 
268  av_log(ctx, AV_LOG_TRACE, "N:EOF PTS:%s T:%f -> PTS:%s T:%f\n",
269  d2istr(V(PTS)), V(T), d2istr(d), TS2T(d, inlink->time_base));
270  ff_outlink_set_status(outlink, status, D2TS(d));
271  return 0;
272  }
273 
275 
276  return FFERROR_NOT_READY;
277 }
278 
280 {
281  SetPTSContext *setpts = ctx->priv;
282  av_expr_free(setpts->expr);
283  setpts->expr = NULL;
284 }
285 
286 static int process_command(AVFilterContext *ctx, const char *cmd, const char *arg,
287  char *res, int res_len, int flags)
288 {
289  SetPTSContext *setpts = ctx->priv;
290  AVExpr *new_expr;
291  int ret;
292 
293  ret = ff_filter_process_command(ctx, cmd, arg, res, res_len, flags);
294 
295  if (ret < 0)
296  return ret;
297 
298  if (!strcmp(cmd, "expr")) {
299  ret = av_expr_parse(&new_expr, arg, var_names, NULL, NULL, NULL, NULL, 0, ctx);
300  // Only free and replace previous expression if new one succeeds,
301  // otherwise defensively keep everything intact even if reporting an error.
302  if (ret < 0) {
303  av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n", arg);
304  } else {
305  av_expr_free(setpts->expr);
306  setpts->expr = new_expr;
307  V(T_CHANGE) = NAN;
308  }
309  } else {
310  ret = AVERROR(EINVAL);
311  }
312 
313  return ret;
314 }
315 #undef V
316 
317 #define OFFSET(x) offsetof(SetPTSContext, x)
318 #define V AV_OPT_FLAG_VIDEO_PARAM
319 #define A AV_OPT_FLAG_AUDIO_PARAM
320 #define R AV_OPT_FLAG_RUNTIME_PARAM
321 #define F AV_OPT_FLAG_FILTERING_PARAM
322 
323 #if CONFIG_SETPTS_FILTER
324 static const AVOption setpts_options[] = {
325  { "expr", "Expression determining the frame timestamp", OFFSET(expr_str), AV_OPT_TYPE_STRING, { .str = "PTS" }, .flags = V|F|R },
326  { "strip_fps", "Unset framerate metadata", OFFSET(strip_fps), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = V|F },
327  { NULL }
328 };
329 AVFILTER_DEFINE_CLASS(setpts);
330 
331 static const AVFilterPad avfilter_vf_setpts_inputs[] = {
332  {
333  .name = "default",
334  .type = AVMEDIA_TYPE_VIDEO,
335  .config_props = config_input,
336  },
337 };
338 
339 static const AVFilterPad outputs_video[] = {
340  {
341  .name = "default",
342  .type = AVMEDIA_TYPE_VIDEO,
343  .config_props = config_output_video,
344  },
345 };
346 
347 const FFFilter ff_vf_setpts = {
348  .p.name = "setpts",
349  .p.description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."),
350  .p.flags = AVFILTER_FLAG_METADATA_ONLY,
351 
352  .p.priv_class = &setpts_class,
353 
354  .init = init,
355  .activate = activate,
356  .uninit = uninit,
357  .process_command = process_command,
358 
359  .priv_size = sizeof(SetPTSContext),
360 
361  FILTER_INPUTS(avfilter_vf_setpts_inputs),
362  FILTER_OUTPUTS(outputs_video),
363 };
364 #endif /* CONFIG_SETPTS_FILTER */
365 
366 #if CONFIG_ASETPTS_FILTER
367 
368 static const AVOption asetpts_options[] = {
369  { "expr", "Expression determining the frame timestamp", OFFSET(expr_str), AV_OPT_TYPE_STRING, { .str = "PTS" }, .flags = A|F|R },
370  { NULL }
371 };
372 AVFILTER_DEFINE_CLASS(asetpts);
373 
374 static const AVFilterPad asetpts_inputs[] = {
375  {
376  .name = "default",
377  .type = AVMEDIA_TYPE_AUDIO,
378  .config_props = config_input,
379  },
380 };
381 
382 const FFFilter ff_af_asetpts = {
383  .p.name = "asetpts",
384  .p.description = NULL_IF_CONFIG_SMALL("Set PTS for the output audio frame."),
385  .p.priv_class = &asetpts_class,
386  .p.flags = AVFILTER_FLAG_METADATA_ONLY,
387  .init = init,
388  .activate = activate,
389  .uninit = uninit,
390  .process_command = process_command,
391  .priv_size = sizeof(SetPTSContext),
392  FILTER_INPUTS(asetpts_inputs),
394 };
395 #endif /* CONFIG_ASETPTS_FILTER */
FF_ENABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:73
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
var_name
var_name
Definition: noise.c:47
BUF_SIZE
#define BUF_SIZE
Definition: setpts.c:165
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1078
SetPTSContext
Definition: setpts.c:97
FFERROR_NOT_READY
return FFERROR_NOT_READY
Definition: filter_design.txt:204
int64_t
long long int64_t
Definition: coverity.c:34
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:410
VAR_STARTT
@ VAR_STARTT
Definition: setpts.c:85
AVOption
AVOption.
Definition: opt.h:429
VAR_FRAME_RATE
@ VAR_FRAME_RATE
Definition: setpts.c:70
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:225
VAR_SAMPLE_RATE
@ VAR_SAMPLE_RATE
Definition: setpts.c:83
mathematics.h
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:203
VAR_N
@ VAR_N
Definition: setpts.c:72
video.h
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: setpts.c:205
FF_FILTER_FORWARD_STATUS_BACK
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
Definition: filters.h:637
av_expr_parse
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
Definition: eval.c:710
S
#define S(s, c, i)
Definition: flacdsp_template.c:46
ff_inlink_consume_frame
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Definition: avfilter.c:1507
AVFilterContext::priv
void * priv
private data for use by the filter
Definition: avfilter.h:272
VAR_PREV_INT
@ VAR_PREV_INT
Definition: setpts.c:79
VAR_RTCSTART
@ VAR_RTCSTART
Definition: setpts.c:89
SetPTSContext::var_values
double var_values[VAR_VARS_NB]
Definition: setpts.c:102
pts
static int64_t pts
Definition: transcode_aac.c:644
av_expr_free
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
Definition: eval.c:358
AVRational::num
int num
Numerator.
Definition: rational.h:59
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
OFFSET
#define OFFSET(x)
Definition: setpts.c:317
T
#define T(x)
Definition: vpx_arith.h:29
AV_LOG_TRACE
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition: log.h:235
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
av_cold
#define av_cold
Definition: attributes.h:90
D2TS
#define D2TS(d)
Definition: filters.h:479
init
static av_cold int init(AVFilterContext *ctx)
Definition: setpts.c:109
FFFilter
Definition: filters.h:265
activate
static int activate(AVFilterContext *ctx)
Definition: setpts.c:247
VAR_SR
@ VAR_SR
Definition: setpts.c:91
ff_outlink_set_status
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Definition: filters.h:627
s
#define s(width, name)
Definition: cbs_vp9.c:198
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
eval_pts
static double eval_pts(SetPTSContext *setpts, AVFilterLink *inlink, AVFrame *frame, int64_t pts)
Definition: setpts.c:174
filters.h
VAR_PREV_INPTS
@ VAR_PREV_INPTS
Definition: setpts.c:78
ctx
AVFormatContext * ctx
Definition: movenc.c:49
av_expr_eval
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
Definition: eval.c:792
AVExpr
Definition: eval.c:158
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NAN
#define NAN
Definition: mathematics.h:115
arg
const char * arg
Definition: jacosubdec.c:67
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
NULL
#define NULL
Definition: coverity.c:32
d2istr
#define d2istr(v)
Definition: setpts.c:203
VAR_POS
@ VAR_POS
Definition: noise.c:56
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
isnan
#define isnan(x)
Definition: libm.h:340
VAR_RTCTIME
@ VAR_RTCTIME
Definition: setpts.c:88
VAR_PTS
@ VAR_PTS
Definition: setpts.c:82
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:34
time.h
AVFILTER_DEFINE_CLASS
#define AVFILTER_DEFINE_CLASS(fname)
Definition: filters.h:476
SetPTSContext::expr_str
char * expr_str
Definition: setpts.c:99
ff_inlink_acknowledge_status
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
Definition: avfilter.c:1454
ff_filter_link
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition: filters.h:197
TS2D
#define TS2D(ts)
Definition: filters.h:480
R
#define R
Definition: setpts.c:320
eval.h
AVMediaType
AVMediaType
Definition: avutil.h:199
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
INTERLACED
#define INTERLACED
Definition: a64multienc.c:40
VAR_T_CHANGE
@ VAR_T_CHANGE
Definition: setpts.c:93
TS2T
#define TS2T(ts, tb)
Definition: filters.h:481
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:917
FF_FILTER_FORWARD_WANTED
FF_FILTER_FORWARD_WANTED(outlink, inlink)
VAR_NB_CONSUMED_SAMPLES
@ VAR_NB_CONSUMED_SAMPLES
Definition: setpts.c:73
N
#define N
Definition: af_mcompand.c:54
TB
#define TB(i)
Definition: prosumer.c:202
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Definition: setpts.c:286
ff_af_asetpts
const FFFilter ff_af_asetpts
A
#define A
Definition: setpts.c:319
internal.h
F
#define F
Definition: setpts.c:321
VAR_TB
@ VAR_TB
Definition: setpts.c:87
VAR_FR
@ VAR_FR
Definition: setpts.c:92
double2int64str
static char * double2int64str(char *buf, double v)
Definition: setpts.c:167
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
VAR_PREV_OUTT
@ VAR_PREV_OUTT
Definition: setpts.c:81
AV_FRAME_FLAG_INTERLACED
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
Definition: frame.h:669
VAR_PREV_OUTPTS
@ VAR_PREV_OUTPTS
Definition: setpts.c:80
ret
ret
Definition: filter_design.txt:187
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
config_output_video
static int config_output_video(AVFilterLink *outlink)
Definition: setpts.c:154
status
ov_status_e status
Definition: dnn_backend_openvino.c:100
SetPTSContext::strip_fps
int strip_fps
Definition: setpts.c:101
AVRational::den
int den
Denominator.
Definition: rational.h:60
SetPTSContext::expr
AVExpr * expr
Definition: setpts.c:100
avfilter.h
VAR_NB_SAMPLES
@ VAR_NB_SAMPLES
Definition: setpts.c:74
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:166
var_names
static const char *const var_names[]
Definition: setpts.c:41
AVFilterContext
An instance of a filter.
Definition: avfilter.h:257
VAR_STARTPTS
@ VAR_STARTPTS
Definition: setpts.c:84
av_gettime
int64_t av_gettime(void)
Get the current time in microseconds.
Definition: time.c:39
FF_DISABLE_DEPRECATION_WARNINGS
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:72
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FFFilter::p
AVFilter p
The public AVFilter.
Definition: filters.h:269
audio.h
VAR_S
@ VAR_S
Definition: setpts.c:90
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
VAR_VARS_NB
@ VAR_VARS_NB
Definition: setpts.c:94
config_input
static int config_input(AVFilterLink *inlink)
Definition: setpts.c:132
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: setpts.c:279
snprintf
#define snprintf
Definition: snprintf.h:34
POS
#define POS(c_idx, x, y)
SetPTSContext::type
enum AVMediaType type
Definition: setpts.c:103
ff_vf_setpts
const FFFilter ff_vf_setpts
VAR_T
@ VAR_T
Definition: setpts.c:86
V
#define V(name_)
Definition: setpts.c:318
VAR_INTERLACED
@ VAR_INTERLACED
Definition: setpts.c:71