I am trying to implement C++ code which uses an FFmpeg filter to merge 2 mono audio streams from input video into 1 stereo stream. The filter itself can be found easily enough in several sources:
FFmpeg: How to merge all audio streams into stereo
http://underpop.online.fr/f/ffmpeg/help/amerge.htm.gz
My question relates to how I can implement this in code. I am using the exact same code found in the FFmpeg examples here: https://ffmpeg.org/doxygen/trunk/filtering_audio_8c-example.html
I just change the filter_descr variable to:
static const char *filter_descr = "[0:1][0:2] amerge=inputs=2";
When I use this I get the following exception: Output pad "default" with type audio of the filter instance "in" of a buffer not connected to any destination I get an Invalid Argument -22 exception when I'm configuring the filter graph
if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)