title: ffmpeg remove speaker audio from microphone input (echo cancellation)
body: <p>I am building a basic video chat application, and using ffmpeg and the directshow filter to grab video from a webcam and audio from a microphone, convert to h264 and opus and throw out as mpegts over a multicast UDP connection. I have this working well, except for one problem. When I speak, the audio is transmitted over UDP to the other end of the conversation where it is played out the speaker, picked up by the mic and sent back to me. This results in an ever increasing feedback loop of echoing audio.</p>
  <p>I have search high and low, without luck, and I am wondering if there is a way to get ffmpeg to produce 'echo cancellation' using the built in ffmpeg filters.</p>
  <p>I attempted a solution using aeval to reverse the phase of the speaker audio and amix to 'merge' the two audio streams, but could not seem to get both filters working at the same time. I also realise that there would be issues due to the fact that the mic would not necessarily be picking up the speakers at full volume (or at all if using a headset).</p>