[Libav-user] Overlay filter inputs: How to assign?

Andrey Mochenov andrey2067 at gmail.com
Tue Aug 20 18:48:24 CEST 2013


Hi everyone,

I want to use the "overlay" filter.
But I do not know, how exactly to assign the "outputs" parameter for the
avfilter_graph_parse() command.
As a result, I get the following error from the avfilter_graph_config()
command:
'Output pad "default" with type video of the filter instance
"input_main_filter"
of buffer not connected to any destination.'

Both standard FFmpeg examples, filtering_video.c and filtering_audio.c use
filters with one input and one output. The "overlay" filter has two inputs
and one output, so use two "buffer" filters for the inputs and one
"buffersink" filter for the ouput.

// Here is a part of main() program
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc,
"input_main_filter", argsStrMain, NULL, filter_graph);
ret = avfilter_graph_create_filter(&bufferovrlay_ctx, bufferovrlay,
"input_overlay_filter", argsStrOvrlay, NULL, filter_graph);
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink,
"output_filter", NULL, buffersink_params, filter_graph);

// *************** My questions: **********************************
// - What are the right names to be assigned (currently I use "in" and
"overlay")?
// - What is the right way to assign more than one input?

outputs->name = av_strdup("in");
outputs->filter_ctx = buffersrc_ctx;
outputs->pad_idx    = 0;
outputs->next       = outputOvrlay;

outputOvrlay->name = av_strdup("overlay");
outputOvrlay->filter_ctx = bufferovrlay_ctx;
outputOvrlay->pad_idx    = 1;
outputOvrlay->next       = NULL;

// ****************************************************************

inputs->name = av_strdup("out");
inputs->filter_ctx = buffersink_ctx;
inputs->pad_idx    = 0;
inputs->next       = NULL;

ret = avfilter_graph_parse(filter_graph, "overlay", &inputs, &outputs,
NULL);
ret = avfilter_graph_config(filter_graph, NULL);

Please, advise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130820/b36bcd80/attachment.html>


More information about the Libav-user mailing list