FFmpeg
Loading...
Searching...
No Matches
vf_zoompan.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 Paul B Mahol
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "libavutil/eval.h"
22#include "libavutil/opt.h"
23#include "libavutil/pixdesc.h"
24#include "avfilter.h"
25#include "filters.h"
26#include "video.h"
27#include "libswscale/swscale.h"
28
29static const char *const var_names[] = {
30 "in_w", "iw",
31 "in_h", "ih",
32 "out_w", "ow",
33 "out_h", "oh",
34 "in",
35 "on",
36 "duration",
37 "pduration",
38 "in_time", "it",
39 "out_time", "time", "ot",
40 "frame",
41 "zoom",
42 "pzoom",
43 "x", "px",
44 "y", "py",
45 "a",
46 "sar",
47 "dar",
48 "hsub",
49 "vsub",
50 NULL
51};
52
76
100
101#define OFFSET(x) offsetof(ZPContext, x)
102#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
103static const AVOption zoompan_options[] = {
104 { "zoom", "set the zoom expression", OFFSET(zoom_expr_str), AV_OPT_TYPE_STRING, {.str = "1" }, .flags = FLAGS },
105 { "z", "set the zoom expression", OFFSET(zoom_expr_str), AV_OPT_TYPE_STRING, {.str = "1" }, .flags = FLAGS },
106 { "x", "set the x expression", OFFSET(x_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, .flags = FLAGS },
107 { "y", "set the y expression", OFFSET(y_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, .flags = FLAGS },
108 { "d", "set the duration expression", OFFSET(duration_expr_str), AV_OPT_TYPE_STRING, {.str="90"}, .flags = FLAGS },
109 { "s", "set the output image size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, .flags = FLAGS },
110 { "fps", "set the output framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, .flags = FLAGS },
111 { NULL }
112};
113
115
117{
118 ZPContext *s = ctx->priv;
119
120 s->prev_zoom = 1;
121 return 0;
122}
123
124static int config_output(AVFilterLink *outlink)
125{
126 AVFilterContext *ctx = outlink->src;
127 FilterLink *l = ff_filter_link(outlink);
128 ZPContext *s = ctx->priv;
129 int ret;
130
131 outlink->w = s->w;
132 outlink->h = s->h;
133 outlink->time_base = av_inv_q(s->framerate);
134 l->frame_rate = s->framerate;
135 s->desc = av_pix_fmt_desc_get(outlink->format);
136 s->finished = 1;
137
138 ret = av_expr_parse(&s->zoom_expr, s->zoom_expr_str, var_names, NULL, NULL, NULL, NULL, 0, ctx);
139 if (ret < 0)
140 return ret;
141
142 ret = av_expr_parse(&s->x_expr, s->x_expr_str, var_names, NULL, NULL, NULL, NULL, 0, ctx);
143 if (ret < 0)
144 return ret;
145
146 ret = av_expr_parse(&s->y_expr, s->y_expr_str, var_names, NULL, NULL, NULL, NULL, 0, ctx);
147 if (ret < 0)
148 return ret;
149
150 return 0;
151}
152
153static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_values, int i,
154 double *zoom, double *dx, double *dy)
155{
156 ZPContext *s = ctx->priv;
157 AVFilterLink *outlink = ctx->outputs[0];
158 FilterLink *outl = ff_filter_link(outlink);
159 AVFilterLink *inlink = ctx->inputs[0];
160 int64_t pts = s->frame_count;
161 int k, x, y, w, h, ret = 0;
162 uint8_t *input[4];
163 int px[4], py[4];
164 AVFrame *out;
165
166 var_values[VAR_PX] = s->x;
167 var_values[VAR_PY] = s->y;
168 var_values[VAR_PZOOM] = s->prev_zoom;
169 var_values[VAR_PDURATION] = s->prev_nb_frames;
170 var_values[VAR_IN_TIME] = var_values[VAR_IT] = in->pts == AV_NOPTS_VALUE ?
171 NAN : in->pts * av_q2d(inlink->time_base);
172 var_values[VAR_OUT_TIME] = pts * av_q2d(outlink->time_base);
173 var_values[VAR_TIME] = var_values[VAR_OT] = var_values[VAR_OUT_TIME];
174 var_values[VAR_FRAME] = i;
175 var_values[VAR_ON] = outl->frame_count_in;
176
177 *zoom = av_expr_eval(s->zoom_expr, var_values, NULL);
178
179 *zoom = av_clipd(*zoom, 1, 10);
180 var_values[VAR_ZOOM] = *zoom;
181 w = in->width * (1.0 / *zoom);
182 h = in->height * (1.0 / *zoom);
183
184 *dx = av_expr_eval(s->x_expr, var_values, NULL);
185
186 x = *dx = av_clipd(*dx, 0, FFMAX(in->width - w, 0));
187 var_values[VAR_X] = *dx;
188 x &= ~((1 << s->desc->log2_chroma_w) - 1);
189
190 *dy = av_expr_eval(s->y_expr, var_values, NULL);
191
192 y = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0));
193 var_values[VAR_Y] = *dy;
194 y &= ~((1 << s->desc->log2_chroma_h) - 1);
195
196 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
197 if (!out) {
198 ret = AVERROR(ENOMEM);
199 return ret;
200 }
201
202 px[1] = px[2] = AV_CEIL_RSHIFT(x, s->desc->log2_chroma_w);
203 px[0] = px[3] = x;
204
205 py[1] = py[2] = AV_CEIL_RSHIFT(y, s->desc->log2_chroma_h);
206 py[0] = py[3] = y;
207
208 s->sws = sws_alloc_context();
209 if (!s->sws) {
210 ret = AVERROR(ENOMEM);
211 goto error;
212 }
213
214 for (k = 0; in->data[k]; k++)
215 input[k] = in->data[k] + py[k] * in->linesize[k] + px[k];
216
217 av_opt_set_int(s->sws, "srcw", w, 0);
218 av_opt_set_int(s->sws, "srch", h, 0);
219 av_opt_set_int(s->sws, "src_format", in->format, 0);
220 av_opt_set_int(s->sws, "dstw", outlink->w, 0);
221 av_opt_set_int(s->sws, "dsth", outlink->h, 0);
222 av_opt_set_int(s->sws, "dst_format", outlink->format, 0);
223 av_opt_set_int(s->sws, "sws_flags", SWS_BICUBIC, 0);
224
225 if ((ret = sws_init_context(s->sws, NULL, NULL)) < 0)
226 goto error;
227
228 sws_scale(s->sws, (const uint8_t *const *)&input, in->linesize, 0, h, out->data, out->linesize);
229
230 out->pts = pts;
231 s->frame_count++;
232
233 ret = ff_filter_frame(outlink, out);
234 sws_freeContext(s->sws);
235 s->sws = NULL;
236 s->current_frame++;
237
238 if (s->current_frame >= s->nb_frames) {
239 if (*dx != -1)
240 s->x = *dx;
241 if (*dy != -1)
242 s->y = *dy;
243 if (*zoom != -1)
244 s->prev_zoom = *zoom;
245 s->prev_nb_frames = s->nb_frames;
246 s->nb_frames = 0;
247 s->current_frame = 0;
248 av_frame_free(&s->in);
249 s->finished = 1;
250 }
251 return ret;
252error:
253 sws_freeContext(s->sws);
254 s->sws = NULL;
256 return ret;
257}
258
260{
261 ZPContext *s = ctx->priv;
262 AVFilterLink *inlink = ctx->inputs[0];
263 FilterLink *inl = ff_filter_link(inlink);
264 AVFilterLink *outlink = ctx->outputs[0];
265 FilterLink *outl = ff_filter_link(outlink);
266 int status, ret = 0;
267 int64_t pts;
268
269 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
270
271 if (s->in && ff_outlink_frame_wanted(outlink)) {
272 double zoom = -1, dx = -1, dy = -1;
273
274 ret = output_single_frame(ctx, s->in, s->var_values, s->current_frame,
275 &zoom, &dx, &dy);
276 if (ret < 0)
277 return ret;
278 }
279
280 if (!s->in && (ret = ff_inlink_consume_frame(inlink, &s->in)) > 0) {
281 double zoom = -1, dx = -1, dy = -1, nb_frames;
282
283 s->finished = 0;
284 s->var_values[VAR_IN_W] = s->var_values[VAR_IW] = s->in->width;
285 s->var_values[VAR_IN_H] = s->var_values[VAR_IH] = s->in->height;
286 s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = s->w;
287 s->var_values[VAR_OUT_H] = s->var_values[VAR_OH] = s->h;
288 s->var_values[VAR_IN] = inl->frame_count_out - 1;
289 s->var_values[VAR_ON] = outl->frame_count_in;
290 s->var_values[VAR_PX] = s->x;
291 s->var_values[VAR_PY] = s->y;
292 s->var_values[VAR_X] = 0;
293 s->var_values[VAR_Y] = 0;
294 s->var_values[VAR_PZOOM] = s->prev_zoom;
295 s->var_values[VAR_ZOOM] = 1;
296 s->var_values[VAR_PDURATION] = s->prev_nb_frames;
297 s->var_values[VAR_A] = (double) s->in->width / s->in->height;
298 s->var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
299 (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
300 s->var_values[VAR_DAR] = s->var_values[VAR_A] * s->var_values[VAR_SAR];
301 s->var_values[VAR_HSUB] = 1 << s->desc->log2_chroma_w;
302 s->var_values[VAR_VSUB] = 1 << s->desc->log2_chroma_h;
303
304 if ((ret = av_expr_parse_and_eval(&nb_frames, s->duration_expr_str,
305 var_names, s->var_values,
306 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
307 av_frame_free(&s->in);
308 return ret;
309 }
310
311 s->var_values[VAR_DURATION] = s->nb_frames = nb_frames;
312
313 ret = output_single_frame(ctx, s->in, s->var_values, s->current_frame,
314 &zoom, &dx, &dy);
315 if (ret < 0)
316 return ret;
317 }
318 if (ret < 0) {
319 return ret;
320 } else if (s->finished && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
321 ff_outlink_set_status(outlink, status, pts);
322 return 0;
323 } else {
324 if (ff_outlink_frame_wanted(outlink) && s->finished)
326 return 0;
327 }
328}
329
343
345{
346 ZPContext *s = ctx->priv;
347
348 sws_freeContext(s->sws);
349 s->sws = NULL;
350 av_expr_free(s->x_expr);
351 av_expr_free(s->y_expr);
352 av_expr_free(s->zoom_expr);
353 av_frame_free(&s->in);
354}
355
356static const AVFilterPad outputs[] = {
357 {
358 .name = "default",
359 .type = AVMEDIA_TYPE_VIDEO,
360 .config_props = config_output,
361 },
362};
363
365 .p.name = "zoompan",
366 .p.description = NULL_IF_CONFIG_SMALL("Apply Zoom & Pan effect."),
367 .p.priv_class = &zoompan_class,
368 .priv_size = sizeof(ZPContext),
369 .init = init,
370 .uninit = uninit,
375};
static const AVFilterPad outputs[]
Definition af_aap.c:310
const FFFilter ff_vf_zoompan
Definition vf_zoompan.c:364
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:1467
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
Definition avfilter.c:1690
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:1520
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Definition avfilter.c:1623
Main libavfilter public API header.
@ VAR_VSUB
Definition boxblur.c:42
@ VARS_NB
Definition boxblur.c:43
@ VAR_HSUB
Definition boxblur.c:41
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define FLAGS
Definition cmdutils.c:598
#define av_clipd
Definition common.h:148
#define AV_CEIL_RSHIFT(a, b)
Definition common.h:60
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
Definition eval.c:368
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
Definition eval.c:824
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Definition eval.c:839
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:735
simple arithmetic expression evaluator
@ VAR_IW
Definition f_select.c:147
@ VAR_IH
Definition f_select.c:146
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition opt.h:302
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition opt.h:314
@ 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:275
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition rational.h:104
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition rational.h:159
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition avutil.h:247
av_warn_unused_result int sws_init_context(SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
Definition utils.c:1884
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
Definition utils.c:1032
int attribute_align_arg sws_scale(SwsContext *sws, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
swscale wrapper, so we don't need to export the SwsContext.
Definition swscale.c:1626
void sws_freeContext(SwsContext *swsContext)
Free the swscaler context swsContext.
Definition utils.c:2250
@ SWS_BICUBIC
2-tap cubic B-spline
Definition swscale.h:199
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
Definition opt.c:934
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
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:629
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
Definition filters.h:639
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition filters.h:199
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
@ VAR_X
Definition vf_blend.c:55
@ VAR_Y
Definition vf_blend.c:55
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
uint8_t w
Definition llvidencdsp.c:39
#define FFMAX(a, b)
Definition macros.h:47
#define NAN
var_name
Definition noise.c:46
@ VAR_DURATION
Definition noise.c:54
static const char *const var_names[]
Definition noise.c:30
AVOptions.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition pixfmt.h:108
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition pixfmt.h:107
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition pixfmt.h:174
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition pixfmt.h:283
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition pixfmt.h:212
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition pixfmt.h:86
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition pixfmt.h:173
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition pixfmt.h:87
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85
@ VAR_OUT_H
Definition scale_eval.c:47
@ VAR_SAR
Definition scale_eval.c:49
@ VAR_OH
Definition scale_eval.c:47
@ VAR_IN_W
Definition scale_eval.c:44
@ VAR_OW
Definition scale_eval.c:46
@ VAR_A
Definition scale_eval.c:48
@ VAR_OUT_W
Definition scale_eval.c:46
@ VAR_IN_H
Definition scale_eval.c:45
@ VAR_DAR
Definition scale_eval.c:50
Describe the class of an AVClass context structure.
Definition log.h:76
Definition eval.c:171
An instance of a filter.
Definition avfilter.h:273
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition frame.h:574
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
int width
Definition frame.h:544
int height
Definition frame.h:544
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition frame.h:517
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition frame.h:559
AVOption.
Definition opt.h:428
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
Rational number (pair of numerator and denominator).
Definition rational.h:58
int num
Numerator.
Definition rational.h:59
int den
Denominator.
Definition rational.h:60
Main external API structure.
Definition swscale.h:227
char * x_expr_str
Definition vf_zoompan.c:80
char * zoom_expr_str
Definition vf_zoompan.c:79
int current_frame
Definition vf_zoompan.c:96
int nb_frames
Definition vf_zoompan.c:95
double x
Definition vf_zoompan.c:87
AVFrame * in
Definition vf_zoompan.c:93
struct SwsContext * sws
Definition vf_zoompan.c:90
AVExpr * y_expr
Definition vf_zoompan.c:84
int prev_nb_frames
Definition vf_zoompan.c:89
double y
Definition vf_zoompan.c:87
double prev_zoom
Definition vf_zoompan.c:88
AVExpr * zoom_expr
Definition vf_zoompan.c:84
int finished
Definition vf_zoompan.c:97
int64_t frame_count
Definition vf_zoompan.c:91
char * y_expr_str
Definition vf_zoompan.c:81
AVRational framerate
Definition vf_zoompan.c:98
AVExpr * x_expr
Definition vf_zoompan.c:84
const AVPixFmtDescriptor * desc
Definition vf_zoompan.c:92
double var_values[VARS_NB]
Definition vf_zoompan.c:94
char * duration_expr_str
Definition vf_zoompan.c:82
external API header
static void error(const char *err)
float framerate
Definition av1_levels.c:29
static FILE * out
Definition movenc.c:55
static AVFormatContext * ctx
Definition movenc.c:49
static int64_t pts
@ VAR_OT
@ VAR_ON
@ VAR_IN
static void zoom(float *u, float *v, float amount)
Definition vf_xfade.c:1695
@ VAR_TIME
Definition vf_zoompan.c:63
@ VAR_PDURATION
Definition vf_zoompan.c:61
@ VARS_NB
Definition vf_zoompan.c:74
@ VAR_PZOOM
Definition vf_zoompan.c:66
@ VAR_IN_TIME
Definition vf_zoompan.c:62
@ VAR_PY
Definition vf_zoompan.c:68
@ VAR_IT
Definition vf_zoompan.c:62
@ VAR_OUT_TIME
Definition vf_zoompan.c:63
@ VAR_FRAME
Definition vf_zoompan.c:64
@ VAR_PX
Definition vf_zoompan.c:67
@ VAR_ZOOM
Definition vf_zoompan.c:65
static const AVOption zoompan_options[]
Definition vf_zoompan.c:103
static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_values, int i, double *zoom, double *dx, double *dy)
Definition vf_zoompan.c:153
static int activate(AVFilterContext *ctx)
Definition vf_zoompan.c:259
static av_cold void uninit(AVFilterContext *ctx)
Definition vf_zoompan.c:344
#define OFFSET(x)
Definition vf_zoompan.c:101
static int config_output(AVFilterLink *outlink)
Definition vf_zoompan.c:124
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition video.c:89