2

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)
faboudib
  • 21
  • 1
  • The C++ code I used above actually relates to video filters while the filter I was trying to apply is a complex filter. I couldn't find any documentation on how to apply complex filters using the FFmpeg API. – faboudib Apr 22 '21 at 09:52
  • Did you find out the solution? I run into the same thing. – CJ_Notned Mar 20 '23 at 15:28

0 Answers0