Created
December 3, 2023 03:32
-
-
Save Roman-Port/0f95f3739ee0bd5158ea4cd43c94e8f9 to your computer and use it in GitHub Desktop.
FFMPEG Stereo Difference Split and Join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creates L+R and L-R channels: | |
ffmpeg -i test.wav -filter_complex "[0:a]channelsplit=channel_layout=stereo[l][r];[r]volume=volume=-1[ri];[l][ri]amix=inputs=2[diff];[0:a]channelsplit=channel_layout=stereo[l][r];[l][r]amix=inputs=2:weights=0.5[add]" -map "[add]" add.wav -map "[diff]" diff.wav | |
Merges L+R and L-R back into a stereo file, identical to the original input: | |
ffmpeg -i add.wav -i diff.wav -filter_complex "[1:a]volume=volume=-1[diffi];[0:a][1:a]amix=inputs=2[l];[0:a][diffi]amix=inputs=2[r];[l][r]join=inputs=2:channel_layout=stereo[outpre];[outpre]volume=volume=2[out]" -map "[out]" testout.wav |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment