FFMPEG: Properly sidechain_compress stereo background with stereo sidechain into stereo output












0















I'm doing voiceover and since Sony Vegas does not support sidechaining, I render voiceover into voices.wav and then use sidechain_compress filter, as per ffmpeg documentation:



ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
"[1:a]asplit=2[sc][mix];
[0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
[compr][mix]amerge" sidechain_1.wav


voices.wav is a stereo audio file, as well as background.m4a. But here's how the result file looks like when loaded into Sony Vegas:



enter image description here



This shows that in channels 1/2 I get the compressed background, while in channel 3 and 4 I get two mono tracks that somehow differ (probably, that's the original voices input and somewhat altered voices input, both in mono). UPD: I don't want to further process resulting tracks in Sony Vegas, I'd prefer ffmpeg to be the last step in my production process. The screenshot above is for illustration purposes only.




  1. Is the background gets sidechain compressed with only left or right channel of voices? If so, how to change that to make it compressed by both channels (some voices are panned into left or right, so there might be actual difference in compressed result)

  2. What are those channels 3 and 4? Why are they mono?

  3. How do I get single 1/2 stereo track in the output wav file instead of this weird 4 channels in 3 tracks? (I've looked at pan complex filter, but didn't figure out how to set it up in my case).










share|improve this question





























    0















    I'm doing voiceover and since Sony Vegas does not support sidechaining, I render voiceover into voices.wav and then use sidechain_compress filter, as per ffmpeg documentation:



    ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
    "[1:a]asplit=2[sc][mix];
    [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
    [compr][mix]amerge" sidechain_1.wav


    voices.wav is a stereo audio file, as well as background.m4a. But here's how the result file looks like when loaded into Sony Vegas:



    enter image description here



    This shows that in channels 1/2 I get the compressed background, while in channel 3 and 4 I get two mono tracks that somehow differ (probably, that's the original voices input and somewhat altered voices input, both in mono). UPD: I don't want to further process resulting tracks in Sony Vegas, I'd prefer ffmpeg to be the last step in my production process. The screenshot above is for illustration purposes only.




    1. Is the background gets sidechain compressed with only left or right channel of voices? If so, how to change that to make it compressed by both channels (some voices are panned into left or right, so there might be actual difference in compressed result)

    2. What are those channels 3 and 4? Why are they mono?

    3. How do I get single 1/2 stereo track in the output wav file instead of this weird 4 channels in 3 tracks? (I've looked at pan complex filter, but didn't figure out how to set it up in my case).










    share|improve this question



























      0












      0








      0








      I'm doing voiceover and since Sony Vegas does not support sidechaining, I render voiceover into voices.wav and then use sidechain_compress filter, as per ffmpeg documentation:



      ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
      "[1:a]asplit=2[sc][mix];
      [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
      [compr][mix]amerge" sidechain_1.wav


      voices.wav is a stereo audio file, as well as background.m4a. But here's how the result file looks like when loaded into Sony Vegas:



      enter image description here



      This shows that in channels 1/2 I get the compressed background, while in channel 3 and 4 I get two mono tracks that somehow differ (probably, that's the original voices input and somewhat altered voices input, both in mono). UPD: I don't want to further process resulting tracks in Sony Vegas, I'd prefer ffmpeg to be the last step in my production process. The screenshot above is for illustration purposes only.




      1. Is the background gets sidechain compressed with only left or right channel of voices? If so, how to change that to make it compressed by both channels (some voices are panned into left or right, so there might be actual difference in compressed result)

      2. What are those channels 3 and 4? Why are they mono?

      3. How do I get single 1/2 stereo track in the output wav file instead of this weird 4 channels in 3 tracks? (I've looked at pan complex filter, but didn't figure out how to set it up in my case).










      share|improve this question
















      I'm doing voiceover and since Sony Vegas does not support sidechaining, I render voiceover into voices.wav and then use sidechain_compress filter, as per ffmpeg documentation:



      ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
      "[1:a]asplit=2[sc][mix];
      [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
      [compr][mix]amerge" sidechain_1.wav


      voices.wav is a stereo audio file, as well as background.m4a. But here's how the result file looks like when loaded into Sony Vegas:



      enter image description here



      This shows that in channels 1/2 I get the compressed background, while in channel 3 and 4 I get two mono tracks that somehow differ (probably, that's the original voices input and somewhat altered voices input, both in mono). UPD: I don't want to further process resulting tracks in Sony Vegas, I'd prefer ffmpeg to be the last step in my production process. The screenshot above is for illustration purposes only.




      1. Is the background gets sidechain compressed with only left or right channel of voices? If so, how to change that to make it compressed by both channels (some voices are panned into left or right, so there might be actual difference in compressed result)

      2. What are those channels 3 and 4? Why are they mono?

      3. How do I get single 1/2 stereo track in the output wav file instead of this weird 4 channels in 3 tracks? (I've looked at pan complex filter, but didn't figure out how to set it up in my case).







      audio filter ffmpeg






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 21 at 11:10







      Eduard Sukharev

















      asked Jan 20 at 11:43









      Eduard SukharevEduard Sukharev

      5431826




      5431826
























          1 Answer
          1






          active

          oldest

          votes


















          1














          amerge adds the channels of the inputs. amix uses the channel count of the input with the most channels. So, switch to amix.



          ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
          "[1:a]asplit=2[sc][mix];
          [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
          [compr][mix]amix" sidechain_1.wav





          share|improve this answer


























          • Perhaps I put it the wrong way: I use Vegas for editing, then export voices as separate track to sidechain compress the original background. But I don't want to create new or otherwise alter the original vegas project, I'd prefer ffmpeg to be the last step. The actual last step will be the script that uses ffmpeg to combine muted HD source with voiceovered audio track.

            – Eduard Sukharev
            Jan 21 at 6:57











          • Modified command.

            – Gyan
            Jan 21 at 7:28











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54276085%2fffmpeg-properly-sidechain-compress-stereo-background-with-stereo-sidechain-into%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          amerge adds the channels of the inputs. amix uses the channel count of the input with the most channels. So, switch to amix.



          ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
          "[1:a]asplit=2[sc][mix];
          [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
          [compr][mix]amix" sidechain_1.wav





          share|improve this answer


























          • Perhaps I put it the wrong way: I use Vegas for editing, then export voices as separate track to sidechain compress the original background. But I don't want to create new or otherwise alter the original vegas project, I'd prefer ffmpeg to be the last step. The actual last step will be the script that uses ffmpeg to combine muted HD source with voiceovered audio track.

            – Eduard Sukharev
            Jan 21 at 6:57











          • Modified command.

            – Gyan
            Jan 21 at 7:28
















          1














          amerge adds the channels of the inputs. amix uses the channel count of the input with the most channels. So, switch to amix.



          ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
          "[1:a]asplit=2[sc][mix];
          [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
          [compr][mix]amix" sidechain_1.wav





          share|improve this answer


























          • Perhaps I put it the wrong way: I use Vegas for editing, then export voices as separate track to sidechain compress the original background. But I don't want to create new or otherwise alter the original vegas project, I'd prefer ffmpeg to be the last step. The actual last step will be the script that uses ffmpeg to combine muted HD source with voiceovered audio track.

            – Eduard Sukharev
            Jan 21 at 6:57











          • Modified command.

            – Gyan
            Jan 21 at 7:28














          1












          1








          1







          amerge adds the channels of the inputs. amix uses the channel count of the input with the most channels. So, switch to amix.



          ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
          "[1:a]asplit=2[sc][mix];
          [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
          [compr][mix]amix" sidechain_1.wav





          share|improve this answer















          amerge adds the channels of the inputs. amix uses the channel count of the input with the most channels. So, switch to amix.



          ffmpeg -y -i background.m4a -i voices.wav -filter_complex 
          "[1:a]asplit=2[sc][mix];
          [0:a][sc]sidechaincompress=threshold=0.015:ratio=2:level_sc=0.8:release=500:attack=1[compr];
          [compr][mix]amix" sidechain_1.wav






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 21 at 7:28

























          answered Jan 20 at 12:46









          GyanGyan

          32.2k22869




          32.2k22869













          • Perhaps I put it the wrong way: I use Vegas for editing, then export voices as separate track to sidechain compress the original background. But I don't want to create new or otherwise alter the original vegas project, I'd prefer ffmpeg to be the last step. The actual last step will be the script that uses ffmpeg to combine muted HD source with voiceovered audio track.

            – Eduard Sukharev
            Jan 21 at 6:57











          • Modified command.

            – Gyan
            Jan 21 at 7:28



















          • Perhaps I put it the wrong way: I use Vegas for editing, then export voices as separate track to sidechain compress the original background. But I don't want to create new or otherwise alter the original vegas project, I'd prefer ffmpeg to be the last step. The actual last step will be the script that uses ffmpeg to combine muted HD source with voiceovered audio track.

            – Eduard Sukharev
            Jan 21 at 6:57











          • Modified command.

            – Gyan
            Jan 21 at 7:28

















          Perhaps I put it the wrong way: I use Vegas for editing, then export voices as separate track to sidechain compress the original background. But I don't want to create new or otherwise alter the original vegas project, I'd prefer ffmpeg to be the last step. The actual last step will be the script that uses ffmpeg to combine muted HD source with voiceovered audio track.

          – Eduard Sukharev
          Jan 21 at 6:57





          Perhaps I put it the wrong way: I use Vegas for editing, then export voices as separate track to sidechain compress the original background. But I don't want to create new or otherwise alter the original vegas project, I'd prefer ffmpeg to be the last step. The actual last step will be the script that uses ffmpeg to combine muted HD source with voiceovered audio track.

          – Eduard Sukharev
          Jan 21 at 6:57













          Modified command.

          – Gyan
          Jan 21 at 7:28





          Modified command.

          – Gyan
          Jan 21 at 7:28




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54276085%2fffmpeg-properly-sidechain-compress-stereo-background-with-stereo-sidechain-into%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Callistus III

          Ostreoida

          Index Sanctorum