History

avfilter/vf_zoompan: fix pts handling

Now output pts have some sense.

Paul B Mahol committed 10 years ago

Commit f42eae91 parent 8a343442 files · +8 −2Browse files

Unified · Split

2 files
  1. doc/filters.texi +3 −0
  2. libavfilter/vf_zoompan.c +5 −2
doc/filters.texi+3−0
@@ -12582,6 +12582,9 @@ single input image. · 12581 unmodified lines
12582 12582
12583@item s12583@item s
12584Set the output image size, default is 'hd720'.12584Set the output image size, default is 'hd720'.
12585
12586@item fps
12587Set the output frame rate, default is '25'.
12585@end table12588@end table
12586 12589
12587Each expression can contain the following constants:12590Each expression can contain the following constants:
libavfilter/vf_zoompan.c+5−2
@@ -92,6 +92,7 @@ typedef struct ZPcontext { · 91 unmodified lines
92 int nb_frames;92 int nb_frames;
93 int current_frame;93 int current_frame;
94 int finished;94 int finished;
95 AVRational framerate;
95} ZPContext;96} ZPContext;
96 97
97#define OFFSET(x) offsetof(ZPContext, x)98#define OFFSET(x) offsetof(ZPContext, x)
@@ -103,6 +104,7 @@ static const AVOption zoompan_options[] = { · 5 unmodified lines
103 { "y", "set the y expression", OFFSET(y_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, .flags = FLAGS },104 { "y", "set the y expression", OFFSET(y_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, .flags = FLAGS },
104 { "d", "set the duration expression", OFFSET(duration_expr_str), AV_OPT_TYPE_STRING, {.str="90"}, .flags = FLAGS },105 { "d", "set the duration expression", OFFSET(duration_expr_str), AV_OPT_TYPE_STRING, {.str="90"}, .flags = FLAGS },
105 { "s", "set the output image size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, .flags = FLAGS },106 { "s", "set the output image size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, .flags = FLAGS },
107 { "fps", "set the output framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, .flags = FLAGS },
106 { NULL }108 { NULL }
107};109};
108 110
@@ -123,6 +125,8 @@ static int config_output(AVFilterLink *outlink) · 14 unmodified lines
123 125
124 outlink->w = s->w;126 outlink->w = s->w;
125 outlink->h = s->h;127 outlink->h = s->h;
128 outlink->time_base = av_inv_q(s->framerate);
129 outlink->frame_rate = s->framerate;
126 s->desc = av_pix_fmt_desc_get(outlink->format);130 s->desc = av_pix_fmt_desc_get(outlink->format);
127 131
128 return 0;132 return 0;
@@ -133,8 +137,7 @@ static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_va · 4 unmodified lines
133{137{
134 ZPContext *s = ctx->priv;138 ZPContext *s = ctx->priv;
135 AVFilterLink *outlink = ctx->outputs[0];139 AVFilterLink *outlink = ctx->outputs[0];
136 int64_t pts = av_rescale_q(in->pts, ctx->inputs[0]->time_base,140 int64_t pts = s->frame_count;
137 outlink->time_base) + s->frame_count;
138 int k, x, y, w, h, ret = 0;141 int k, x, y, w, h, ret = 0;
139 uint8_t *input[4];142 uint8_t *input[4];
140 int px[4], py[4];143 int px[4], py[4];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t