<div dir="ltr"><div>Hi everyone,</div><div> </div><div>I want to use the "overlay" filter.  </div><div>But I do not know, how exactly to assign the "outputs" parameter for the avfilter_graph_parse() command.<br>
As a result, I get the following error from the avfilter_graph_config() command: <br>'Output pad "default" with type video of the filter instance "input_main_filter"<br>of buffer not connected to any destination.'</div>
<div><br>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. </div>
<p>// Here is a part of main() program<br>ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "input_main_filter", argsStrMain, NULL, filter_graph);<br>ret = avfilter_graph_create_filter(&bufferovrlay_ctx, bufferovrlay, "input_overlay_filter", argsStrOvrlay, NULL, filter_graph);<br>
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "output_filter", NULL, buffersink_params, filter_graph);</p><p>// *************** My questions: ********************************** <br>// - What are the right names to be assigned (currently I use "in" and "overlay")?<br>
// - What is the right way to assign more than one input? </p><p>outputs->name = av_strdup("in");        <br>outputs->filter_ctx = buffersrc_ctx;    <br>outputs->pad_idx    = 0;                <br>outputs->next       = outputOvrlay;     </p>
<p>outputOvrlay->name = av_strdup("overlay");       <br>outputOvrlay->filter_ctx = bufferovrlay_ctx;      <br>outputOvrlay->pad_idx    = 1;                     <br>outputOvrlay->next       = NULL;                 </p>
<p>// ****************************************************************</p><p>inputs->name = av_strdup("out");<br>inputs->filter_ctx = buffersink_ctx;<br>inputs->pad_idx    = 0;<br>inputs->next       = NULL;</p>
<p>ret = avfilter_graph_parse(filter_graph, "overlay", &inputs, &outputs, NULL);<br>ret = avfilter_graph_config(filter_graph, NULL);</p><p>Please, advise.</p></div>