[FFmpeg-devel] [PATCH v5 08/12] avfilter/overlay_graphicsubs: Add overlay_graphicsubs and graphicsub2video filters

Soft Works softworkz at hotmail.com
Wed Sep 15 12:07:38 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Andreas Rheinhardt
> Sent: Sunday, 12 September 2021 22:00
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v5 08/12]
> avfilter/overlay_graphicsubs: Add overlay_graphicsubs and
> graphicsub2video filters
> 
> Soft Works:
> > Signed-off-by: softworkz <softworkz at hotmail.com>
> > ---
> >  doc/filters.texi                     | 104 ++++
> >  libavfilter/Makefile                 |   2 +
> >  libavfilter/allfilters.c             |   2 +
> >  libavfilter/vf_overlay_graphicsubs.c | 731
> +++++++++++++++++++++++++++
> >  4 files changed, 839 insertions(+)
> >  create mode 100644 libavfilter/vf_overlay_graphicsubs.c
> >
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 9ad6031d23..a6da018259 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -25016,6 +25016,110 @@ tools.
> >

[..]

> > +
> > +#define OFFSET(x) offsetof(OverlaySubsContext, x)
> > +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM |
> AV_OPT_FLAG_FILTERING_PARAM)
> > +
> > +static const AVOption overlay_graphicsubs_options[] = {
> > +    { "x", "set the x expression", OFFSET(x_expr),
> AV_OPT_TYPE_STRING, {.str = "0"}, 0, 0, FLAGS },
> > +    { "y", "set the y expression", OFFSET(y_expr),
> AV_OPT_TYPE_STRING, {.str = "0"}, 0, 0, FLAGS },
> > +    { "eof_action", "Action to take when encountering EOF from
> secondary input ",
> > +        OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 =
> EOF_ACTION_REPEAT },
> > +        EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS,
> "eof_action" },
> > +        { "repeat", "Repeat the previous frame.",   0,
> AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS,
> "eof_action" },
> > +        { "endall", "End both streams.",            0,
> AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS,
> "eof_action" },
> > +        { "pass",   "Pass through the main input.", 0,
> AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS },   .flags = FLAGS,
> "eof_action" },
> > +    { "eval", "specify when to evaluate expressions",
> OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_FRAME}, 0,
> EVAL_MODE_NB-1, FLAGS, "eval" },
> > +         { "init",  "eval expressions once during initialization",
> 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT},  .flags = FLAGS, .unit =
> "eval" },
> > +         { "frame", "eval expressions per-frame",
> 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit =
> "eval" },
> > +    { "shortest", "force termination when the shortest input
> terminates", OFFSET(fs.opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 },
> 0, 1, FLAGS },
> > +    { "repeatlast", "repeat overlay of the last overlay frame",
> OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
> 
> Why are you duplicating framesync options? They are already
> accessible
> (that's what the preinit and the child_next/child_class_next stuff is
> for).

Both vf_overlay and vf_overlay_qsv have it that way, are you sure 
I can drop it?

Thanks,
sw


More information about the ffmpeg-devel mailing list