How to filter out overlapping audio? Given a mixed track and one stem track, what's the best way to "subtract" the stem from the mix?

Video Production Asked on October 28, 2021

Given two audio streams, I’d like to remove the audio in one stream that also exists in another. In this particular case the 1st stream contains everything mixed, and the 2nd stream contains just the background noise which also exists in the 1st stream. Is there a reasonable way to go about "subtracting" this background audio track from the 1st audio track?

Ideally using ffmpeg, but open to anything. I’ve naively tried inverting the background channel and mixing it with the first channel with this ffmpeg filter: aeval=val(0)|-val(1) but that doesn’t work. I assume that’s because the background is mixed at a different level. (I’m also assuming they’re exactly in phase)

Any other ideas?

audio visualization

For reference, here’s ffmpeg showcqt filter on each channel side by side. You can see how the 2nd column seems to "contain" all of the audio in the first column, plus some more. (and mixed at different levels)

One Answer

Inverting the background should work, that's exactly how a balanced audio connection works to eliminate noise, but how exact a match is your isolated background track compared to the mixed track? It's only going to fully work if it is recorded at the exact same quality, volume, etc, and the timing is precisely the same. What was the recording source for each track? How confident are you that the two sets of background audio that were recorded are identical to each other?

Answered by Peter Barton on October 28, 2021

Add your own answers!

Related Questions

What causes a loud tone/noise in Blackmagic ATEM talkback?

1  Asked on December 31, 2021 by totymedli


Reimport exported file and make all the cuts same

1  Asked on December 28, 2021 by azz-kawa


Save video track names as a preset

1  Asked on December 28, 2021


clean HDMI output camera – on start

2  Asked on December 26, 2021 by mk


Adding separate WebVTT files to FFmpeg HLS muxer

0  Asked on December 10, 2021 by t_bmn


Record video to timeline during playback

2  Asked on December 6, 2021 by rjgmore


VHS Wobble After Effects

1  Asked on November 16, 2021 by kurajber


Find duration only with ffprobe in Windows

1  Asked on November 16, 2021 by k7aay


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP